Ben bir. Net (C #, WPF) uygulaması soap üzerinden PHP WebService ile bağlamak zorunda. Ben bu hizmet için başvuru, bazı vekiller oluşturulan edildi ekledi.
Ben bazı işlevi çağrıldığında:
var client = new someAPIPortTypeClient();
XmlNode[] response = client.status(arg1, arg2);
Ben yanıt aldım:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:nakopitel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:statusResponse>
<statusReturn xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">is_active</key>
<value xsi:type="xsd:boolean">true</value>
</item>
<item>
<key xsi:type="xsd:string">allow_add_paid</key>
<value xsi:type="xsd:boolean">false</value>
</item>
<item>
<key xsi:type="xsd:string">allow_search_free</key>
<value xsi:type="xsd:boolean">true</value>
</item>
<item>
<key xsi:type="xsd:string">allow_add_free</key>
<value xsi:type="xsd:boolean">true</value>
</item>
</statusReturn>
</ns1:statusResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Bu XmlNode[]
gibi yorumlanır ...
Nasıl bu SOAP-hizmet ile çalışmak normal proxy sınıfları alabilirim? Ben bir şey gerektirir değiştirmek için servis yazar sorabilirsiniz.
Güncelleyin. Durumu fonksiyonu için 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>