• <legend id='oYhns'><style id='oYhns'><dir id='oYhns'><q id='oYhns'></q></dir></style></legend>

    <small id='oYhns'></small><noframes id='oYhns'>

    1. <i id='oYhns'><tr id='oYhns'><dt id='oYhns'><q id='oYhns'><span id='oYhns'><b id='oYhns'><form id='oYhns'><ins id='oYhns'></ins><ul id='oYhns'></ul><sub id='oYhns'></sub></form><legend id='oYhns'></legend><bdo id='oYhns'><pre id='oYhns'><center id='oYhns'></center></pre></bdo></b><th id='oYhns'></th></span></q></dt></tr></i><div id='oYhns'><tfoot id='oYhns'></tfoot><dl id='oYhns'><fieldset id='oYhns'></fieldset></dl></div>

      <tfoot id='oYhns'></tfoot>

          <bdo id='oYhns'></bdo><ul id='oYhns'></ul>
      1. 如何从 php soap 客户端调用重载的 wsdl webservice 方

        时间:2023-05-22

        • <bdo id='Y1oQi'></bdo><ul id='Y1oQi'></ul>

          <small id='Y1oQi'></small><noframes id='Y1oQi'>

          <i id='Y1oQi'><tr id='Y1oQi'><dt id='Y1oQi'><q id='Y1oQi'><span id='Y1oQi'><b id='Y1oQi'><form id='Y1oQi'><ins id='Y1oQi'></ins><ul id='Y1oQi'></ul><sub id='Y1oQi'></sub></form><legend id='Y1oQi'></legend><bdo id='Y1oQi'><pre id='Y1oQi'><center id='Y1oQi'></center></pre></bdo></b><th id='Y1oQi'></th></span></q></dt></tr></i><div id='Y1oQi'><tfoot id='Y1oQi'></tfoot><dl id='Y1oQi'><fieldset id='Y1oQi'></fieldset></dl></div>
          <legend id='Y1oQi'><style id='Y1oQi'><dir id='Y1oQi'><q id='Y1oQi'></q></dir></style></legend>

                <tbody id='Y1oQi'></tbody>

                <tfoot id='Y1oQi'></tfoot>

                  本文介绍了如何从 php soap 客户端调用重载的 wsdl webservice 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  网络服务:http://webservices.dishtv.in/Services/Mobile/Trade/TradeSubscriberInfo.asmx重载方法是 GetSubscriberInfoV2 MessageName="GetSubscriberInfoVCLogV2"我的 php 代码是,

                   '47','Password' => 'zZa@#286#@');$header = new SOAPHeader('http://tempuri.org/', 'AuthenticationHeader', $soapHeader);$client ->__setSoapHeaders($header);尝试{$res = $client->GetSubscriberInfoVCLogV2(array('vcNo' => $mobileno, 'mobileNo' => '', 'BizOps' => '1', 'UserID' => '555300','用户类型' => 'DL' ));}抓住(SoapFault $e){echo "无效否";打印_r($e);}打印_r($res);?>

                  它给出了错误 GetSubscriberInfoVCLogV2 is not found.我需要得到 GetSubscriberInfoVCLogV2 的响应.谁能帮我找到解决方案.

                  解决方案

                  做到这一点的唯一方法是手动编写 XML 请求并通过方法 SoapClient::__doRequest 发送它.

                  应该是这样的:

                  $request = <<<'EOT'<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:信封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($请求,"http://www.exemple.com/path/to/WebService.asmx","http://tempuri.org/TheMessageNameGoesHere",肥皂_1_1);

                  为 WebService 描述页面中的 MessageName 更改TheMessageNameGoesHere".

                  XML 结构也可以在 WebService 描述页面中找到,当您在函数中单击时.

                  方法__doRequest的第三个参数是SOAP动作,可以在WSDL文件中作为标签<的属性找到/p>

                  Webservice : http://webservices.dishtv.in/Services/Mobile/Trade/TradeSubscriberInfo.asmx Overloaded method is GetSubscriberInfoV2 MessageName="GetSubscriberInfoVCLogV2" My php code is,

                  <?php
                  $mobileno="01523833622";
                  $url="http://webservices.dishtv.in/Services/Mobile/Trade/TradeSubscriberInfo.asmx?wsdl";
                  $client = new SoapClient($url);
                  $soapHeader = array('UserID' => '47','Password' => 'zZa@#286#@');
                  $header = new SOAPHeader('http://tempuri.org/', 'AuthenticationHeader', $soapHeader);        
                  $client ->__setSoapHeaders($header); 
                  try
                  {
                          $res = $client->GetSubscriberInfoVCLogV2(array('vcNo' => $mobileno, 'mobileNo' => '', 'BizOps' => '1', 'UserID' => '555300', 'UserType' => 'DL' ));
                  } 
                  catch(SoapFault $e)
                  {   
                          echo "Invalid No";
                          print_r($e);         
                  }
                  print_r($res);
                  ?>
                  

                  It gives error GetSubscriberInfoVCLogV2 is not found. I need to get the response of GetSubscriberInfoVCLogV2. Can anyone help me to find the solution.

                  解决方案

                  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>

                  这篇关于如何从 php soap 客户端调用重载的 wsdl webservice 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:无法在 Yii2 中将肥皂响应字符串转换为 xml 下一篇:Webservice SOAP 请求 - 发送的数据类型错误

                  相关文章

                  最新文章

                    <small id='ELZvi'></small><noframes id='ELZvi'>

                    <legend id='ELZvi'><style id='ELZvi'><dir id='ELZvi'><q id='ELZvi'></q></dir></style></legend>

                  1. <tfoot id='ELZvi'></tfoot>

                        <bdo id='ELZvi'></bdo><ul id='ELZvi'></ul>
                    1. <i id='ELZvi'><tr id='ELZvi'><dt id='ELZvi'><q id='ELZvi'><span id='ELZvi'><b id='ELZvi'><form id='ELZvi'><ins id='ELZvi'></ins><ul id='ELZvi'></ul><sub id='ELZvi'></sub></form><legend id='ELZvi'></legend><bdo id='ELZvi'><pre id='ELZvi'><center id='ELZvi'></center></pre></bdo></b><th id='ELZvi'></th></span></q></dt></tr></i><div id='ELZvi'><tfoot id='ELZvi'></tfoot><dl id='ELZvi'><fieldset id='ELZvi'></fieldset></dl></div>