理解多部分消息的 PHP SOAP 客户端? [英] PHP SOAP client that understands multi-part messages?
问题描述
有这么牛的吗?PHP 附带的简单SOAP 客户端 无法理解多部分消息.提前致谢.
Is there such a beastie? The simple SOAP client that ships with PHP does not understand multi-part messages. Thanks in advance.
推荐答案
原生 PHP SoapClient
类不支持多部分消息(并且在所有 WS-* 问题中受到强烈限制)而且我也认为 PHP 编写的库 NuSOAP 也不是 Zend_Soap 可以处理此类 SOAP 消息.
The native PHP SoapClient
class does not support multipart messages (and is strongly limited in all WS-* matters) and I also I think that neither the PHP written libraries NuSOAP nor Zend_Soap can deal with this sort of SOAP messages.
我能想到两个解决方案:
I can think of two solutions:
扩展
SoapClient
类并覆盖SoapClient::__doRequest()
方法以获取实际的响应字符串,然后您可以随心所欲地解析它.
extend the
SoapClient
class and overwrite theSoapClient::__doRequest()
method to get hold of the actual response string which you can then parse at your whim.
class MySoapClient extends SoapClient
{
public function __doRequest($request, $location, $action, $version, $one_way = 0)
{
$response = parent::__doRequest($request, $location, $action, $version, $one_way);
// parse $response, extract the multipart messages and so on
}
}
虽然这可能有点棘手 - 但值得一试.
This could be somewhat tricky though - but worth a try.
为 PHP 使用更复杂的 SOAP 客户端库.我想到的第一个也是唯一一个是 WSO2 WSF/PHP,它具有 SOAP MTOM、WS- 以必须安装原生 PHP 扩展为代价的寻址、WS-Security、WS-SecurityPolicy、WS-Secure Conversation 和 WS-ReliableMessaging.
use a more sophisticated SOAP client library for PHP. The first and only one that comes into my mind is WSO2 WSF/PHP which features SOAP MTOM, WS-Addressing, WS-Security, WS-SecurityPolicy, WS-Secure Conversation and WS-ReliableMessaging at the cost of having to install a native PHP extension.
这篇关于理解多部分消息的 PHP SOAP 客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!