php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49495 PHP doesn't run correct method
Submitted: 2009-09-08 06:27 UTC Modified: 2009-09-08 08:17 UTC
From: martin at spuetz dot net Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.3.0 OS: Linux
Private report: No CVE-ID: None
 [2009-09-08 06:27 UTC] martin at spuetz dot net
Description:
------------
I have two methods test1() and test2(), but PHP always runs the first one.

You can see this on the following link:
http://www.spuetz.net/client.php
http://www.spuetz.net/source.txt

It does works, when I add a parameter (change the method signature?):
http://www.spuetz.net/client1.php
http://www.spuetz.net/source1.txt

The server is running 5.2.10 (http://www.spuetz.net/info.php), but I tried it with 5.3.0, too.

The wsdl file was generated with Zend Studio.

Reproduce code:
---------------
class Testserver {

    public function test1()
    {
        return "test1";
    }

    public function test2()
    {
        return "test2";
    }
}

[...]

var_dump($client->test1());
var_dump($client->test2());

Expected result:
----------------
string(5) "test1"
string(5) "test2"


Actual result:
--------------
string(5) "test1"
string(5) "test1"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-08 08:17 UTC] martin at spuetz dot net
I found the problem. It will work when you change the soap binding style 
to rpc.

doesn't work:
<soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>

works:
<soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>

Greetings from Germany
Martin
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 22:03:38 2021 UTC