我想調用.net webservice在php 下面是我的代碼。消費ASP.NET WebService在PHP和返回SOAP錯誤
<?php
$client = new SoapClient("http://test.etech.net/PanelIntegration/PanelIntegration.asmx?wsdl");
<?php
$sh_param = array(
'Username' => 'IntegratorLPI',
'Password' => 'password531');
$headers = new SoapHeader('http://wms.etech.net/', 'UserCredentials', $sh_param);
$client->__setSoapHeaders($headers);
$params = array('CustomerName' => 'Mr Smith','ContactMobileNo' => '',
'AddressLine1' => '33 Amblecote Road',
'AddressTown' => 'Cambridgeshire',
'AddressPostCode' => 'NW23 6TR',
'VendorAddressLine1' => '80 Norton Road',
'VendorAddressTown' => 'Hickley ',
'VendorAddressCounty' => 'Cambridgeshire',
'VendorAddressPostCode' => 'NW23 2AQ',
'RegionalOfficeID' => '3',
'ExternalNotes' => 'Case Accepted',
'UPRN' => '',
'InstructionTypeID' => '2',
'PropertyTypeID' => '11',
'PropertyTenure' => '2',
'SurveyorID' => '23',
'RRN' => '0240-9002-0391-3520-0020',
'NewInstruction'=> 'true',
'StatusID' => '1'
);
$result = $client->__soapCall("UpdateInstruction", $params);
print_r( $result);
?>
我有這個錯誤 致命錯誤:未捕獲的SOAPFault例外:肥皂:服務器]服務器無法處理請求。 --->對象引用未設置爲對象的實例。在C:\ xampp \ htdocs \ test2.php中:33堆棧跟蹤:#0 C:\ xampp \ htdocs \ test2.php(33):SoapClient - > __ soapCall('UpdateInstructi ...',Array)#1 {main }在第33行拋出C:\ xampp \ htdocs \ test2.php
安德魯感謝您的回覆,但這個網絡服務工作正常,當我用.net調用相同的參數。任何其他方式來調用這個服務在PHP中。謝謝 – 2011-05-19 03:27:04