帮助在 PHP 中创建肥皂请求
我将如何为这样的结构创建一个数组
抱歉,但我知道如何发送肥皂请求[php.net]..我只是想确认我需要使用自定义属性产生这样的请求的数组结构
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Header>
<m:AuthenticationInfo xmlns:m="https://xml.hotelclub.net/xmlws/services/v2/">
<m:AffiliateID>xxx</m:AffiliateID>
<m:Password>xxx</m:Password>
<m:ClientIP>xxx</m:ClientIP>
</m:AuthenticationInfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:HotelBookingRequest xmlns:m="https://xml.hotelclub.net/xmlws/services/v2/" Version="2" LanguageCode="EN" CurrencyCode="AUD" AffiliateUniqueID="Rodel9">
<m:StayDateRange CheckIn="2011-03-28" CheckOut="2011-03-29" ArrivalTime="12"/>
<m:Hotel ID="54"></m:Hotel>
<m:ItemsRequest>
<m:ItemRequest Type="Room" QuantityRequired="1"
NumberOfAdults="1"
NumberOfChildren="0"
Code="117;54;45877">
<m:Guests>
<m:Guest IsChild="false">
<m:FirstName>Rodel</m:FirstName>
<m:LastName>Surat</m:LastName>
</m:Guest>
</m:Guests>
</m:ItemRequest>
</m:ItemsRequest>
<m:GuestRequest SmokingPreference="NoPreference" BabyCot="false" LateCheckIn="false"></m:GuestRequest>
<m:MainGuest IsMainGuest="true" IsChild="false">
<m:FirstName>Rodel</m:FirstName>
<m:LastName>Surat</m:LastName>
<m:Address>
<m:Country ID="3"/>
<m:Telephone>123456789</m:Telephone>
</m:Address>
<m:EmailAddress>[email protected]</m:EmailAddress>
</m:MainGuest>
<m:PaymentDetail ItineraryTotalAmount="520">
<m:CreditCardDetail SerialCode="XXX" CardType="VSA" CardNumber=" XXXXXXXXXXXXXXXX" ExpiryDate="0811">
<m:CardHolderName>Rodel Surat</m:CardHolderName>
<m:Address>
<m:AddressLine>680 George St</m:AddressLine>
<m:City Name="Sydney" />
<m:State>NSW</m:State>
<m:Country ID="3" />
<m:Postcode>2000</m:Postcode>
</m:Address>
</m:CreditCardDetail>
</m:PaymentDetail>
</m:HotelBookingRequest>
</SOAP-ENV:Body>
然后将其作为肥皂请求发送。我对 PHP 中的 SOAP 完全陌生
how will i create an array for such a structure
Sorry but I know how to send a soap request [php.net].. I just want to confirm the array structure that I need to result in such a request with custom attributes
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Header>
<m:AuthenticationInfo xmlns:m="https://xml.hotelclub.net/xmlws/services/v2/">
<m:AffiliateID>xxx</m:AffiliateID>
<m:Password>xxx</m:Password>
<m:ClientIP>xxx</m:ClientIP>
</m:AuthenticationInfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:HotelBookingRequest xmlns:m="https://xml.hotelclub.net/xmlws/services/v2/" Version="2" LanguageCode="EN" CurrencyCode="AUD" AffiliateUniqueID="Rodel9">
<m:StayDateRange CheckIn="2011-03-28" CheckOut="2011-03-29" ArrivalTime="12"/>
<m:Hotel ID="54"></m:Hotel>
<m:ItemsRequest>
<m:ItemRequest Type="Room" QuantityRequired="1"
NumberOfAdults="1"
NumberOfChildren="0"
Code="117;54;45877">
<m:Guests>
<m:Guest IsChild="false">
<m:FirstName>Rodel</m:FirstName>
<m:LastName>Surat</m:LastName>
</m:Guest>
</m:Guests>
</m:ItemRequest>
</m:ItemsRequest>
<m:GuestRequest SmokingPreference="NoPreference" BabyCot="false" LateCheckIn="false"></m:GuestRequest>
<m:MainGuest IsMainGuest="true" IsChild="false">
<m:FirstName>Rodel</m:FirstName>
<m:LastName>Surat</m:LastName>
<m:Address>
<m:Country ID="3"/>
<m:Telephone>123456789</m:Telephone>
</m:Address>
<m:EmailAddress>[email protected]</m:EmailAddress>
</m:MainGuest>
<m:PaymentDetail ItineraryTotalAmount="520">
<m:CreditCardDetail SerialCode="XXX" CardType="VSA" CardNumber=" XXXXXXXXXXXXXXXX" ExpiryDate="0811">
<m:CardHolderName>Rodel Surat</m:CardHolderName>
<m:Address>
<m:AddressLine>680 George St</m:AddressLine>
<m:City Name="Sydney" />
<m:State>NSW</m:State>
<m:Country ID="3" />
<m:Postcode>2000</m:Postcode>
</m:Address>
</m:CreditCardDetail>
</m:PaymentDetail>
</m:HotelBookingRequest>
</SOAP-ENV:Body>
and then send it as a soap request . i am absolutely new to SOAP in PHP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 http://php.net/manual/en/book.soap 上的文档。 php
Check out the documentation at http://php.net/manual/en/book.soap.php
这是我整理的一个简单的 wcf 服务测试,
希望它能帮助您前进。
Here is a simple wcf service test i've put together
Hope it will help you on your way forward.