PHP SOAP client that understands multi-part messages?

后端 未结 7 566
死守一世寂寞
死守一世寂寞 2020-12-03 03:27

Is there such a beastie? The simple SOAP client that ships with PHP does not understand multi-part messages. Thanks in advance.

相关标签:
7条回答
  • 2020-12-03 04:25

    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:

    • extend the SoapClient class and overwrite the SoapClient::__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.

    • 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.

    0 讨论(0)
提交回复
热议问题