SOAP,遇到VersionMismatch,求解决 soapxmlwsdloauthphp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 提供的方法Array( [0] => callServiceResponse callService(callService $parameters))相关的数据结构Array( [0] => struct callService { string in0; string in1; string in2; string in3;} [1] => struct callServiceResponse { string out;})你总得按规矩来吧? 按照我这个来try { $xml='xml数据'; //地址 $soap = new SoapClient ( "http://mp.vservice.com.cn/service/OutWebService?WSDL" ); //请求参数 根据你的参数调整 $param = array ('userName' => '*****', 'pwd' => '****', 'businessType' => 'SaleHouses', 'xmlContent' => $xml ); //调用服务器端的方法 根据你的方法调整 我这里Import是方法名称 $result = $soap->__soapCall ( 'Import', array ('parameters' => $param ) ); print_r ( $result ); } catch ( SoapFault $e ) { echo $e->getMessage (); } catch ( Exception $E ) { echo $E->getMessage (); } 额,我新手,之前没有接触过Soap,可以帮我贴出一个完整的代码吗?非常感谢 这个我运行后出来的信息是这样的,stdClass Object ( [out] => ) 1、获取网页授权URL接口接口地址 http://v2.shanxitele.com/service/OutWebService?wsdl接口调用方callService(String serviceName,String servId,String secretKey,String xmlInfo)接口输入参数参数名称 传值serviceName OAuthservId 服务号id 太原电信=fc4fa30c444400b701446c540230244esecretKey 服务号秘钥 太原电信=96e79218965eb72c92a549dd5a330112xmlInfo <?xml version="1.0" encoding="UTF-8"?><BaseInfo> <servId>xxx</servId> <platform>yixin</platform> <type>base</type> <redirect_uri>uri</redirect_uri></BaseInfo>拜托了。这个实在是不懂。 try{ $client = new SOAPClient("http://v2.shanxitele.com/service/OutWebService?wsdl", array('uri' => "http://v2.shanxitele.com/")); $servicename = 'OAuth'; $servId = 'fc4fa30c444400b701446c540230244e'; $secretKey = '96e79218965eb72c92a549dd5a330112'; $xmlInfo = '<?xml version="1.0" encoding="UTF-8"?><BaseInfo><servId>fc4fa30c444400b701446c540230244e</servId><platform>yixin</platform><type>base</type><redirect_uri>lcoalhost/index.php</redirect_uri></BaseInfo>'; $data = array('in0' => $servicename, 'in1' => $servId, 'in2'=>$secretKey, 'in3'=>$xmlInfo); $result = $client->callService($data); $rs = simplexml_load_string($result->out, 'SimpleXMLElement', LIBXML_NOCDATA); print_r($rs);}catch(SOAPFault $e){ echo "Error: ",$e->faultcode,", string: ",$e->faultstring;} 查看页面源代码顶部有一部分空白是怎么回事? 循环取值问题 关于ajax无刷新分页遇到的问题,忘大侠指点!! 数据库编码问题,有床戏哦 请帮帮忙把这段ASP程序改成PHP的 Fatal error。。。高手帮忙啊。。。 各位,进来帮个忙! 为什么调用ftp_connect()时会显示"Call to undefined function: ftp_connect()…"?请指教。 学习PHP遇到一个语法问题,折腾一天了,求助。 如何根据上线时间、下线时间,算出某时间段在线用户数 虚拟机linux系统和本机无法通信 hhvm问题,请各位玩转php大圣指点
Array
(
[0] => callServiceResponse callService(callService $parameters)
)
相关的数据结构
Array
(
[0] => struct callService {
string in0;
string in1;
string in2;
string in3;
}
[1] => struct callServiceResponse {
string out;
}
)
你总得按规矩来吧?
$xml='xml数据';
//地址
$soap = new SoapClient ( "http://mp.vservice.com.cn/service/OutWebService?WSDL" );
//请求参数 根据你的参数调整
$param = array ('userName' => '*****', 'pwd' => '****', 'businessType' => 'SaleHouses', 'xmlContent' => $xml );
//调用服务器端的方法 根据你的方法调整 我这里Import是方法名称
$result = $soap->__soapCall ( 'Import', array ('parameters' => $param ) );
print_r ( $result );
} catch ( SoapFault $e ) {
echo $e->getMessage ();
} catch ( Exception $E ) {
echo $E->getMessage ();
}
这个我运行后出来的信息是这样的,stdClass Object ( [out] => )
1、获取网页授权URL接口
接口地址 http://v2.shanxitele.com/service/OutWebService?wsdl
接口调用方
callService(String serviceName,String servId,String secretKey,String xmlInfo)
接口输入参数
参数名称 传值
serviceName OAuth
servId 服务号id 太原电信=fc4fa30c444400b701446c540230244e
secretKey 服务号秘钥 太原电信=96e79218965eb72c92a549dd5a330112
xmlInfo
<?xml version="1.0" encoding="UTF-8"?>
<BaseInfo>
<servId>xxx</servId>
<platform>yixin</platform>
<type>base</type>
<redirect_uri>uri</redirect_uri>
</BaseInfo>拜托了。这个实在是不懂。
$client = new SOAPClient("http://v2.shanxitele.com/service/OutWebService?wsdl",
array('uri' => "http://v2.shanxitele.com/")); $servicename = 'OAuth';
$servId = 'fc4fa30c444400b701446c540230244e';
$secretKey = '96e79218965eb72c92a549dd5a330112';
$xmlInfo = '<?xml version="1.0" encoding="UTF-8"?><BaseInfo><servId>fc4fa30c444400b701446c540230244e</servId><platform>yixin</platform><type>base</type><redirect_uri>lcoalhost/index.php</redirect_uri></BaseInfo>'; $data = array('in0' => $servicename, 'in1' => $servId, 'in2'=>$secretKey, 'in3'=>$xmlInfo);
$result = $client->callService($data);
$rs = simplexml_load_string($result->out, 'SimpleXMLElement', LIBXML_NOCDATA);
print_r($rs);
}catch(SOAPFault $e){
echo "Error: ",$e->faultcode,", string: ",$e->faultstring;
}