File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Need to intercept web services request and send it to multiple web services server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need to intercept web services request and send it to multiple web services server" Watch "Need to intercept web services request and send it to multiple web services server" New topic
Author

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

M. Azri
Greenhorn

Joined: Jan 03, 2008
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12674
    
    5
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to intercept web services request and send it to multiple web services server
 
Similar Threads
Non web Java client in RAD 6.0 to invoke uri
Generating requests from servlets
Cookie in SOAP Handler
response unable to receive the parameter sent
How to build RESTful Web services in Java