- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
用的是 nusoap
我只要 'authProduct' 去調用一下就可以
$sendurl='http://10.10.10.10:18080/aaa/Business/Service?wsdl';$client = new soapclient($sendurl, true);//查看一下是不是報錯 $err = $client->getError(); if ($err) { //顯示錯誤 編碼 echo 'Constructor error
' . $err . '
'; } $client->soap_defencoding = 'utf-8';$client->decode_utf8 = false;$client->xml_encoding = 'utf-8';$param = array('AMSP_Auth_Prod'=>array('userCode'=>'1212','tvCode'=>'2848','productCode'=>'80060','spCode'=>'SP1N','resourceCode'=>'','authType'=>0));dump($param);$result = $client->call('authProduct', $param);dump($client->request);if (!$err=$client->getError()) { echo " ddd :",htmlentities($str,ENT_QUOTES); } else { echo " er :",htmlentities($err,ENT_QUOTES); }
產生的xml
080060SP1N28481212
在soapui裡面可以的。但是程式報錯
er :HTTP Error: Unsupported HTTP response status 415 Unsupported Media Type (soapclient->response has contents of the response)
回複討論(解決方案)
線上等。自己up一下
標頭檔
string(860) "POST /aaa/Business/Service HTTP/1.0
Host: 172.31.178.4:18080
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 679
自己搞定了。我靠。痛苦死我了