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

WBOY
풀어 주다: 2016-06-23 14:27:03
원래의
952명이 탐색했습니다.

  <?xml version="1.0" encoding="UTF-8" ?> - <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.7-b01-.   --> - <!--  Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.7-b01-.   --> - <definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://XXXXX/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://XXXXX/" name="Service4business">- <types>- <xsd:schema>  <xsd:import namespace="http://XXXXX/" schemaLocation="http://XXXXX:18080/aaa/Business/XXXXXService?xsd=1" />   </xsd:schema>  </types>- <message name="queryUserInfo">  <part name="parameters" element="tns:queryUserInfo" />   </message>- <message name="queryUserInfoResponse">  <part name="parameters" element="tns:queryUserInfoResponse" />   </message>- <message name="queryGroupInfo">  <part name="parameters" element="tns:queryGroupInfo" />   </message>- <message name="queryGroupInfoResponse">  <part name="parameters" element="tns:queryGroupInfoResponse" />   </message>- <message name="authProduct">  <part name="parameters" element="tns:authProduct" />   </message>- <message name="authProductResponse">  <part name="parameters" element="tns:authProductResponse" />   </message>- <message name="authUser">  <part name="parameters" element="tns:authUser" />   </message>- <message name="authUserResponse">  <part name="parameters" element="tns:authUserResponse" />   </message>- <message name="registerIMS">  <part name="parameters" element="tns:registerIMS" />   </message>- <message name="registerIMSResponse">  <part name="parameters" element="tns:registerIMSResponse" />   </message>- <message name="authIMS">  <part name="parameters" element="tns:authIMS" />   </message>- <message name="authIMSResponse">  <part name="parameters" element="tns:authIMSResponse" />   </message>- <portType name="CoshipService4Business">- <operation name="queryUserInfo">  <input message="tns:queryUserInfo" />   <output message="tns:queryUserInfoResponse" />   </operation>- <operation name="queryGroupInfo">  <input message="tns:queryGroupInfo" />   <output message="tns:queryGroupInfoResponse" />   </operation>- <operation name="authProduct">  <input message="tns:authProduct" />   <output message="tns:authProductResponse" />   </operation>- <operation name="authUser">  <input message="tns:authUser" />   <output message="tns:authUserResponse" />   </operation>- <operation name="registerIMS">  <input message="tns:registerIMS" />   <output message="tns:registerIMSResponse" />   </operation>- <operation name="authIMS">  <input message="tns:authIMS" />   <output message="tns:authIMSResponse" />   </operation>  </portType>- <binding name="CoshipService4BusinessPortBinding" type="tns:CoshipService4Business">  <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> - <operation name="queryUserInfo">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>- <operation name="queryGroupInfo">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>- <operation name="authProduct">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>- <operation name="authUser">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>- <operation name="registerIMS">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>- <operation name="authIMS">  <soap12:operation soapAction="" /> - <input>  <soap12:body use="literal" />   </input>- <output>  <soap12:body use="literal" />   </output>  </operation>  </binding>- <service name="Service4business">- <port name="CoshipService4BusinessPort" binding="tns:CoshipService4BusinessPortBinding">  <soap12:address location="http://XXXXX" />   </port>  </service>  </definitions>
로그인 후 복사







用的是 nusoap
我只要 'authProduct' 去调用一下就可以
$sendurl='http://10.10.10.10:18080/aaa/Business/Service?wsdl';		$client = new soapclient($sendurl, true);		//查看一下是不是报错  		$err = $client->getError();  		if ($err) {  		 //显示错误  编码		 echo '<h2>Constructor error</h2><pre class="brush:php;toolbar:false">' . $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

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

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿