dmitry          Tue Oct  5 12:00:41 2004 EDT

  Modified files:              
    /php-src/ext/soap   php_packet_soap.c 
    /php-src/ext/soap/tests/bugs        bug30175.phpt bug30175.wsdl 
  Log:
  Fixed bug #30175 (SOAP results aren't parsed correctly)
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_packet_soap.c?r1=1.38&r2=1.39&ty=u
Index: php-src/ext/soap/php_packet_soap.c
diff -u php-src/ext/soap/php_packet_soap.c:1.38 php-src/ext/soap/php_packet_soap.c:1.39
--- php-src/ext/soap/php_packet_soap.c:1.38     Fri Aug 27 03:07:46 2004
+++ php-src/ext/soap/php_packet_soap.c  Tue Oct  5 12:00:40 2004
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_packet_soap.c,v 1.38 2004/08/27 07:07:46 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.39 2004/10/05 16:00:40 dmitry Exp $ */
 
 #include "php_soap.h"
 
@@ -270,6 +270,9 @@
                                        if (!cur) {
                                                cur = get_node(resp, name);
                                                /* TODO: produce warning invalid ns */
+                                       }
+                                       if (!cur && fnb->style == SOAP_RPC) {
+                                         cur = resp;
                                        }
                                        if (cur) {
                                                if (fnb->style == SOAP_DOCUMENT) {
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug30175.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug30175.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug30175.phpt:1.2
--- /dev/null   Tue Oct  5 12:00:41 2004
+++ php-src/ext/soap/tests/bugs/bug30175.phpt   Tue Oct  5 12:00:40 2004
@@ -0,0 +1,47 @@
+--TEST--
+Bug #30175 (SOAP results aren't parsed correctly)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+class LocalSoapClient extends SoapClient {
+
+  function __doRequest($request, $location, $action, $version) {
+    return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
+xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+xmlns:ns1="urn:qweb">
+<SOAP-ENV:Body
+SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
+id="_0">
+<ns1:HostInfo xsi:type="ns1:HostInfo">
+<name xsi:type="xsd:string">blah blah some name field</name>
+<shortDescription xsi:type="xsd:string">This is a description. more blah blah 
blah</shortDescription>
+<ipAddress xsi:type="xsd:string">127.0.0.1</ipAddress>
+</ns1:HostInfo>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+  }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug30175.wsdl");
+var_dump($client->qwebGetHostInfo());
+?>
+--EXPECT--
+array(3) {
+  ["name"]=>
+  string(25) "blah blah some name field"
+  ["shortDescription"]=>
+  string(42) "This is a description. more blah blah blah"
+  ["ipAddress"]=>
+  string(9) "127.0.0.1"
+}
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug30175.wsdl?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug30175.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug30175.wsdl:1.2
--- /dev/null   Tue Oct  5 12:00:41 2004
+++ php-src/ext/soap/tests/bugs/bug30175.wsdl   Tue Oct  5 12:00:40 2004
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="qweb"
+ targetNamespace="http://www.newsblob.com/qweb.wsdl";
+ xmlns:tns="http://www.newsblob.com/qweb.wsdl";
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+ xmlns:ns1="urn:qweb"
+ xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/";
+ xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/";
+ xmlns="http://schemas.xmlsoap.org/wsdl/";>
+
+<types>
+
+ <schema targetNamespace="urn:qweb"
+  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
+  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+  xmlns:ns1="urn:qweb"
+  xmlns="http://www.w3.org/2001/XMLSchema";
+  elementFormDefault="unqualified"
+  attributeFormDefault="unqualified">
+  <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+  <complexType name="qwebGetHostInfoResponse">
+   <sequence>
+    <element name="return" type="ns1:HostInfo" minOccurs="1" maxOccurs="1"/>
+   </sequence>
+  </complexType>
+  <complexType name="ArrayOfHostInfo">
+   <complexContent>
+    <restriction base="SOAP-ENC:Array">
+     <sequence>
+      <element name="item" type="ns1:HostInfo" minOccurs="0" maxOccurs="unbounded"/>
+     </sequence>
+     <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="ns1:HostInfo[]"/>
+    </restriction>
+   </complexContent>
+  </complexType>
+ </schema>
+
+</types>
+
+<message name="qwebSquareRequest">
+ <part name="mynum" type="xsd:int"/>
+</message>
+
+<message name="qwebSquareResponse">
+ <part name="result" type="xsd:int"/>
+</message>
+
+<message name="qwebStrlenRequest">
+ <part name="mystr" type="xsd:string"/>
+</message>
+
+<message name="qwebStrlenResponse">
+ <part name="result" type="xsd:int"/>
+</message>
+
+<message name="qwebGetHostInfoRequest">
+</message>
+
+<message name="HostInfo">
+ <part name="name" type="xsd:string"/>
+ <part name="shortDescription" type="xsd:string"/>
+ <part name="ipAddress" type="xsd:string"/>
+</message>
+
+<portType name="qwebPortType">
+ <operation name="qwebSquare">
+  <documentation>Service definition of function ns1__qwebSquare</documentation>
+  <input message="tns:qwebSquareRequest"/>
+  <output message="tns:qwebSquareResponse"/>
+ </operation>
+ <operation name="qwebStrlen">
+  <documentation>Service definition of function ns1__qwebStrlen</documentation>
+  <input message="tns:qwebStrlenRequest"/>
+  <output message="tns:qwebStrlenResponse"/>
+ </operation>
+ <operation name="qwebGetHostInfo">
+  <documentation>Service definition of function ns1__qwebGetHostInfo</documentation>
+  <input message="tns:qwebGetHostInfoRequest"/>
+  <output message="tns:HostInfo"/>
+ </operation>
+</portType>
+
+<binding name="qweb" type="tns:qwebPortType">
+ <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="qwebSquare">
+  <SOAP:operation style="rpc" soapAction=""/>
+  <input>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </input>
+  <output>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </output>
+ </operation>
+ <operation name="qwebStrlen">
+  <SOAP:operation style="rpc" soapAction=""/>
+  <input>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </input>
+  <output>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </output>
+ </operation>
+ <operation name="qwebGetHostInfo">
+  <SOAP:operation style="rpc" soapAction=""/>
+  <input>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </input>
+  <output>
+   <SOAP:body use="encoded" namespace="urn:qweb" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+  </output>
+ </operation>
+</binding>
+
+<service name="qweb">
+ <documentation>Demo Qweb SOAP interface</documentation>
+ <port name="qweb" binding="tns:qweb">
+  <SOAP:address location="http://www.newsblob.com:6969"/>
+ </port>
+</service>
+
+</definitions>

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to