How to call overloaded wsdl webservice method from php soap client

前端 未结 1 1735
我寻月下人不归
我寻月下人不归 2020-12-22 05:25

Webservice : http://webservices.dishtv.in/Services/Mobile/Trade/TradeSubscriberInfo.asmx Overloaded method is GetSubscriberInfoV2 MessageName=\"GetSubscribe

相关标签:
1条回答
  • 2020-12-22 05:47

    The only way to do this is writing the XML request manually and sending it through the method SoapClient::__doRequest.

    It would be something like this:

    $request = <<<'EOT'
      <?xml version="1.0" encoding="utf-8"?>
      <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:ns1="http://tempuri.org/">
        <SOAP-ENV:Body>
          <ns1:TheMessageNameGoesHere>
            <ns1:param1>$param1</ns1:param1>
            <ns1:param2>$param2</ns1:param2>
            <ns1:param3>$param3</ns1:param3>
          </ns1:TheMessageNameGoesHere>
        </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    EOT;
    
    $response = $soapClient->__doRequest(
      $request,
      "http://www.exemple.com/path/to/WebService.asmx",
      "http://tempuri.org/TheMessageNameGoesHere",
      SOAP_1_1
    );
    

    Change "TheMessageNameGoesHere" for the MessageName found in the WebService description page.

    The XML structure can also be found in the WebService description page, when you click in the function.

    The third parameter of the method __doRequest is the SOAP action, and can be found in the WSDL file as an attribute of the tag <soap:operation>

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