Well, my problem now is how can I get the LOCAL IP address and TCP port number that is used by the CLIENT when calling the web service? I need this information for logging purposes. There are several network interfaces attached. I managed to retrieve all exchanged SOAP messages with a handler but I think IP address and port number are not accessible in a SOAPMessageContext that is used there.
Can you adapt the service code for this? It can retrieve both the client IP and client port, and send those back as part of the response.
Joined: Feb 19, 2011
Unfortunately, I have no influence on the web service. I have to find a way to do it with the client code.
It would be a shame if it is not possible to do it with the straightforward wsimport code generation since it is really easy to use.
Joined: Mar 22, 2005
Saying "it would be a shame" would be taking it rather far, IMO. This is arcane functionality that's not germane to web services (which are not wedded to any particular transport mechanism, after all).
If you dig deep into the WS client-side code (not the generated code - the source code of the SOAP stack you're using) you should be able to get at the Socket object being used; it can provide you with the local port and IP address.
subject: Local ip address and port number of WS client