Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SOAP:PHP调用.NETWebService_Php_Web Services_Soap - Fatal编程技术网

SOAP:PHP调用.NETWebService

SOAP:PHP调用.NETWebService,php,web-services,soap,Php,Web Services,Soap,大家好,任何人都知道如何用php创建这个请求。我正在调用.NETSOAPWeb服务 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <conf

大家好,任何人都知道如何用php创建这个请求。我正在调用.NETSOAPWeb服务

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <confirmCustomerReq xmlns="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema">
      <clientID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
      <terminalID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
      <msgID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" dateTime="xx" uniqueNumber="xx" />
      <authCred xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema">
        <opName>xxx</opName>
        <password>xxx@#1</password>
      </authCred>
      <idMethod xmlns:q1="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="q1:VendIDMethod">
        <q1:meterIdentifier xsi:type="q1:MeterNumber" msno="xx" />
      </idMethod>
    </confirmCustomerReq>
  </soap:Body>
</soap:Envelope>
卷曲

function main(){
$xml ='<?xml version="1.0" encoding="utf-8"?><soap:Envelope     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
        <confirmCustomerReq xmlns="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema">
          <clientID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
          <terminalID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
          <msgID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" dateTime="xx" uniqueNumber="xx" />
          <authCred xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema">
            <opName>xxx</opName>
            <password>xxx@#1</password>
          </authCred>
          <idMethod xmlns:q1="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="q1:VendIDMethod">
            <q1:meterIdentifier xsi:type="q1:MeterNumber" msno="xx" />
          </idMethod>
        </confirmCustomerReq>
      </soap:Body>
    </soap:Envelope>';

try{
$soap_do = curl_init();
  curl_setopt($soap_do, CURLOPT_URL, "https://www.utilitiesworld.co.za/SecureThirdPartyInterface/VendingService.asmx" );
  curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
  //curl_setopt($soap_do, CURLOPT_CAINFO, 'XXXXXXXXXXXXXX');
  curl_setopt($soap_do, CURLOPT_POST,           true );
  curl_setopt($soap_do, CURLOPT_FRESH_CONNECT, TRUE);
  curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $xml);
  //curl_setopt($soap_do, CURLOPT_HEADER, false);


   $xml_result = curl_exec($soap_do);
   echo curl_error($soap_do);
      //$result=parse_str($xml_result);
    //var_dump($xml_result);
    curl_close($soap_do);
}
函数main(){
$xml='0
xxx
xxx#1
';
试一试{
$soap\u do=curl\u init();
curl_setopt($soap_do,CURLOPT_URL,”https://www.utilitiesworld.co.za/SecureThirdPartyInterface/VendingService.asmx" );
curl_setopt($soap_do,CURLOPT_RETURNTRANSFER,true);
curl_setopt($soap_do,CURLOPT_SSL_VERIFYPEER,false);
//curl_setopt($soap_do,CURLOPT_CAINFO,'xxxxxxxxxxxxx');
curl_setopt($soap_do,CURLOPT_POST,true);
curl_setopt($soap_do,CURLOPT_FRESH_CONNECT,TRUE);
curl_setopt($soap_do,CURLOPT_POSTFIELDS,$xml);
//curl_setopt($soap_do,CURLOPT_头,false);
$xml\u result=curl\u exec($soap\u do);
回声旋度错误($soap\u-do);
//$result=parse_str($xml_result);
//变量转储($xml\u结果);
卷曲关闭($soap\u-do);
}

php中存在soap客户端模块


非常感谢Kwak,我想我的问题不是很清楚。请查看我的更新,看看您是否能提供帮助。
function main(){
$xml ='<?xml version="1.0" encoding="utf-8"?><soap:Envelope     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
        <confirmCustomerReq xmlns="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema">
          <clientID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
          <terminalID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="EANDeviceID" ean="xx" />
          <msgID xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" dateTime="xx" uniqueNumber="xx" />
          <authCred xmlns="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema">
            <opName>xxx</opName>
            <password>xxx@#1</password>
          </authCred>
          <idMethod xmlns:q1="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi:type="q1:VendIDMethod">
            <q1:meterIdentifier xsi:type="q1:MeterNumber" msno="xx" />
          </idMethod>
        </confirmCustomerReq>
      </soap:Body>
    </soap:Envelope>';

try{
$soap_do = curl_init();
  curl_setopt($soap_do, CURLOPT_URL, "https://www.utilitiesworld.co.za/SecureThirdPartyInterface/VendingService.asmx" );
  curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
  //curl_setopt($soap_do, CURLOPT_CAINFO, 'XXXXXXXXXXXXXX');
  curl_setopt($soap_do, CURLOPT_POST,           true );
  curl_setopt($soap_do, CURLOPT_FRESH_CONNECT, TRUE);
  curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $xml);
  //curl_setopt($soap_do, CURLOPT_HEADER, false);


   $xml_result = curl_exec($soap_do);
   echo curl_error($soap_do);
      //$result=parse_str($xml_result);
    //var_dump($xml_result);
    curl_close($soap_do);
}