php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77457 soap generated request does not work with <choice> tag
Submitted: 2019-01-14 11:48 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: nevermind dot cs96 at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 7.1.26 OS: Ubuntu 16.04.5 LTS (GNU/Linux 4.
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-01-14 11:48 UTC] nevermind dot cs96 at gmail dot com
Description:
------------
When all elements under <choice> tag has attribute minOccurs=0

Soap will only take first element to produce XML

probably related to https://bugs.php.net/bug.php?id=50997

And  [2012-07-20 13:33 UTC] jboffel at gmail dot com 's comment

Test script:
---------------
The passed in object
class utb\api\flight\travelport\Air\StructType\SearchAirLeg#253 (5) {
  public $SearchOrigin =>
  array(1) {
    [0] =>
    class utb\api\flight\travelport\Air\StructType\TypeSearchLocation#267 (6) {
      public $Airport =>
      NULL
      public $City =>
      class utb\api\flight\travelport\Air\StructType\City#268 (1) {
        public $Code =>
        string(3) "TPE"
      }
      public $CityOrAirport =>
      NULL
      public $CoordinateLocation =>
      NULL
      public $RailLocation =>
      NULL
      public $Distance =>
      NULL
    }
  }
  public $SearchDestination =>
  array(1) {
    [0] =>
    class utb\api\flight\travelport\Air\StructType\TypeSearchLocation#257 (6) {
      public $Airport =>
      class utb\api\flight\travelport\Air\StructType\Airport#262 (1) {
        public $Code =>
        string(3) "KIX"
      }
      public $City =>
      NULL
      public $CityOrAirport =>
      NULL
      public $CoordinateLocation =>
      NULL
      public $RailLocation =>
      NULL
      public $Distance =>
      NULL
    }
  }
  public $SearchDepTime =>
  array(1) {
    [0] =>
    class utb\api\flight\travelport\Air\StructType\TypeFlexibleTimeSpec#269 (4) {
      public $SearchExtraDays =>
      NULL
      public $TimeRange =>
      NULL
      public $SpecificTime =>
      NULL
      public $PreferredTime =>
      string(10) "2019-02-03"
    }
  }
  public $SearchArvTime =>
  array(0) {
  }
  public $AirLegModifiers =>
  NULL
}

WSDL <choice> part ( full schema https://support.travelport.com/webhelp/uapi/uAPI.htm#Getting_Started/Universal_API_Schemas_and_WSDLs.htm%3FTocPath%3DGetting%2520Started%7CGetting%2520Connected%7C_____2 )
<xs:complexType name="typeSearchLocation">
    <xs:sequence>
        <xs:choice>
            <xs:element ref="Airport" minOccurs="0"/>
            <xs:element ref="City" minOccurs="0"/>
            <xs:element ref="CityOrAirport" minOccurs="0"/>
            <xs:element ref="CoordinateLocation" minOccurs="0"/>
            <xs:element ref="RailLocation" minOccurs="0"/>
        </xs:choice>
        <xs:element ref="Distance" minOccurs="0"/>
    </xs:sequence>
</xs:complexType>

Expected result:
----------------
<ns2:SearchOrigin>
	<ns1:City Code="TPE"/>
</ns2:SearchOrigin>

Actual result:
--------------
<ns2:SearchOrigin/>

Which I'll get if I alter all the minOccurs to 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 06:01:27 2019 UTC