header('Content-Type:text/html;charset=utf-8');
$client = new SoapClient("https://pmistest-bnk.safe/bsoappre/bankIn?wsdl"); $parameters = "
<?xml version='1.0' encoding='GBK'?>
<MSG>
<HEAD>
<VER>2014</VER>
<COMMON_ORG_TYPE>2</COMMON_ORG_TYPE>
<SRC>xxxx</SRC>
<DES>100000</DES>
<SRCAPP>CORPMIS</SRCAPP>
<DESAPP>PMIS</DESAPP>
<SENDTIME>".date("Y-m-d H:i:s")."</SENDTIME>
<COMMON_ORG_CODE>xxxxxxxxxxx</COMMON_ORG_CODE>
<COMMON_USER_CODE>201650201</COMMON_USER_CODE>
<PASSWORD>".md5("xxxxxxxxxt")."</PASSWORD>
<SERVICEPATH>InfoQueryService.doQuerySafeExRate</SERVICEPATH>
<MSGNO>xxxxxxxxxxxxxxxxxx</MSGNO>
</HEAD>
<BODY>
<DATASTORES>
<DS>
<PAGESIZE>2</PAGESIZE>
<PAGENUMBER>1</PAGENUMBER>
<PARAMETERS>
<CURRENCY_CODE>CAD</CURRENCY_CODE>
<YEAR_MONTH>201606</YEAR_MONTH>
</PARAMETERS>
</DS>
</DATASTORES>
</BODY>
</MSG>"; //报文print_r($client->__getFunctions()); //可以获取到上面地址WSDL的数据
print_r($client->__getTypes()); //可以获取到上面地址WSDL的数据
try {
$result = $client->__soapCall('messageIn',array('request' => $parameters)); //调用方法
var_dump($result);
}catch (SoapFault $sf){
echo $sf->getMessage(); //捕抓错误
// var_dump($sf); //具体显示错误
}
网页显示为:Array
(
[0] => messageInResponse messageIn(messageIn $parameters)
[1] => exchangeKeyResponse exchangeKey(exchangeKey $parameters)
[2] => messageInResponse messageIn(messageIn $parameters)
[3] => exchangeKeyResponse exchangeKey(exchangeKey $parameters)
)
Array
(
[0] => struct SOAException {
string SOAErrorCode;
int errorCode;
}
[1] => struct Exception {
anyType Exception;
}
[2] => struct SOAException {
SOAException SOAException;
}
[3] => struct messageIn {
string request;
}
[4] => struct messageInResponse {
string return;
}
[5] => struct exchangeKey {
string request;
}
[6] => struct exchangeKeyResponse {
string return;
}
)
Not Found捕抓到错误为:Not Found 能获取到WSDL文件的内容,就是我发送报文请求时出错,是否调用messageIn的方法错误??
解决方案 »
- phpmyadmin导入sql时出错?
- PHP的httpd.ini的Rewrite问题
- CSDN论坛为什么不支持两个单词以上的搜索???
- dedecms 采集不到flash
- 新手求助
- 关于PHP在windows环境下安装扩展的问题
- 一个很简单的留言板程序
- Apache配置时出错,新手求救啊!!!
- DEDECMS信息分类里如何按某个新添加字段里显示列表,或实现按字母检索
- WinRar 如何使用命令实现 文件名加密
- 基于 Laravel 5.2 开发的一个 bbs,参考 V2EX, PHPHub 和 Ruby China
- 请高手帮忙解密一下$O00OO0 = urldecode( 希望能提供一下解密方法
- <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://com.res.ws/xsd" xmlns:ns="http://bankin.ws.soa.res.com" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax23="http://message.soa.res.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://bankin.ws.soa.res.com">
<wsdl:documentation>bankIn</wsdl:documentation>
- <wsdl:types>
- <xs:schema xmlns:ax24="http://bankin.ws.soa.res.com" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://message.soa.res.com/xsd">
<xs:import namespace="http://bankin.ws.soa.res.com" />
+ <xs:complexType name="SOAException">
- <xs:complexContent>
- <xs:extension base="ax24:Exception">
- <xs:sequence>
<xs:element minOccurs="0" name="SOAErrorCode" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="errorCode" type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax25="http://message.soa.res.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://bankin.ws.soa.res.com">
<xs:import namespace="http://message.soa.res.com/xsd" />
- <xs:complexType name="Exception">
- <xs:sequence>
<xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
- <xs:element name="SOAException">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="SOAException" nillable="true" type="ax23:SOAException" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="messageIn">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="request" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="messageInResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="exchangeKey">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="request" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="exchangeKeyResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
- <wsdl:message name="messageInRequest">
<wsdl:part name="parameters" element="ns:messageIn" />
</wsdl:message>
- <wsdl:message name="messageInResponse">
<wsdl:part name="parameters" element="ns:messageInResponse" />
</wsdl:message>
- <wsdl:message name="SOAException">
<wsdl:part name="parameters" element="ns:SOAException" />
</wsdl:message>
- <wsdl:message name="exchangeKeyRequest">
<wsdl:part name="parameters" element="ns:exchangeKey" />
</wsdl:message>
- <wsdl:message name="exchangeKeyResponse">
<wsdl:part name="parameters" element="ns:exchangeKeyResponse" />
</wsdl:message>
- <wsdl:portType name="bankInPortType">
- <wsdl:operation name="messageIn">
<wsdl:input message="ns:messageInRequest" wsaw:Action="urn:messageIn" />
<wsdl:output message="ns:messageInResponse" wsaw:Action="urn:messageInResponse" />
<wsdl:fault message="ns:SOAException" name="SOAException" wsaw:Action="urn:messageInSOAException" />
</wsdl:operation>
- <wsdl:operation name="exchangeKey">
<wsdl:input message="ns:exchangeKeyRequest" wsaw:Action="urn:exchangeKey" />
<wsdl:output message="ns:exchangeKeyResponse" wsaw:Action="urn:exchangeKeyResponse" />
<wsdl:fault message="ns:SOAException" name="SOAException" wsaw:Action="urn:exchangeKeySOAException" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="bankInSoap11Binding" type="ns:bankInPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="messageIn">
<soap:operation soapAction="urn:messageIn" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
- <wsdl:fault name="SOAException">
<soap:fault use="literal" name="SOAException" />
</wsdl:fault>
</wsdl:operation>
- <wsdl:operation name="exchangeKey">
<soap:operation soapAction="urn:exchangeKey" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
- <wsdl:fault name="SOAException">
<soap:fault use="literal" name="SOAException" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="bankInSoap12Binding" type="ns:bankInPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="messageIn">
<soap12:operation soapAction="urn:messageIn" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
- <wsdl:fault name="SOAException">
<soap12:fault use="literal" name="SOAException" />
</wsdl:fault>
</wsdl:operation>
- <wsdl:operation name="exchangeKey">
<soap12:operation soapAction="urn:exchangeKey" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
- <wsdl:fault name="SOAException">
<soap12:fault use="literal" name="SOAException" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="bankInHttpBinding" type="ns:bankInPortType">
<http:binding verb="POST" />
- <wsdl:operation name="messageIn">
<http:operation location="bankIn/messageIn" />
- <wsdl:input>
<mime:content type="text/xml" part="messageIn" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" part="messageIn" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="exchangeKey">
<http:operation location="bankIn/exchangeKey" />
- <wsdl:input>
<mime:content type="text/xml" part="exchangeKey" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" part="exchangeKey" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="bankIn">
- <wsdl:port name="bankInHttpSoap11Endpoint" binding="ns:bankInSoap11Binding">
<soap:address location="http://pmistest-bnk.safe:80/bsoappre/bankIn.bankInHttpSoap11Endpoint/" />
</wsdl:port>
- <wsdl:port name="bankInHttpSoap12Endpoint" binding="ns:bankInSoap12Binding">
<soap12:address location="http://pmistest-bnk.safe:80/bsoappre/bankIn.bankInHttpSoap12Endpoint/" />
</wsdl:port>
- <wsdl:port name="bankInHttpEndpoint" binding="ns:bankInHttpBinding">
<http:address location="http://pmistest-bnk.safe:80/bsoappre/bankIn.bankInHttpEndpoint/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>附上WSDL文件