all groups > dotnet web services enhancements > december 2004 >
You're in the

dotnet web services enhancements

group:

Problems with current context in web service


Problems with current context in web service Greg Allen
12/16/2004 10:07:50 AM
dotnet web services enhancements:
I posted this to microsoft.public.dotnet.framework.webservices, but have
not gotten answer. I just noticed this group and thought maybe my
question/problem belonged here.

So, here it is:

I'm still stuck here. But I wanted to remove my app from the equation, so
here is what I did:

1. Created a new web service, using the VS 2003 IDE.
2. Selected properties on the web services, picked the "WSE Settings 2.0..."
option
and checked both checkmarks on the general page.
3. Verified that the web.config contains the entries for WSE.
4. In the default Service1.asmx.vb file, I uncommented the sample "Hello,
World" webmethod
and modified it so that the entire file contains this (removing the
designer generated code region):

Imports Microsoft.Web.Services2
Imports System.Web.Services

<System.Web.Services.WebService(Namespace :=
"http://tempuri.org/WebService2/Service1")> _
Public Class Service1
Inherits System.Web.Services.WebService

' WEB SERVICE EXAMPLE
' The HelloWorld() example service returns the string Hello World.
' To build, uncomment the following lines then save and build the
project.
' To test this web service, ensure that the .asmx file is the start page
' and press F5.
'
<WebMethod()> _
Public Function HelloWorld() As String
Dim X As SoapContext = ResponseSoapContext.Current
Dim Y As SoapContext = RequestSoapContext.Current
Return "Hello World"
End Function

End Class

I set a breakpoint on the return statement, run the service, then invoke the
method. At
the breakpoint, both X and Y are Nothing.

I have a feeling I am missing something very simple here. I have
re-installed WSE 2.0 SP2 and
also rebooted, but that didn't see to help.

What am I missing?

Thanks,

-- Greg Allen

Re: Problems with current context in web service Martin Kulov
12/18/2004 4:33:02 AM
Hi Greg,

You need to access the web service from a client that is "WSE enabled" also. You will not have RequestSoapContext when you access it through IE.

Regards,

Martin Kulov
http://www.codeattest.com

MCAD Charter Member
MCSD.NET Early Achiever
MCSD

AddThis Social Bookmark Button