-1

我试图简单地返回字符串并在页面上打印它。

这里是PHP代码

$client = new SoapClient("path/track_on.asmx?WSDL"); $result = $client -> demoa("working!") -> demoaResult;

print_r($result);

肥皂服务


[WebMethod]

public string demoa(string emaildemo)
{

    string a = emaildemo;
    return a;

}

错误 :

Notice: Undefined property: stdClass::$demoaResult in C:\xampp\htdocs\track_on\index.php on line 4($result = $client -> demoa("working!") -> demoaResult;)

有什么建议么 ?

4

1 回答 1

1

尝试:

$client = new SoapClient("path/track_on.asmx?WSDL"); 
$result = $client -> demoa("working!");

print_r($result->demoaResult);

您正在尝试访问方法demoaResult中的变量demoa,但您应该从$result变量中访问它

于 2013-10-17T10:41:50.213 回答