470,848 Members | 1,249 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Noob php error question

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

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

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

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 ?


Sep 3 '06 #1
0 1327

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Matt Hollingsworth | last post: by
3 posts views Thread by We need more power captain | last post: by
8 posts views Thread by Ivan Shevanski | last post: by
2 posts views Thread by Chris Dunaway | last post: by
2 posts views Thread by Dan McCollick | last post: by
8 posts views Thread by sore eyes | last post: by
2 posts views Thread by tavspamnofwd | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.