1

I've made ASP.NET web service, which contains one initial method called HelloWorld. I want to access to mentioned method using php and following code:

$client = new SoapClient("http://localhost:4925/Service1.asmx?WSDL");

$result = $client->HelloWorld()->TestMethodResult;
echo $result;

When I run php script, i get following error:

***Notice: Undefined property: stdClass::$TestMethodResult in C:\wamp\www\probe\servis.php on line 8***

Can someone please help?

MrD
  • 2,423
  • 3
  • 33
  • 57

1 Answers1

2

Since HelloWorld is the method you are trying to call, try:

$result = $client->__soapCall('HelloWord', $params);

or

$result = $client->HelloWorld($params);

Where $params are any parameters you need to send for the method.

Mike Brant
  • 70,514
  • 10
  • 99
  • 103
  • 1
    Can you provide results of `$client->__getFunctions()`? – Mike Brant Sep 07 '12 at 16:02
  • This works: $params = array('bla'=>'opala'); $response = $client->HelloWorld($params); var_dump($response); echo "$response->HelloWorldResult"; – MrD Sep 07 '12 at 16:04
  • @Mr.M Ahh... so HelloWorld is the actual method not TestMethodResult. I guess I don't know where. I have updated the answer. – Mike Brant Sep 07 '12 at 16:08