"2.0.0&quo"/> "2.0.0&quo">

SOAP 调用有关问题

WBOY
發布: 2016-06-13 13:26:50
原創
1039 人瀏覽過

SOAP 调用问题

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$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);
<envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ship="http://shippingapi.pushauction.net/">
   <header></header>
   <body>
      <cancelapacshippingpackage>
         <cancelapacshippingpackagerequest>
            <version>2.0.0</version>
            <apidevuserid>****</apidevuserid>
            <apipassword>********</apipassword>
            <apiselleruserid>*******</apiselleruserid>
            <messageid>1234</messageid>
            <trackcode>LK*********CN</trackcode>
         </cancelapacshippingpackagerequest>
      </cancelapacshippingpackage>
   </body>
</envelope>




登入後複製


为什么为出错啊,出错如下:
Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> 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); <div class="clear">
                 
              
              
        
            </div>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板