简体   繁体   English

如何使用php创建soap wsdl请求模板

[英]How to create soap wsdl request template using php

this my xml request which i want to create for service. 这是我想要为服务创建的我的xml请求。

<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 那是我的PHP代码

$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 错误详细信息:SOAP-ERROR:编码:对象没有'nResId'属性

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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