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