Bug #73089 [Com]: SOAP pass dictionary parameter

From: Date: Wed, 31 May 2017 14:27:53 +0000
Subject: Bug #73089 [Com]: SOAP pass dictionary parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209323@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73089&edit=1 ID: 73089 Comment by: wapinet at mail dot ru Reported by: matteo dot veggia at gmail dot com Summary: SOAP pass dictionary parameter Status: Closed Type: Bug Package: SOAP related Operating System: Windows PHP Version: 7.0.14 Assigned To: nikic Block user comment: N Private report: N New Comment: !!! problem only if SoapServer configured with "'cache_wsdl' => WSDL_CACHE_MEMORY" !!! if "'cache_wsdl' => WSDL_CACHE_DISK" or none the problem is not reproduced (works correct). P.S.: correct php code from prev message: class Api { public function receiveEDIMessages() { return array( 'head' => null, 'body' => array(array( 'message' => 'text', 'from' => '2352457999993', 'to' => '2352456999994', 'id' => 54370 )), ); } } Previous Comments: ------------------------------------------------------------------------ [2017-05-31 12:48:30] wapinet at mail dot ru php code: $server = new SoapServer('my.wsdl'); $server->setClass(Api::class); $server->handle(); class Api { public function receiveEDIMessages() { return array( 'head' => null, 'body' => array( 'message' => 'text', 'from' => '2352457999993', 'to' => '2352456999994', 'id' => 54370 ), ); } } WSDL (use rpc style): <xsd:complexType name="bodyMessagesResponse"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="tns:messageResponse[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="messageResponse"> <xsd:sequence> <xsd:element name="message" type="xsd:string"/> <xsd:element name="from" type="xsd:string"/> <xsd:element name="to" type="xsd:string"/> <xsd:element name="id" type="xsd:integer"/> </xsd:sequence> </xsd:complexType> response php 5.6: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http_://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http_://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:interface" xmlns:xsd="http_://www.w3.org/2001/XMLSchema" xmlns:xsi="http_://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:private" xmlns:SOAP-ENC="http_://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:receiveEDIMessagesResponse> <receiveEDIMessagesReturn xsi:type="ns2:receiveEDIMessagesResponse"> <head xsi:type="ns2:headResponse"> <code xsi:type="xsd:int">0</code> <message xsi:nil="true"/> </head> <body SOAP-ENC:arrayType="ns2:messageResponse[1]" xsi:type="ns2:bodyMessagesResponse"> <item xsi:type="ns2:messageResponse"> <message xsi:type="xsd:string">text</message> <from xsi:type="xsd:string">2352457999993</from> <to xsi:type="xsd:string">2352456999994</to> <id xsi:type="xsd:integer">54370</id> </item> </body> </receiveEDIMessagesReturn> </ns1:receiveEDIMessagesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> response php 7.x: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http_://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http_://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:interface" xmlns:xsd="http_://www.w3.org/2001/XMLSchema" xmlns:xsi="http_://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:private" xmlns:ns3="http_://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http_://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:receiveEDIMessagesResponse> <receiveEDIMessagesReturn xsi:type="ns2:receiveEDIMessagesResponse"> <head xsi:type="ns2:headResponse"> <code xsi:type="xsd:int">0</code> <message xsi:nil="true"/> </head> <body SOAP-ENC:arrayType="ns3:Map[1]" xsi:type="ns2:bodyMessagesResponse"> <item xsi:type="ns3:Map"> <item> <key xsi:type="xsd:string">message</key> <value xsi:type="xsd:string">text</value> </item> <item> <key xsi:type="xsd:string">from</key> <value xsi:type="xsd:string">2352457999993</value> </item> <item> <key xsi:type="xsd:string">to</key> <value xsi:type="xsd:string">2352456999994</value> </item> <item> <key xsi:type="xsd:string">id</key> <value xsi:type="xsd:string">54370</value> </item> </item> </body> </receiveEDIMessagesReturn> </ns1:receiveEDIMessagesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ------------------------------------------------------------------------ [2017-01-31 10:58:33] nikic@php.net Related To: Bug #71763 ------------------------------------------------------------------------ [2017-01-09 12:09:12] nikic@php.net Thanks for verifying! I don't know the exact release date, but it will be approximately two weeks from now. ------------------------------------------------------------------------ [2017-01-09 11:28:50] matteo dot veggia at gmail dot com FINALLY! With version 7.0.15RC IT WORKS! Last question: when will be released 7.0.15 version? XD ------------------------------------------------------------------------ [2017-01-09 10:45:38] nikic@php.net There is a 7.0.15RC1 release (see http://windows.php.net/qa/) now which contains this fix. Can you please check it? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=73089 -- Edit this bug report at https://bugs.php.net/bug.php?id=73089&edit=1

« previous php.bugs (#209323) next »