NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP Web service client with nusoap problem


Joined: 21 Jun 2007
Posts: 3
Reply with quote
Hello

I'm doing a web service client on PHP to access a webservice server on Linux (C#). But I call the proxy and it always gives undefined. The webservice seams to be working on Windows.

Here's the code:

Code:


/* wsdl contains the address to the web service client
    http://mywebserver/Page/Service.asmx?wsdl
*/

$soap = new soapclient ( $wsdl, false );

$proxy->getProxy ();

$list = $proxy->GetList ( array ( 1 ) );



And the message is this:

"Fatal error: Call to undefined method nusoap_proxy_1309742293::NoiciaPorId () in var/www/file.php on line 19"

The "GetList" function does exist in the C# webservice code (webmethod). It works from Windows.

Also print_r ( $proxy ) after the $proxy->GetProxy (); call

shows a lot of stuff. Including references to address of the IIS / C# server and the method that is called (GetList). Any ideas to solve this? Thanks.
View user's profileFind all posts by TintonSend private message


Joined: 21 Jun 2007
Posts: 3
Reply with quote
Well I printed the

$proxy->getError();
$soap->getError();

The first one doesn't show any error. The second shows:

"No operations defined in the wsdl document!"

Any ideas people?!?!
Thanks
View user's profileFind all posts by TintonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7897
Reply with quote
if endpoints are in their namespaces, you have to specify/use namespace when you create soapclient object.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Jun 2007
Posts: 3
Reply with quote
Hello, thanks for your post.

However I'm not sure if I understood what you posted.

When the object is created, using the call

$soap = new soapclient ( $wsdl, false );

(actually it's using true and not false there).

The $wsdl variable has the path to the WDSL file. Isnt that the "endpoint" ?

The namespace is defined (C#) as
http://mywebserver/Page/

And the $wsdl as
http://mywebserver/Page/Service.asmx?wsdl

What else is needed?

Thanks.
View user's profileFind all posts by TintonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7897
Reply with quote
do not use proxy, use soapclient instance and make calls like shown below:

$result = $soap->call(
'hello', // method/endpoint name
array('aparam' => 'avalue'), // input parameters
'uri:test', // namespace
'uri:test/atest' // SOAPAction
);

See this page for more advanced examples:
http://www.scottnichol.com/nusoapprog.htm

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP Web service client with nusoap problem
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic