• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to connect to webservice when there is middle layer between client system and webservices?

 
Vinoth Rajendran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a requirement to consume the webservices.

I have genereted the client using axis2 and I could consume it if it can be accessed directly.

Client --> Webservice

I have an issue when there is an intermediate layer.

Client - -> Intermidate Layer(Http Request Redirector) -- > Webservice.

Please advice whether it can be accessed with the client generated or any other settings required on the axis2 side?

Is there any other alternate way to communicate with axis2?



Thank
Vinoth
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not an Axis2 issue, as this redirector is some piece of 3rd party software.

Does the intermediate layer perform an actual client-side HTTP redirect? If so, there is no way to make this work, as that would always be an HTTP GET, whereas SOAP relies on POST. You would have to rewrite the client so that it gets the new URL from the redirect, and then sends the original request to the new address.

Why is the redirector in place? Why can't the WS client just access the new server-side URL?
 
Vinoth Rajendran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

Thanks.
Yes. intermediate layer perform an actual client-side HTTP redirect.
It connects to webservice and receives the response.

They have provided new http URL(intermediate layer) to access the webservice. The request xml sent to http URL provided and from there it is sent to actual webservices.
Please advice on the approach to write the client code. can this be done using Restful or xml over http.

Provided intermediate layer URL is accessible from soap UI and we could send the request and receive the response.

This redirection in place as the webservice is not in customer network and they want every request to go through their path.

Thanks
VInoth
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This redirection in place as the webservice is not in customer network and they want every request to go through their path.

This doesn't make sense. If the WS is not reachable by the client network then a straight HTTP redirect will not work (irrespective of the GET/POST issue I mentioned). It sounds more like a server-side redirect, or a proxy, to give it a more commonly used name.
 
Vinoth Rajendran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

WAS server doesn't have network connection to WS . But there is network connection from intermediate layer system.

That is the way it is designed and they say it is consumed by other projects.

I think we can consider it is like middle layer or proxy layer.

Please advice which approach can be used to consume it.


Thanks
Vinoth
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we can consider it is like middle layer or proxy layer.

I see. That clashes with your earlier statement of "intermediate layer perform an actual client-side HTTP redirect." - they can't both be true.

If the redirector is a proxy, then the client should run as is. What exactly happens if you do that?
 
Vinoth Rajendran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesnt work directly.

It works through HttpClient. Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saying "it doesn't work" gives us precisely nothing to work with. What, exactly, are you doing, and what, exactly, is happening as a result? Same for "it works through HttpClient", where I have no idea what that means.
 
Vinoth Rajendran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant, the middle layer was consuming the webservice.

Client application required to send http request middle layer instead of soap.

Used HttpClient example from http://stackoverflow.com/questions/2735839/posting-xml-request-in-java to make it work.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant, the middle layer was consuming the webservice. Client application required to send http request middle layer instead of soap.

Right, the middle layer would be the direct consumer of the. If it is not an exact proxy -meaning, it does not expose the consumed WS in the same way as the original WS- then you need to write a client for whatever API the middle layer *does* expose. If that's not SOAP, then a SOAP client obviously would not work. But if you were able to make HttpClient work, I'm wondering what exactly you're looking for?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!