我需要与SOAP(作为客户端)进行交互,并且无法正确获取语法。我有一个WSDL文件,该文件允许我使用SoapClient类正确设置新连接。但是,我无法发出肥皂请求,而我想发出原始xml肥皂请求,而我却是这样。
$xml = '<BookingManagement>
<BookingManagementRQ>
<Authentication>
<DBName>database</DBName>
<ProductCode>ip</ProductCode>
</Authentication>
<BookingReference>booking-id</BookingReference>
<UserName>XXXX</UserName>
</BookingManagementRQ>
</BookingManagement>';
$soapBody = new \SoapVar($xml, XSD_ANYXML);
$client = new \SoapClient("https://XXXX.com/TravelinkCEService.svc?wsdl",array('trace' => true, 'exceptions' => true));
$return =$client->BookingManagement($soapBody);
$client->getLastRequestXml();
我在下面收到错误消息:
{ “ message”:“对象引用未设置为对象的实例。”, “ exception”:“ SoapFault”, }