#43723 [NEW]: SOAP not sent properly from client for <choice>.

From: Date: Mon, 31 Dec 2007 20:34:25 +0000
Subject: #43723 [NEW]: SOAP not sent properly from client for <choice>.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120961@lists.php.net to get a copy of this message
From:             mcordell at authorize dot net
Operating system: Windows XP Pro
PHP version:      5.2.5
PHP Bug Type:     SOAP related
Bug description:  SOAP not sent properly from client for <choice>.

Description:
------------
The wsdl contains a <choice> element. When the SOAP client sends the first
element of the choice (ItemA) it works but if it sends the second one
(ItemB) instead, the xml does not get sent.


Reproduce code:
---------------
The WSDL can be found HERE:
http://www.youshare.com/view.php?file=BoxWebService.wsdl.txt


<?php

class ItemA {
    public $myname;
}
class ItemB {
    public $mynumber;
}
class Box {
    public $myitemA;
    public $myitemB;
}
class Foo {
	public $mybox;
}

$ws = new SoapClient("http://someurl.com/BoxWebService.asmx?wsdl",
array('trace' => 1));
$req = new Foo();
$req->mybox = new Box();
if (FALSE) {
	$req->mybox->myitemA = new ItemA();
	$req->mybox->myitemA->myname = "somename";
} else {
	$req->mybox->myitemB = new ItemB();
	$req->mybox->myitemB->mynumber = 123;
}
$resp = $ws->__soapCall("Foo", array("Foo" => $req));
echo "Raw request: " . htmlspecialchars($ws->__getLastRequest()) .
"<br><br>";
echo "Raw response: " . htmlspecialchars($ws->__getLastResponse()) .
"<br><br>";
echo htmlspecialchars($resp->FooResult) . "<br><br>";

?>

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://someurl.com/BoxWebService/"><SOAP-ENV:Body><ns1:Foo><ns1:mybox><ns1:myitemB><ns1:mynumber>123</ns1:mynumber></ns1:myitemB></ns1:mybox></ns1:Foo></SOAP-ENV:Body></SOAP-ENV:Envelope>



Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://someurl.com/BoxWebService/"><SOAP-ENV:Body><ns1:Foo><ns1:mybox/></ns1:Foo></SOAP-ENV:Body></SOAP-ENV:Envelope>



-- 
Edit bug report at http://bugs.php.net/?id=43723&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43723&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43723&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43723&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43723&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43723&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=43723&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43723&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43723&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43723&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43723&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43723&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=43723&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=43723&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43723&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43723&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43723&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43723&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43723&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43723&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43723&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43723&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#120961) next »