php 调用 .net webservice


$client =  new soapclient(‘http://www.aaaaaa.com/WebService/AddOrderWebService.asmx?wsdl‘);

$parm=array(‘requestJson‘=>json_encode($wbser),‘createrID‘=>$_SESSION[‘supUserCode‘]);

$result= $client->GetAddInnerOrder($parm);

$grtxt=$result->GetAddInnerOrderResult;



 $c =  new soapclient(‘http://supply.mesuca.com/WebService/AddOrderWebService.asmx?wsdl‘);

 $spam =array(‘requestJson‘=> json_encode($sdarr));
 //file_put_contents(‘sdordergoods1.txt‘,  json_encode($sdarr));
 $flag = (array)$c->B2BOrder($spam);
 //file_put_contents(‘sdordergoods.txt‘, var_export($flag[‘B2BOrderResult‘], true));

 if(intval($flag[‘B2BOrderResult‘])==1)

 {


 }

  else

 {


 }


SoapDiscovery.class.php 生成 .wsdl

//生成wsdl文件,将上面的return注释
$fso = fopen($this->class_name . ".wsdl", "w");
fwrite($fso, sprintf(‘%s%s%s%s%s%s‘, $headerWSDL, $portTypeWSDL, $bindingWSDL, $serviceWSDL, $messageWSDL, ‘</definitions>‘));


   $server = new SoapServer(‘supply_web.wsdl‘, array(‘soap_version‘ => SOAP_1_2));
   $server->setClass("supply_web"); //注册Service类的所有方法
   $server->handle();

本文出自 “惊鸿一羽” 博客,请务必保留此出处http://haocaige.blog.51cto.com/1319521/1379827

php 调用 .net webservice,布布扣,bubuko.com

php 调用 .net webservice

上一篇:Web服务(一)http基础详解


下一篇:Web服务其三编译安装httpd-2.4.9