Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to intercept web services request and send it to multiple web services server

 
M. Azri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic