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?
Thanks.
SA - 03 Aug 2004 12:56 GMT
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?

Signature
Sven
> Hi,
>
[quoted text clipped - 32 lines]
>
> Thanks.
SA - 03 Aug 2004 13:21 GMT
OK, forget about this post... I was a bit off I guess

Signature
Sven
> I am not sure about this, but I think at least part of the problem is with
> the
[quoted text clipped - 45 lines]
> >
> > Thanks.
justin_sun - 03 Aug 2004 20:28 GMT
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>
> Hi,
>
[quoted text clipped - 32 lines]
>
> Thanks.
Lucien - 03 Aug 2004 22:40 GMT
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.
> 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-wssecuri
ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
y-utility-1.0.xsd"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
[quoted text clipped - 49 lines]
> >
> > Thanks.