开发者

Passthru Soap Request (i.e.. act as proxy for Soap Request)

I am working on a project for a client, that they have several applications that communicate with a soap server, however they require all requests to go thru a proxy, and want to be able to answer several of the soap requests locally, then if it requires the outside server send the request from the inside php server basically like a proxy. So the only communication the Software has is with the rerouted internal php server.

The setup is as follows:

1. Application makes call to 255.255.255.255
2. Internal Routing redirects request to 192.16开发者_StackOverflow中文版8.1.2 (Internal Web Server)
3. Internal Web server serves requests for the requested page
     3a. If the Method requested can be answered local it needs to answer it,
     3b. Or it needs to forward the whole original request to the outside server, wait for response then return the answer back to the Software as if it was serving the answer.

Does that make sense, and does anyone have any suggestions for how to accomplish this in a php page? The network routing is already done, and the Software is being answered by the internal php page, however I cannot get it to forward the request.


The determination of 3a is outside the scope, but an important part in deciding what implementation to use; for each transport protocol you need to implement a request rewrite. If there's only the HTTP transport, you can either use fopen with URL wrappers, which isn't very flexible in terms of specifying headers or use the cURL extension. Once you've got the response from the external server, simply write out the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜