Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

SoapContext for dim in web service call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stu - 24 Nov 2004 10:23 GMT
Hi,

I have a 3 tier architecture
My Front tier calls a webservice
ObjGeneral.getAttachment(p_cFileName)
Which calls the business rule tier and then fires off the code in the
dataAccess tier to
attach the file using WSE Dime and send to the front end.
However my problem seems to be
I cannot access the context of the webservice so I can read the stream
In the MS Article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wseref/html/T_M
icrosoft_Web_Services2_RequestSoapContext.asp


"When a one-way Web service method is hosted by ASP.NET, the Web service
method cannot access the SoapContext using the Current property. To gain
access to the SoapContext for one-way methods, the class implementing the Web
service should inherit from the System.Web.Services.WebService class and
include code in the one-way method to get the
System.Web.Services.WebService.Context property."

how do you do this ie access the context

my code is as follows

  objGeneral.streamServerAttachment(p_nIdClient, _
                                                   p_cReportFile, _
                                                   lnMimeType, _
                                                   p_lTaxReport)

               objStream = SoapContext.Current.Attachments(0).Stream

               objBinaryStream = New BinaryReader(objStream)
               lnStreamlength = CInt(objBinaryStream.BaseStream.Length)
               objBinaryStream.BaseStream.Read(objData, 0, lnStreamlength)

TIA

Stu
Dan Rogers - 02 Dec 2004 21:14 GMT
Hi Stu,

I'm not sure I understand what you're attempting exactly.  It seems to me
that a one-way call cannot satisfy your requirement to return data in an
attachement because a one way call cannot return data.

Am I missing something?

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: SoapContext for dim in web service call
thread-index: AcTSD5Vu1CNUkdxXTxGX5gmIMcGrxw==
X-WBNR-Posting-Host: 82.69.14.192
From: =?Utf-8?B?U3R1?= <Stu@discussions.microsoft.com>
Subject: SoapContext for dim in web service call
Date: Wed, 24 Nov 2004 02:23:04 -0800
Lines: 40
Message-ID: <CD472EED-CBB7-4007-A17F-8070B0115E1D@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
    charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:4930
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

Hi,

I have a 3 tier architecture
My Front tier calls a webservice
ObjGeneral.getAttachment(p_cFileName)
Which calls the business rule tier and then fires off the code in the
dataAccess tier to
attach the file using WSE Dime and send to the front end.
However my problem seems to be
I cannot access the context of the webservice so I can read the stream
In the MS Article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wseref/html
/T_Microsoft_Web_Services2_RequestSoapContext.asp

"When a one-way Web service method is hosted by ASP.NET, the Web service
method cannot access the SoapContext using the Current property. To gain
access to the SoapContext for one-way methods, the class implementing the
Web
service should inherit from the System.Web.Services.WebService class and
include code in the one-way method to get the
System.Web.Services.WebService.Context property."

how do you do this ie access the context

my code is as follows

  objGeneral.streamServerAttachment(p_nIdClient, _
                                                   p_cReportFile, _
                                                   lnMimeType, _
                                                   p_lTaxReport)

               objStream = SoapContext.Current.Attachments(0).Stream

               objBinaryStream = New BinaryReader(objStream)
               lnStreamlength = CInt(objBinaryStream.BaseStream.Length)
               objBinaryStream.BaseStream.Read(objData, 0, lnStreamlength)

TIA

Stu

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.