WSE 2.0 WS-Addressing problem

J

Jimbo

Hi people,
I am playing with the WSE 2.0 SP3 and am trying to get use the
ReplyTo WS-Addressing header to send a response to a different machine
than where the request came from. However, in my web service the
RequestSoapContext.Current command is returning a null.

Here is what I've got so far.

My client sends the following SOAP message:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<soap:Header>
<wsa:MessageID>
uuid:8d471bc9-2d78-4483-bf94-65ff90df1be6
</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>
http://uop-project:13000/
</wsa:Address>
</wsa:ReplyTo>
<wsa:To>
http://192.168.0.10/WebService2/Service1.asmx
</wsa:To>
<wsa:Action>
http://tempuri.org/Add
</wsa:Action>
</soap:Header>
<soap:Body>
<Add xmlns="http://tempuri.org/">
<x>1</x><y>3</y>
</Add>
</soap:Body>
</soap:Envelope>

With the web service defined as:

[WebMethod]
public int Add(int x, int y)
{
return x + y;
}

I have used the WSE Configuration Editor on the web server to enable
the WSE in the services web.config file. IIS 6.0 is sending back the
following SOAP Response to the above request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>http://tempuri.org/AddResponse</wsa:Action>
<wsa:MessageID>
uuid:84877358-b542-4d04-8ffe-9446e8c27735
</wsa:MessageID>
<wsa:RelatesTo>
uuid:8d471bc9-2d78-4483-bf94-65ff90df1be6
</wsa:RelatesTo>
<wsa:To>http://uop-project:13000/</wsa:To>
<wsse:Security>
<wsu:Timestamp
wsu:Id="Timestamp-57fd1a93-96f1-4a04-8f5f-ce19ebaf4f3c">
<wsu:Created>2005-07-26T18:43:24Z</wsu:Created>
<wsu:Expires>2005-07-26T18:48:24Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>4</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>

With all the additional headers and everything this implies to me
that the WSE 2.0 SP3 is installed correctly on the web server and is
working. However, when I change the web service to the code below the
SoapContext object is null:

[WebMethod]
public int Add(int x, int y)
{
SoapContext ctxt = RequestSoapContext.Current;
return x + y;
}

I can't find much in the WSE documentation other than a sample that
gives the following reason if the SoapContext is zero:

"Either a non-SOAP request was received or the WSE is not properly
installed for the Web application hosting the XML Web service"

From what I can tell the SOAP message is valid because the Web
Service gets called and returns the correct result, and the WSE is
installed properly because I get back the appropriate SOAP headers.


Any thoughts?

I am running IIS 6.0 on Windows Advanced Server 2003 Standard
Edition which has WSE 2.0 SP3 installed.


Thanks in advance
Jimbo (different from the other Jimbo)

P.S. sorry for the cross post but the webservices group doesn't seem
very active.
 
J

Jimbo

Jimbo said:
Hi people,
I am playing with the WSE 2.0 SP3 and am trying to get use the
ReplyTo WS-Addressing header to send a response to a different machine
than where the request came from. However, in my web service the
RequestSoapContext.Current command is returning a null.

FYI. I don't know what I've done, but today it's suddenly working :)

Cheers
Jimbo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top