This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Local ip address and port number of WS client