欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

请教一个soap的问题。在线等。谢谢

程序员文章站 2022-06-17 12:11:28
...
   -  -  - - - - - - - - - - - - - - - - - - - - - - -  -  -    -    -  -    -    -  -    -    -  -    -    -  -    -    -  -    -    - - 







用的是 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

自己搞定了。我靠。痛苦死我了