Ahoj, tak se mi povedlo rozchodit webovou službu server-klient v PHP pomocí SOAP s využitím WSDL, ale problém mi nastává když chci webovou službu využít v C#. Ve VS2008 přídám WS pomocí Add new webservice, to proběhne vše OK, ale jakmile chci metody volat v kódu tak tam vůbec nejsou.
WSDL soubor jsem spáchal takto:
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions
xmlns:class1Ns='http://cms/soap'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='pow2Request'>
<part name='number' type='xsd:float'/>
</message>
<message name='pow2Response'>
<part name='result' type='xsd:float'/>
</message>
<message name='pow3Request'>
<part name='number' type='xsd:float'/>
</message>
<message name='pow3Response'>
<part name='result' type='xsd:float'/>
</message>
<message name='pow4Request'>
<part name='number' type='xsd:float'/>
</message>
<message name='pow4Response'>
<part name='result' type='xsd:float'/>
</message>
<portType name='Class1PortType'>
<operation name='pow2'>
<input message='class1Ns:pow2Request'/>
<output message='class1Ns:pow2Response'/>
</operation>
<operation name='pow3'>
<input message='class1Ns:pow3Request'/>
<output message='class1Ns:pow3Response'/>
</operation>
<operation name='pow4'>
<input message='class1Ns:pow4Request'/>
<output message='class1Ns:pow4Response'/>
</operation>
</portType>
<binding name='Class1Binding' type='class1Ns:Class1PortType'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='pow2'>
<soap:operation soapAction='urn:pow2'/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>
<operation name='pow3'>
<soap:operation soapAction='urn:pow3'/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>
<operation name='pow4'>
<soap:operation soapAction='urn:pow4'/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>
</binding>
<service name='Class1'>
<port name='Class1Port' binding='class1Ns:Class1Binding'>
<soap:address location='http://cms/soap/server.php'/>
<soap:address location='http://cms/soap/server.php'/>
</port>
</service>
</definitions>
Ve VS proběhne přidání taky OK:
- [IMG]http://sdilej.net/pics/f20429dd0541ee265fc6c8fcdbb733a8.PNG[/IMG]
- [IMG]http://sdilej.net/pics/dc996fdc103ceaf482091031afb46bfb.PNG[/IMG]
Kde můžu mít chybu? Děkuji