You are here: Noob php error question « PHP Programming Language « IT news, forums, messages
Noob php error question

Posted by AndyW on 09/03/06 07:17

Hey folks.


I am trying to get a soap wsdl service working and have a bit of a
noob php programming question for it. I'm using PHP 5.x btw.

I have written a soap server that contains a single method in the
form:

SayHelloWorld( $name ) { return "Hello " .$name; };

If I call the server directly from a soap client, it works fine, and
if I pass in bob as the parameter, I get Hello Bob back as the
response.

The code for that uses the $client= new SoapClient( location of
server ); technique.


Next, I wrote another client that uses a wsdl file that I created
(I've validated this using wsdl.exe and checked it for
wellformedness).

I create a new SOAP_WSDL object and calll generateProxy on it, then I
call the method using the getProxy() technique as in:

$test = $wsdl->getProxy();
$testResult = $test->SayHelloWorld( "bob" );

and this also works fine giving me Hello bob back as the return
param (so I am assuming my wsdl is correct).


Now the third client is where I am getting the problem. I am trying
to use the __soapCall method. However, when I call it, the return
param is:

Hello Object #4

The hello part is coming from the method call (as I have changed it in
the server to check just in case it was cached or something. But no
matter how hard I try I can't get the parameters to work - hence the
Object #4 bit. It should be 'bob'.

My code is as follows:

$client = new SoapClient( "http://a url here/wsdlfile.wsdl");
$client -> SayHelloWorld( "bob" )

Since the wsdl seems to work using the wsdl proxy method above, I
figure I am doing something noobish like incorrectly setting up the
params or reading them back again ?

Any ideas ?

Andy

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация