- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
用的是 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
自己搞定了。我靠。痛苦死我了