简体   繁体   中英

How to create soap wsdl request template using php

this my xml request which i want to create for service.

<soapenv:Header>
  <aut:AuthenticationHeader>
     <aut:LoginName>John</aut:LoginName>
     <aut:Password>Johnpass</aut:Password>
     <aut:Culture>en_US</aut:Culture>
     <aut:Version>8</aut:Version>
  </aut:AuthenticationHeader>
</soapenv:Header>
<soapenv:Body>
  <hot:GetCancellationPolicies>
     <hot:hotelId>19752</hot:hotelId>
     <hot:hotelRoomTypeId>20955</hot:hotelRoomTypeId>
     <hot:dtCheckIn>2017-06-25</hot:dtCheckIn>
     <hot:dtCheckOut>2017-06-28</hot:dtCheckOut>
  </hot:GetCancellationPolicies>

and that is my php code

$p = new stdClass;
$p->request->HotelId                     = '19752';
$p->request->HotelRoomTypeId             = '20955';
$p->request->dtCheckIn                   = '2017-06-25';
$p->request->dtCheckOut                  = '2017-06-28';
$quote = $client->GetCancellationPolicies($p);

actually i am getting error.which is mentioned below. Error Details: SOAP-ERROR: Encoding: object has no 'nResId' property

i'm new in web services it would be great if someone could help me out of it.

从wsdl开始,您应该使用WSDL生成相应的PHP sdk到php生成器,例如PackageGenerator项目,因为您不会想知道如何构造请求,此外,它会让您轻松处理响应,因为一切都是OOP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM