T
Thomas Mueller
Hi,
I'm currently working on C# code consuming a PHP-webservice
(soapserver-class of PHP5). A PHP test-client worked fine and achieved
the requested data from the service's server.
Using the wsdl-file of the webservice, wsdl.exe generated a C#-proxy
class errorlessly. I then tried to instantiate the proxy class to access
the service:
waClient.waService was = new waClient.waService();
waClient.tCourseDescription cd = was.getCourseByKey("12345");
It compiles without errors or warnings but after calling the
getCourseByKey-methode, it throughs an exception, reporting that the
given type is unknown:
(Name=map, Namespace=Namespace='http://xml.apache.org/xml-soap', at
<courseDescription xmlns=''>
Using a traffic sniffer, I found out, that the php webservice-server
sends the following response to the C# client instance:
###
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:course"
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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getCourseByKeyResponse>
<courseDescription xsi:type="ns2:map">
<item>
<key xsi:type="xsd:string">language</key>
<value xsi:type="xsd:string">de</value>
</item>
[..]
</courseDescription>
</ns1:getCourseByKeyResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
###
C# seems not to be able to deserialize the map-element of the apache.org
namespace. What can I do get the respons data?
Is it possible to get the plain xml-response in C# (to deserialize it
manually to the target object)? How?
Thanks a lot for any hint!
Thomas
I'm currently working on C# code consuming a PHP-webservice
(soapserver-class of PHP5). A PHP test-client worked fine and achieved
the requested data from the service's server.
Using the wsdl-file of the webservice, wsdl.exe generated a C#-proxy
class errorlessly. I then tried to instantiate the proxy class to access
the service:
waClient.waService was = new waClient.waService();
waClient.tCourseDescription cd = was.getCourseByKey("12345");
It compiles without errors or warnings but after calling the
getCourseByKey-methode, it throughs an exception, reporting that the
given type is unknown:
(Name=map, Namespace=Namespace='http://xml.apache.org/xml-soap', at
<courseDescription xmlns=''>
Using a traffic sniffer, I found out, that the php webservice-server
sends the following response to the C# client instance:
###
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:course"
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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getCourseByKeyResponse>
<courseDescription xsi:type="ns2:map">
<item>
<key xsi:type="xsd:string">language</key>
<value xsi:type="xsd:string">de</value>
</item>
[..]
</courseDescription>
</ns1:getCourseByKeyResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
###
C# seems not to be able to deserialize the map-element of the apache.org
namespace. What can I do get the respons data?
Is it possible to get the plain xml-response in C# (to deserialize it
manually to the target object)? How?
Thanks a lot for any hint!
Thomas