$client = new \SoapClient($wsdl_url,["trace"=>true,'encoding'=>'UTF-8','soap_version'=>SOAP_1_2,'uri'=>'http://ws.apache.org/axis2']);
print_r($client->__getFunctions());
$xml=<<
SLDQ
XML;
主要在這邊:使用數組就報錯
$client->__soapCall('getDepartInfo',$xml);
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in
等下發wsdl
回複討論(解決方案)
額,容量太大。。。。。
http://www.foxwho.com/wsdl.txt
這個地址查看
晚上 8點鐘線上,現在回家吃飯
由
struct getDepartInfo { string strXml;}可知,要這樣調用
$client->__soapCall('getDepartInfo', array('strXml' => $xml));
由
struct getDepartInfo { string strXml;}可知,要這樣調用
$client->__soapCall('getDepartInfo', array('strXml' => $xml));
報錯
Could not connect to host
SoapFault Object
(
[message:protected] => Could not connect to host
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /www/wwwroot/default/p.php
[line:protected] => 29
[trace:Exception:private] => Array
(
[0] => Array
(
[function] => __doRequest
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] =>
[1] => http://****:80/axis2/services/WS4SZ.WS4SZHttpSoap11Endpoint/
[2] => urn:getDepartInfo
[3] => 1
[4] => 0
)
)
由
struct getDepartInfo { string strXml;}可知,要這樣調用
$client->__soapCall('getDepartInfo', array('strXml' => $xml));
幫我調試一下,聯絡我QQ 我給你檔案。改天請你吃飯
Could not connect to host 無法串連到主機
你在 wsdl 中隱去了目標 url ,這就沒法幫你了
vs2010 的 wsdl 工具產生的方法是
public string getDepartInfo([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string strXml) { object[] results = this.Invoke("getDepartInfo", new object[] { strXml}); return ((string)(results[0])); }可知並沒有搞錯
產生的 url 是
this.Url = "http://***:80/axis2/services/WS4SZ.WS4SZHttpSoap11Endpoint/";
Could not connect to host 無法串連到主機
你在 wsdl 中隱去了目標 url ,這就沒法幫你了
vs2010 的 wsdl 工具產生的方法是
public string getDepartInfo([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string strXml) { object[] results = this.Invoke("getDepartInfo", new object[] { strXml}); return ((string)(results[0])); }可知並沒有搞錯
產生的 url 是
this.Url = "http://***:80/axis2/services/WS4SZ.WS4SZHttpSoap11Endpoint/";
發你簡訊資訊裡,因為這個不能公開
謝謝版主,等對方把連接埠更換成公網IP,我再試試看!
哪天來蘇州的時候搓一頓。