try{
$client = new SoapClient("http://api.yousite.com/web/CoreService?wsdl");
$param=array($xml);
$ret = $client->__call('invoke',$param);
$result = ob2ar($ret);
print_r($ret);exit;
}catch(Exception $e){
echo $e->getMessage();
}返回错误:SOAP-ERROR: Parsing WSDL: Couldn't load from '****************' : SYSTEM or PUBLIC, the URI is missing
各位大哥,帮我看下,错在哪儿了,感激不尽!
$client = new SoapClient("http://api.yousite.com/web/CoreService?wsdl");
$param=array($xml);
$ret = $client->__call('invoke',$param);
$result = ob2ar($ret);
print_r($ret);exit;
}catch(Exception $e){
echo $e->getMessage();
}返回错误:SOAP-ERROR: Parsing WSDL: Couldn't load from '****************' : SYSTEM or PUBLIC, the URI is missing
各位大哥,帮我看下,错在哪儿了,感激不尽!
<wsdl:message name="batchSendSmsResponse">
<wsdl:part name="batchSendSmsReturn" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="invokeResponse1">
<wsdl:part name="invokeReturn" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="batchSendSmsRequest">
<wsdl:part name="xml" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="invokeRequest">
<wsdl:part name="xml" type="soapenc:string"/>
..................
try{
$url="http://sms.wintax.cn/axis/services/CoreService?wsdl";
$client = new SoapClient($url);
//print_r($client->__getFunctions());
//print_r($client->__getTypes());exit;
$param=array($xml,'');
$resp = $client->__call('invoke',$param);
print_r($resp);exit;
}catch(Exception $e){
$err_str=$e->getMessage();
echo $err_str; }
报错:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sms.wintax.cn/axis/services/CoreService?wsdl' : failed to load external entity "http://sms.wintax.cn/axis/services/CoreService?wsdl"
$client = new SoapClient("http://www.etaxcn.com/webservice/services/CoreService?wsdl");
print_r($client->__getFunctions());
print_r($client->__getTypes());
$param_arr=array($post_xml,'');
$ret = $client->invoke($param_arr);有报文返回,但是接口方告诉我,得到的xml是空串。可我echo了xml,真真切切不是空的呀。
这种是什么情况呀。最近弄webservice太头疼了。
Array
(
[0] => invokeResponse invoke(invoke $parameters)
)
Array
(
[0] => struct invoke {
string in0;
string in1;
}
[1] => struct invokeResponse {
string out;
}
)
stdClass Object
(
[out] => <?xml version="1.0" encoding="UTF-8" ?><root identity="BS44O9CP71L764DPQEUJURTAMHP3C8JO"><head><service><replyCode>FBRP011001</replyCode><replyMsg></replyMsg></service><createTime>1433404114418</createTime></head></root>
)
告诉你:
invoke 方法需要一个 invoke 结构的参数
返回一个 invokeResponse 结构struct invoke {
string in0;
string in1;
}
告诉你 invoke 结构有两个字符型变量,分别命名为 in0 和 in1php 没有结构的概念,所以要用关联数组代替
$param_arr = array(
'in0' => '数据1',
'in1' => '数据2'
);
$ret = $client->invoke($param_arr);由结构
struct invokeResponse {
string out;
}
可知:在返回的对象中,返回的数据放在名为 out 的属性里