首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

SOAP 调用有关问题

2012-06-21 
SOAP 调用问题PHP code$soapclient new soapclient(http://shippingapi.ebay.cn/production/v2/orderse

SOAP 调用问题

PHP code
$soapclient = new soapclient("http://shippingapi.ebay.cn/production/v2/orderservice.asmx?wsdl");$params = array(    'Version' => "2.0.0",    'APIDevUserID' => "sureelectronics",    'APIPassword' => "7114209N1OCBA61N83CRA0PY1F743DSGTM7GEAY581CND3BHG0POUW20111540",    'APISellerUserID' => "sureelectronics",    'MessageID' => "125625622452",        'TrackCode' => "LK042013892CN"    );$functions = $soapclient->CancelAPACShippingPackage($params);print_r($functions);<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ship="http://shippingapi.pushauction.net/">   <soap:Header/>   <soap:Body>      <ship:CancelAPACShippingPackage>         <ship:CancelAPACShippingPackageRequest>            <ship:Version>2.0.0</ship:Version>            <ship:APIDevUserID>****</ship:APIDevUserID>            <ship:APIPassword>********</ship:APIPassword>            <ship:APISellerUserID>*******</ship:APISellerUserID>            <ship:MessageID>1234</ship:MessageID>            <ship:TrackCode>LK*********CN</ship:TrackCode>         </ship:CancelAPACShippingPackageRequest>      </ship:CancelAPACShippingPackage>   </soap:Body></soap:Envelope>


为什么为出错啊,出错如下:
<b>Fatal error</b>: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object.
  at WebServiceCN.OrderService.CancelAPACShippingPackage(CancelAPACShippingPackageRequest CancelAPACShippingPackageRequest)

[解决办法]
PHP code
$soapclient = new soapclient("http://shippingapi.ebay.cn/production/v2/orderservice.asmx?wsdl");$params = array(    'Version' => "2.0.0",    'APIDevUserID' => "sureelectronics",    'APIPassword' => "7114209N1OCBA61N83CRA0PY1F743DSGTM7GEAY581CND3BHG0POUW20111540",    'APISellerUserID' => "sureelectronics",    'MessageID' => "125625622452",        'TrackCode' => "LK042013892CN"    );$functions = $soapclient->CancelAPACShippingPackage(array("CancelAPACShippingPackageRequest"=>$params));print_r( $functions); 

热点排行