0

我有一个肥皂网络服务,我需要在 PHP 中连接并从中获取结果,请求是:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Booking xmlns="http://tempuri.org/">
      <myOrder>
        <FromDate>dateTime</FromDate>
        <ToDate>dateTime</ToDate>
        <Price>decimal</Price>
        <siteCommission>decimal</siteCommission>
        <HotelPriceIncentive>decimal</HotelPriceIncentive>
        <Count>int</Count>
        <PriceId>int</PriceId>
        <HotelId>int</HotelId>
        <Add_ID>int</Add_ID>
        <Create_net_booking>int</Create_net_booking>
        <OrderRooms>
          <ClOrderRooms>
            <capacityName>string</capacityName>
            <BaseTypeName>string</BaseTypeName>
            <RoomsTypeName>string</RoomsTypeName>
            <SessionId>string</SessionId>
            <AmountBruto>decimal</AmountBruto>
            <AmountNetto>decimal</AmountNetto>
            <Price>decimal</Price>
            <Count>int</Count>
            <BaseTypeId>int</BaseTypeId>
            <RoomTypeId>int</RoomTypeId>
            <Adults>int</Adults>
            <Child>int</Child>
            <Infants>int</Infants>
          </ClOrderRooms>
          <ClOrderRooms>
            <capacityName>string</capacityName>
            <BaseTypeName>string</BaseTypeName>
            <RoomsTypeName>string</RoomsTypeName>
            <SessionId>string</SessionId>
            <AmountBruto>decimal</AmountBruto>
            <AmountNetto>decimal</AmountNetto>
            <Price>decimal</Price>
            <Count>int</Count>
            <BaseTypeId>int</BaseTypeId>
            <RoomTypeId>int</RoomTypeId>
            <Adults>int</Adults>
            <Child>int</Child>
            <Infants>int</Infants>
          </ClOrderRooms>
        </OrderRooms>
        <GeneralAreaName>string</GeneralAreaName>
        <HotelName>string</HotelName>
        <GeneralAreaId>string</GeneralAreaId>
        <CancelBooking_Cancelled>boolean</CancelBooking_Cancelled>
        <CancelBooking_CancellationDays>int</CancelBooking_CancellationDays>
        <CancelBooking_Policy>string</CancelBooking_Policy>
        <SourcePrice>int</SourcePrice>
        <ExternalPriceID>int</ExternalPriceID>
        <CustomerPriceRemark>string</CustomerPriceRemark>
        <DocketId>int</DocketId>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <Email>string</Email>
        <Tz>string</Tz>
        <PhoneNum>string</PhoneNum>
        <CellNumber>string</CellNumber>
        <Address>string</Address>
        <CreditCardNum>string</CreditCardNum>
        <Credit_Tashlumim>string</Credit_Tashlumim>
        <Credit_ExpMont>string</Credit_ExpMont>
        <Credit_ExpYear>string</Credit_ExpYear>
        <Credit_CVV>string</Credit_CVV>
        <Comments>string</Comments>
        <Travellers>
          <clTraveller>
            <FirstName>string</FirstName>
            <LastName>string</LastName>
            <Title>string</Title>
            <DateBirthday>string</DateBirthday>
          </clTraveller>
          <clTraveller>
            <FirstName>string</FirstName>
            <LastName>string</LastName>
            <Title>string</Title>
            <DateBirthday>string</DateBirthday>
          </clTraveller>
        </Travellers>
        <ConfigParam>
          <AmountMarkup>string</AmountMarkup>
          <APP_AgencyXmlBaseUrl>string</APP_AgencyXmlBaseUrl>
          <DocketType>string</DocketType>
          <SystemTypeId>int</SystemTypeId>
          <AgencyId>int</AgencyId>
          <UserName>string</UserName>
          <Password>string</Password>
          <SubSite>int</SubSite>
        </ConfigParam>
        <Result>
          <XmlAfterRegistration>string</XmlAfterRegistration>
          <DocketId>int</DocketId>
          <BUNDLE_ID>string</BUNDLE_ID>
          <Reserv_Num>
            <string>string</string>
            <string>string</string>
          </Reserv_Num>
        </Result>
      </myOrder>
    </Booking>
  </soap:Body>
</soap:Envelope>

我尝试使用 php soapclient,但我不知道如何正确地做到这一点。我得到的错误是:致命错误:未捕获的 SoapFault 异常:[WSDL] SOAP-ERROR:解析 WSDL:无法从“ https://web14.agency2000.co.il/bytechws/pricessearch.asmx?WSDL ”加载:无法在 C:\xampp\htdocs\credit2000\booking.php:96 中加载外部实体“ https://web14.agency2000.co.il/bytechws/pricessearch.asmx?WSDL ”堆栈跟踪:#0 C:\xampp \htdocs\credit2000\booking.php(96): SoapClient->SoapClient(' https://web14.a ...', Array) #1 C:\xampp\htdocs\credit2000\booking.php(81): callData('Booking', Object(stdClass)) #2 {main} 在第 96 行的 C:\xampp\htdocs\credit2000\booking.php 中抛出任何帮助吗???

4

1 回答 1

0

您使用的 WSDL URL 不存在。如果没有正确的 URL,您将永远无法成功完成请求。PHP 需要 WSDL 来创建正确的数据结构。

于 2013-08-08T18:59:21.800 回答