all groups > dotnet web services enhancements > january 2005 >
You're in the

dotnet web services enhancements

group:

HELP!!! RequestSoapContext.Current always Nothing...


HELP!!! RequestSoapContext.Current always Nothing... Nodrick
1/17/2005 11:11:10 AM
dotnet web services enhancements:
I have a standard WSE 2.0 file attachment upload/download application on my
localhost which works perfectly.

However, when I install the application on my Live Webserver and run it, an
Exception occurs on line 3 "Object reference not set to an instance of an
object." This is referring to the RequestSoapContext.Current Object.

CODE
1 <WebMethod()>Public Sub UploadFile(ByVal filename As String)
2 Dim fs As FileStream = File.Create(Server.MapPath("uploads\" &
filename))
3 Dim fileLength As Integer =
RequestSoapContext.Current.Attachments(0).Stream.Length
4 Dim buffer(fileLength) As Byte

5 RequestSoapContext.Current.Attachments(0).Stream.Read(buffer, 0,
fileLength)
6 fs.Write(buffer, 0, fileLength)
7 fs.Close()
8 End Sub

As I said, It all works perfectly on the Localhost, so the web.config is ok
(I have checked this).

I can only assume it is a SOAP security difference between my localhost
server and the live web server.

Can anyone help as I am going crazy trying to find an answer!!!

Thank You

RE: HELP!!! RequestSoapContext.Current always Nothing... Nodrick
1/31/2005 1:25:07 PM
I have fixed this problem.

My ISP has WSE2.0 SP1 installed and I have WSE2.0 SP2 installed on my local
development machine!!

Need to have the exact same versions installed at the client AND the server.

Cheers all

Nodrick


[quoted text, click to view]
AddThis Social Bookmark Button