Q: Webservice (SOAP) Problem

I've got an problem with calling a webfunction that returns an 2 dimensional array.
I tried it with an proxy class (made with wsdl.exe) and with an webreference.
I think that C# has a problem with the data type or the SOAP message not good is.

Here is the function in the proxy class.
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:XpertSelectServiceAction", RequestNamespace="urn:xs.wsdl", ResponseNamespace="urn:xs.wsdl")]

[return: System.Xml.Serialization.SoapElementAttribute("getDocumentGroupsReturn")]

publicobject getDocumentGroups(string strUsername1) {

object[] results =this.Invoke("getDocumentGroups",newobject[] {

strUsername1});

return ((object)(results[0]));

}

This is the response SOAP message.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:xs.wsdl" xmlns:ns2="http://xml.apache.org/xml-soap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getDocumentGroupsResponse>
<getDocumentGroupsReturn SOAP-ENC:arrayType="ns2:Map[7]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">vch_name</key>
<value xsi:type="xsd:string">OKZ</value>
</item>
<item>
<key xsi:type="xsd:string">int_docgroupid</key>
<value xsi:type="xsd:string">37</value>
</item>
</item>
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">vch_name</key>
<value xsi:type="xsd:string">Arrangementen</value>
</item>
<item>
<key xsi:type="xsd:string">int_docgroupid</key>
<value xsi:type="xsd:string">38</value>
</item>
</item>
</getDocumentGroupsReturn></ns1:getDocumentGroupsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

I don"t have this problem wih another function on the same webservice that returns an boolean.
The webservice is made in PHP and it runs on an apache webservice.

[4234 byte] By [Hkrabben] at [2007-12-24]
# 1

Hi,

i'm having the similar problem with consuming a php webservice.
Posted here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1242378&SiteID=1

I'm also having no problems receiving the simple types, like sMessage (string) or bResult (boolean). But there is a complex type in the response with the fields "key" and "value". This seems to be a hashtable type in .NET, but there is no automatic deserialisation of a hashtable type in a SOAP response.

Have you solved the problem? Or has someone else ever solved such a problem?

Help would be appreciated!

Best regards!
Gregor

GregDuck at 2007-8-31 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...

.NET Development

Site Classified