Need to intercept web services request and send it to multiple web services server
Joined: Jan 03, 2008
I need to intercept web services client request (RAW HTTP), modify the SOAPAction header to "" and send the request to 5 web services endpoint on different servers, and return back the result only if both return HTTP 200.
What would be the best way to do it?
Just use plain socket?
Author and all-around good cowpoke
Joined: Mar 22, 2000
I not sure I understand the:
and send the request to 5 web services endpoint on different servers
part of this question. But anyway...
Assuming you have a SOAP request incoming, you can read it all into a byte or String and grab the request headers. You could then make separate HttpURLConnections (in separate Threads presumably) creating NEW request headers using whatever values you want and send the message. Resolving the different responses from the different requests and hanlding errors sounds like quite a problem.