C# SOAP:PHP WebService和.Net
我必须从.Net(C#,WPF)应用程序通过SOAP连接PHP Web服务。我添加了对该服务的引用,生成了一些代理 当我调用某个函数时:C# SOAP:PHP WebService和.Net,c#,.net,php,web-services,soap,C#,.net,Php,Web Services,Soap,我必须从.Net(C#,WPF)应用程序通过SOAP连接PHP Web服务。我添加了对该服务的引用,生成了一些代理 当我调用某个函数时: var client = new someAPIPortTypeClient(); XmlNode[] response = client.status(arg1, arg2); 我得到的答复是: 你是活跃的吗 真的 允许添加付费 假的 允许免费搜索 真的 允许\u添加\u免费 真的 它的解释类似于XmlNode[] 如何让普通代理类使用此SOA
var client = new someAPIPortTypeClient();
XmlNode[] response = client.status(arg1, arg2);
我得到的答复是:
你是活跃的吗
真的
允许添加付费
假的
允许免费搜索
真的
允许\u添加\u免费
真的
它的解释类似于XmlNode[]
如何让普通代理类使用此SOAP服务?如果需要,我可以要求服务作者更改某些内容
更新。状态函数的WSDL
<?xml version='1.0' encoding='UTF-8'?>
<definitions name="something" targetNamespace="urn:something" xmlns:typens="urn:something" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="status">
<part name="terminal" type="xsd:integer"/>
<part name="code" type="xsd:string"/>
</message>
<message name="statusResponse">
<part name="statusReturn" type="xsd:anyType"/>
</message>
<portType name="someAPIPortType">
<operation name="status">
<documentation>
Get status
</documentation>
<input message="typens:status"/>
<output message="typens:statusResponse"/>
</operation>
</portType>
<binding name="someAPIBinding" type="typens:someAPIPortType">
<operation name="status">
<soap:operation soapAction="urn:someAPIAction"/>
<input>
<soap:body namespace="urn:something" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:something" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="somethingService">
<port name="someAPIPort" binding="typens:someAPIBinding">
<soap:address location="http://something/soap/"/>
</port>
</service>
</definitions>
获得地位
长话短说,如果你想让事情按照你想要的方式运行,你必须定义一个合适的WSDLXSD\u ANY
只是自找麻烦。wsdl看起来“好”吗?我敢打赌wsdl有xsd:any之类的东西。。。如果另一端的人不知道如何“修复”他们提供给您的wsdl,您可能只需要编写自己的wsdl……我认为,您是对的,thx。我在问题文本中添加了一个WSDL文件片段。你知道如何以最好(或/和最简单)的方式修复它吗?这是我第一次使用肥皂。是的,我已经理解了这一点。例如,我可以在MS Visual Studio中创建SOAP服务,并在php服务中使用生成的WSDL文件。。。这是最简单的解决方案之一)。