PEAR SOAP problem invoking remote method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm trying to use PEAR SOAP to access a remote Web Service written in
MS.NET. I use it in wsdl mode, so I simply do:

-- code --
$ws = new SOAP_Client('http://my.web.service/WebService.asmx?wsdl', true,
NULL, array('user' => 'myusername', 'pass' => 'mysecretpassword'));
$args = array('firstArg' => 'theFirstArgOfMethod',
              'secondArg' => 'theSecondArgOfMethod');

$result = & $ws->call('MyMethod', $args);
-- end --

The SOAP Envelope should be like this:

[...]
<ns4:MyMethod>
 <ns4:firstArg>theFirstArgOfMethod</ns4:firstArg>
 <ns4:secondArg>theSecondArgOfMethod</ns4:secondArg>
</ns4:MyMethod>
[..]

Actually PEAR SOAP seems to create this code:

[..]
<ns4:MyMethod>
 <firstArg>theFirstArgOfMethod</firstArg>
 <secondArg>theSecondArgOfMethod</secondArg>
</ns4:MyMethod>
[..]

Obviously the second call doesn't work, because the server doesn't recognize
the method parameters and simply returns empty results.

I tried to make a simple patch to Client.php

444a445,446
>      // set the namespace for parameters of method
>      if (isset($opData['input']['namespace'])) $xmlns =
$this->_wsdl->namespaces[$opData['input']['namespace']];
449c451
<                     $xmlns = '';
---
>       //$xmlns = '';
477c479,480
<                         if ($xmlns) $pqname = '{'.$xmlns.'}'.$name;
---
>                         
>    if ($xmlns) $pqname = '{'.$xmlns.'}'.$name;
478a482
>    

I've found that changing the Client.php code in this way seems to work, but
I'm not so deep in wsdl so please help me find out if there is something
wrong on my code.
Basically the same thing works fine using native PHP5 SOAP.

The patch applies to PEAR SOAP 0.8.1 (I've the same problem also on the last
version 0.9.1 though).

Thanks in advice for replies.
Bye, 
Davide Romanini

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux