Bug #77457 [NEW]: soap generated request does not work with <choice> tag

From: Date: Mon, 14 Jan 2019 11:48:37 +0000
Subject: Bug #77457 [NEW]: soap generated request does not work with <choice> tag
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218938@lists.php.net to get a copy of this message
From:             nevermind dot cs96 at gmail dot com
Operating system: Ubuntu 16.04.5 LTS (GNU/Linux 4.
PHP version:      7.1.26
Package:          SOAP related
Bug Type:         Bug
Bug description:soap generated request does not work with <choice> tag

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

-- 
Edit bug report at https://bugs.php.net/bug.php?id=77457&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77457&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77457&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77457&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77457&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77457&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77457&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77457&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77457&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77457&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77457&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77457&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77457&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77457&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77457&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77457&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77457&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77457&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77457&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77457&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77457&r=mysqlcfg



Thread (1 message)

  • nevermind dot cs96 at gmail dot com
« previous php.bugs (#218938) next »