1

我有一个在线信任联盟 xsd,我想用 php soap 客户端解析它。我可以为普通的xml结构生成soap参数

`$params['OTA_HotelAvailRQ']['AvailRequestSegments']['AvailRequestSegment ']['Criterion ']['ChainCode'] = $chain_code`;

但是我如何为此 OTA 标准 xsds 生成参数,请参见下面的示例:

    <OTA_HotelAvailRQ xmlns="http://www.opentravel.org/OTA/2003/05" AvailRatesOnly="true" EchoToken="Single" ExactMatchOnly="true" PrimaryLangID="EN" RateDetailsInd="true" RateRangeOnly="true" RequestedCurrency="GBP" SummaryOnly="true" Version="6.000" OnRequestInd="true">
  <AvailRequestSegments>
    <AvailRequestSegment InfoSource="Distribution">
      <HotelSearchCriteria AvailableOnlyIndicator="true">
        <Criterion ExactMatch="true">
          <HotelRef ChainCode="CH" HotelCityCode="HCC" HotelCode="CHHCC"></HotelRef>
          <StayDateRange Start="2013-12-20" End="2013-12-25"/>
          <RoomStayCandidates>
            <RoomStayCandidate Quantity="2">
              <GuestCounts>
                <GuestCount AgeQualifyingCode="10" Count="2"/>
              </GuestCounts>
            </RoomStayCandidate>
          </RoomStayCandidates>
        </Criterion>
      </HotelSearchCriteria>
    </AvailRequestSegment>
  </AvailRequestSegments>
</OTA_HotelAvailRQ>

我只需要一点指导。

4

1 回答 1

2

看看这里https://github.com/goetas/xsd2php

它将帮助您阅读和解析请求/响应

于 2014-11-15T10:59:27.917 回答