Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693876
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:25:45+00:00 2026-05-19T04:25:45+00:00

Greetings stackoverflow. I have been tinkering about with a SOAP client using PHP5’s native

  • 0

Greetings stackoverflow.

I have been tinkering about with a SOAP client using PHP5’s native extension. The SOAP message I am trying to create, uses complex Data Types.

So far I have created a class file using the wsdl2php tool (http://www.urdalen.no/wsdl2php/). I have successfully created parts of my SOAP message however, I am sure I am doing this incorrectly. Please see below:

The message I want to create:

<soap:Envelope>
 <soap:Body>
  <OTA_HotelAvailRQ Version="1.0" AvailRatesOnly="true" TimeStamp="2010-10-06T16:14:26+08:00">
   <POS>
    <Source>
     <RequestorID ID="test" Type="10"/>
    </Source>
   </POS>
   <AvailRequestSegments>
    <AvailRequestSegment AvailReqType="NonRoom">
     <HotelSearchCriteria AvailableOnlyIndicator="1">
      <Criterion>
       <HotelRef HotelCode="PCBCMS"/>
       <StayDateRange Start="2010-10-06" End="2010-11-06"/>
      </Criterion>
     </HotelSearchCriteria>
    </AvailRequestSegment>
   </AvailRequestSegments>
  </OTA_HotelAvailRQ>
 </soap:Body>
</soap:Envelope>

With the following code I am able to produce part of the message however when it comes to:

// Hotel Availability
$qOTAhrq = new OTA_HotelAvailRQ();

$qOTAhrq->AvailRequestSegments['AvailRequestSegment'] = array('AvailReqType' => 'NonRoom');
$qOTAhrq->AvailRequestSegments['AvailRequestSegment']['HotelSearchCriteria'] = array();
$qOTAhrq->AvailRequestSegments['AvailRequestSegment']['HotelSearchCriteria']['Criterion'] = array();

The following message is produced by the code above. Whats going wrong 🙁

<ns1:AvailRequestSegments>
 <ns1:AvailRequestSegment AvailReqType="NonRoom">
   <ns1:HotelSearchCriteria/>
 </ns1:AvailRequestSegment>
</ns1:AvailRequestSegments>

needs to be


<ns1:AvailRequestSegments>
 <ns1:AvailRequestSegment AvailReqType="NonRoom">
   <ns1:HotelSearchCriteria AvailOnlyIndicator="1"/>
 </ns1:AvailRequestSegment>
</ns1:AvailRequestSegments>

Hopefully my question is extensive enough to understand what I am trying to achieve. Am I using the correct method to produce my xml soap message or should I not be using arrays this way? Is there a way where i can type something like:

$qOTAhrq->AvailRequestSegments->AvailRequestSegment = array(‘AvailReqType=’nonRoom’);

links: my classfile: wsdl class file (created by wsdl2php)

please help – perhaps my message will help someone else in the future 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:25:46+00:00Added an answer on May 19, 2026 at 4:25 am

    I am not fully sure, but I don’t seem to find any code segment that would evaluate to:<ns1:HotelSearchCriteria AvailOnlyIndicator="1"/>
    Perhaps you want something like,

    $qOTAhrq->AvailRequestSegments['AvailRequestSegment']['HotelSearchCriteria'] = array("AvailOnlyIndicator"=>"1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings to all! This is my first question here on stackoverflow. I have a
Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files
Greetings all: I currently am building a web application, and have been debating whether
Greetings, In an WPF DataGridTemplateColumn I have a CellTemplate using a ListView and a
Greetings, fellow StackOverFlow members. I have just begun to learn how to program web-enabled
Greetings, I'm trying to find a way to 'unbind' a socket from a particular
Greetings, I'm trying to find either a free .NET library or a command-line executable
Greetings! I am trying to check directory write-permissions from within a Windows MFC/ATL program
Greetings all, I have posted this on the MSDN managed news groups as well
Greetings everyone. This is my first question here at stackoverflow so please bear with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.