Groups | Blog | Home
all groups > dotnet web services enhancements > august 2004 >

dotnet web services enhancements : SoapReceiver can not receive the incoming message


yuwenwu NO[at]SPAM yahoo.com
8/2/2004 11:00:56 AM
Hi,

I am implementing a simple application using WSE 2.0 to communicate
with another gSoap-implemented web service for inter-op test. My app
uses a SoapReceiver to listen for incoming SOAP Messages from the web
service. The code is like:
...
EventReceiver receiver = new EventReceiver();
SoapReceivers.Add(new Uri("soap.tcp://127.0.0.1:8081"), receiver);
...

And EventReceiver is a derived class of SoapReceiver.

However, when the message comes in, the Receive() method in the
SoapReceiver is not invoked.

In order to debug the problem, I did an experiment as below:
1. I wrote a simple web service using SoapSender to send the message,
and saved the traced Soap Message in a file , say "abc.xml"

2.then, I tried to write an app using TCPClient to send the SOAP
message saved in "abc.xml", the code is like
....
Int32 port = 8081;
TcpClient client = new TcpClient("127.0.0.1", port);
byte[] data = new UTF8Encoding().GetBytes(message);
NetworkStream stream = client.GetStream();
stream.Write(data, 0, data.Length);
....

"message" contains the string read from "abc.xml". But Receive()
Method is still not invoked ...

Any idea? And solutions?

SA
8/3/2004 6:56:03 AM
I am not sure about this, but I think at least part of the problem is with
the

soap.tcp://

you use. In the docs, it says somewhere that this is only for dev use. Maybe
this causes some issues with interop. Maybe you should try to remove the
soap. from your uri?

tcp://127.0.0.1:8081

might work better?

--

Sven


[quoted text, click to view]

SA
8/3/2004 7:21:07 AM
OK, forget about this post... I was a bit off I guess

--

Sven


[quoted text, click to view]

yuwenwu NO[at]SPAM yahoo.com
8/3/2004 12:28:19 PM
BTW, below is the SOAP message I'm trying to send out:

<soap:Envelope 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"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://localhost/fake_notify</wsa:Action>
<wsa:MessageID>uuid:faadcef2-a83d-4fc8-8282-4f19bbdb9e0f</wsa:MessageID>
<wsa:To>soap.tcp://127.0.0.1:8081/</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-8e8535c8-152c-4511-b1b5-2f098b204b66">
<wsu:Created>2004-07-30T00:05:07Z</wsu:Created>
<wsu:Expires>2004-07-30T00:10:07Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body><myTest xmlns="urn:abc"><Reason>fake
notification</Reason></myTest>
</soap:Body>
</soap:Envelope>

[quoted text, click to view]
Lucien
8/3/2004 11:40:45 PM
You have to use some kind of framing using soap over TCP. WSE uses DIME and
it seems your client is not using any DIME and you're directly writing to
the stream. You can confirm this by checking for an error in the event log
(probably you'll have an error in there saying DIME read failure).

If you use the SoapClient/SoapSender the framing will be done for you. See
TcpSyncStockReceiver for an example.

[quoted text, click to view]
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd"
[quoted text, click to view]
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
y-utility-1.0.xsd"
[quoted text, click to view]

AddThis Social Bookmark Button