Passthrough Soap Request(即充当Soap Request的代理)


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

我正在为一个客户机做一个项目,他们有几个与soap服务器通信的应用程序,但他们要求所有请求都通过代理,并希望能够在本地回答几个soap请求,那么如果它要求外部服务器从内部php服务器发送请求,基本上就像代理一样。因此,该软件唯一的通信是与重新路由的内部php服务器进行通信。

设置如下:

1. Application makes call to 255.255.255.255
2. Internal Routing redirects request to 192.168.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.

这有意义吗?有人对如何在php页面中实现这一点有什么建议吗?网络路由已经完成,内部php页面正在回复软件,但我无法让它转发请求。

3a的确定不在范围之内,但它是决定使用什么实现的重要部分;对于每个传输协议,您都需要实现一个请求重写。如果只有HTTP传输,您可以将fopen与URL包装器一起使用,这在指定标头方面不是很灵活,也可以使用cURL扩展。一旦从外部服务器得到响应,只需写出数据即可。