【发布时间】:2017-10-20 08:02:35
【问题描述】:
我正在编写用于使用 Web 服务的 PHP 代码。我发送请求的链接是:http://79.175.138.93/Gateway.svc?Wsdl
这是链接里面的内容:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="Gateway" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://79.175.138.93/Gateway.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://79.175.138.93/Gateway.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://79.175.138.93/Gateway.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/CPGatewayWebServices"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IGatewayServices_ChargeSubscriberRequest_InputMessage">
<wsdl:part name="parameters" element="tns:ChargeSubscriberRequest"/>
</wsdl:message>
<wsdl:message name="IGatewayServices_ChargeSubscriberRequest_OutputMessage">
<wsdl:part name="parameters" element="tns:ChargeSubscriberRequestResponse"/>
</wsdl:message>
<wsdl:portType name="IGatewayServices">
<wsdl:operation name="ChargeSubscriberRequest">
<wsdl:input wsaw:Action="http://tempuri.org/IGatewayServices/ChargeSubscriberRequest" message="tns:IGatewayServices_ChargeSubscriberRequest_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IGatewayServices/ChargeSubscriberRequestResponse" message="tns:IGatewayServices_ChargeSubscriberRequest_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IGatewayServices" type="tns:IGatewayServices">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ChargeSubscriberRequest">
<soap:operation soapAction="http://tempuri.org/IGatewayServices/ChargeSubscriberRequest" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Gateway">
<wsdl:port name="BasicHttpBinding_IGatewayServices" binding="tns:BasicHttpBinding_IGatewayServices">
<soap:address location="http://79.175.138.93/Gateway.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
如您所见,我的 xml 中有一个已导入的 xsd 元素:
<xsd:import schemaLocation="http://79.175.138.93/Gateway.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
我的目的是向我提到的链接发送一些请求,然后 xml 代码应该自动将我的请求发送到这个 xsd 标记,然后包含另一个 xml 文件(在http://79.175.138.93/Gateway.svc?xsd=xsd0 中)的 xsd 应该给我一些信息。
这是我的问题! PHP 代码无法识别 xsd 标记,因此没有任何反馈,但是当我使用“SoapUI”时它可以工作。
我该怎么办?如何通过 PHP 将我的信息发送到导入的 xsd 中的 xml?
【问题讨论】:
标签: php xml web-services xsd