dmitry          Thu Aug 26 08:24:54 2004 EDT

  Modified files:              
    /php-src/ext/soap   php_packet_soap.c soap.c 
    /php-src/ext/soap/tests/bugs        bug29830.phpt bug29844.phpt 
                                        bug29844.wsdl 
  Log:
  Merged bug fixes from PHP_5_0.
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_packet_soap.c?r1=1.36&r2=1.37&ty=u
Index: php-src/ext/soap/php_packet_soap.c
diff -u php-src/ext/soap/php_packet_soap.c:1.36 php-src/ext/soap/php_packet_soap.c:1.37
--- php-src/ext/soap/php_packet_soap.c:1.36     Fri May 21 10:50:19 2004
+++ php-src/ext/soap/php_packet_soap.c  Thu Aug 26 08:24:54 2004
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_packet_soap.c,v 1.36 2004/05/21 14:50:19 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.37 2004/08/26 12:24:54 dmitry Exp $ */
 
 #include "php_soap.h"
 
@@ -250,8 +250,12 @@
                                while 
(zend_hash_get_current_data(fn->responseParameters, (void **)&h_param) == SUCCESS) {
                                        param = (*h_param);
                                        if (fnb->style == SOAP_DOCUMENT) {
-                                               name = param->encode->details.type_str;
-                                               ns = param->encode->details.ns;
+                                               if (param->element) {
+                                                       name = 
param->encode->details.type_str;
+                                                       ns = param->encode->details.ns;
+                                               } else {
+                                                       name = param->paramName;
+                                               }
                                        } else {
                                                name = fn->responseName;
                                                /* ns = ? */
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.115&r2=1.116&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.115 php-src/ext/soap/soap.c:1.116
--- php-src/ext/soap/soap.c:1.115       Tue Aug 10 12:11:41 2004
+++ php-src/ext/soap/soap.c     Thu Aug 26 08:24:54 2004
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: soap.c,v 1.115 2004/08/10 16:11:41 dmitry Exp $ */
+/* $Id: soap.c,v 1.116 2004/08/26 12:24:54 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1126,7 +1126,9 @@
                HashPosition pos;
                zend_hash_internal_pointer_reset_ex(ft, &pos);
                while (zend_hash_get_current_data_ex(ft, (void **)&f, &pos) != 
FAILURE) {
-                       add_next_index_string(return_value, f->common.function_name, 
1);
+                       if ((service->type != SOAP_CLASS) || (f->common.fn_flags & 
ZEND_ACC_PUBLIC)) {
+                               add_next_index_string(return_value, 
f->common.function_name, 1);
+                       }
                        zend_hash_move_forward_ex(ft, &pos);
                }
        }
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29830.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug29830.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29830.phpt:1.2
--- /dev/null   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/tests/bugs/bug29830.phpt   Thu Aug 26 08:24:54 2004
@@ -0,0 +1,25 @@
+--TEST--
+Bug #29844 (SoapServer::setClass() should not export non-public methods)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class hello_world {   
+  public function hello($to) {
+    return 'Hello ' . $to;
+  }    
+  private function bye($to) {
+    return 'Bye ' . $to;
+  }    
+}
+
+$server = new SoapServer(NULL, array("uri"=>"test://"));
+$server->setClass('hello_world');
+$functions = $server->getFunctions();
+foreach($functions as $func) {
+  echo $func . "\n";
+}
+?>
+--EXPECT--
+hello
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29844.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug29844.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29844.phpt:1.2
--- /dev/null   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/tests/bugs/bug29844.phpt   Thu Aug 26 08:24:54 2004
@@ -0,0 +1,36 @@
+--TEST--
+Bug #29844 (SOAP doesn't return the result of a valid SOAP request)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class hello_world {   
+  public function hello($to) {
+    return 'Hello ' . $to;
+  }    
+}
+
+class LocalSoapClient extends SoapClient {
+
+  function LocalSoapClient($wsdl, $options) {
+    $this->SoapClient($wsdl, $options);
+    $this->server = new SoapServer($wsdl, $options);
+    $this->server->setClass('hello_world');;
+  }
+
+  function __doRequest($request, $location, $action, $version) {
+    ob_start();
+    $this->server->handle($request);
+    $response = ob_get_contents();
+    ob_end_clean();
+    return $response;
+  }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug29844.wsdl", array("trace"=>1)); 
+var_dump($client->hello('davey'));
+?>
+--EXPECT--
+string(11) "Hello davey"
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29844.wsdl?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug29844.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29844.wsdl:1.2
--- /dev/null   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/tests/bugs/bug29844.wsdl   Thu Aug 26 08:24:54 2004
@@ -0,0 +1,66 @@
+<?xml version="1.0" ?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:tns="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php";
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"; 
name="Crtx_SOAP_AutoDiscover_Example" 
targetNamespace="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php";>
+  <portType name="Crtx_SOAP_AutoDiscover_ExamplePort">
+    <operation name="hello">
+      <input message="tns:helloRequest" />
+      <output message="tns:helloResponse" />
+      <documentation>Say Hello to Somebody</documentation>
+    </operation>
+    <operation name="goodBye">
+      <input message="tns:goodByeRequest" />
+      <output message="tns:goodByeResponse" />
+      <documentation>Say Goodbye to Somebody</documentation>
+    </operation>
+  </portType>
+  <binding name="Crtx_SOAP_AutoDiscover_ExampleBinding"
+  type="tns:Crtx_SOAP_AutoDiscover_ExamplePort">
+    <soap:binding style="document"
+    transport="http://schemas.xmlsoap.org/soap/http"; />
+    <operation name="hello">
+      <input>
+        <soap:body use="encoded"
+        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
+      </input>
+      <output>
+        <soap:body use="encoded"
+        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
+      </output>
+      <soap:operation 
soapAction="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php#hello";
 />
+    </operation>
+    <soap:binding style="document"
+    transport="http://schemas.xmlsoap.org/soap/http"; />
+    <operation name="goodBye">
+      <input>
+        <soap:body use="encoded"
+        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
+      </input>
+      <output>
+        <soap:body use="encoded"
+        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
+      </output>
+      <soap:operation 
soapAction="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php#goodBye";
 />
+    </operation>
+  </binding>
+  <service name="Crtx_SOAP_AutoDiscover_ExampleService">
+    <port name="tns:Crtx_SOAP_AutoDiscover_ExamplePort"
+    binding="tns:Crtx_SOAP_AutoDiscover_ExampleBinding">
+      <soap:address 
location="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php";
 />
+    </port>
+  </service>
+  <message name="helloRequest">
+    <part name="to" type="xsd:string" />
+    <documentation>Say Hello to Somebody</documentation>
+  </message>
+  <message name="helloResponse">
+    <part name="helloReturn" type="xsd:string" />
+    <documentation>The greeting</documentation>
+  </message>
+  <message name="goodByeRequest">
+    <part name="to" type="xsd:string" />
+    <documentation>Say Goodbye to Somebody</documentation>
+  </message>
+  <message name="goodByeResponse">
+    <part name="goodByeReturn" type="xsd:string" />
+    <documentation>The goodbye</documentation>
+  </message>
+</definitions>

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

Reply via email to