Problems with SOAP::LITE SOAP Response

Paul Johansen <[email protected]> Tue, 10 Aug 2004 14:48:14 -0500
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <4D52CA31755F4841902BCB199084A54B2561D3@mwmktomail02.midwestwireless.com>
Hi all,

=20

I am encountering some issues when trying to call a Perl SOAP::LITE Web
service using a .NET (C#) proxy class. The actual calling of the service
works fine, it is translating the response that is the issue. The
response is defined as below in the WSDL:

=20

<xsd:element name=3D"validateuserResponse">

<xsd:complexType>

                        <xsd:sequence>

                                    <xsd:element minOccurs=3D"0"
maxOccurs=3D"1" name=3D"status" type=3D"xsd:int"/>

                                    <xsd:element minOccurs=3D"0"
maxOccurs=3D"1" name=3D"message" type=3D"xsd:string"/>

                        </xsd:sequence>

            </xsd:complexType>

</xsd:element>

=20

What is returned by the Web service for those same parameter names
appears to be a generated thing that can't be changed in SOAP::LITE:

=20

<SOAP-ENV:Body>

                        <validateuserResponse xmlns=3D"http://myns/API">

                                    <s-gensym3
xsi:type=3D"xsd:int">2</s-gensym3>

                                    <s-gensym5
xsi:type=3D"xsd:string">Failed|User does not exist</s-gensym5>

                        </validateuserResponse>

</SOAP-ENV:Body>

=20

The method from the .NET proxy class actually returns just fine, except
that none of the output parameters are actually populated. If I
intercept the SOAP response before it gets back to .NET and manually
edit it (changing "s-gensym3" and "s-gensym5" to "status" and "message")
and send it on, it works just fine.

=20

Are there any attributes I could add to the "out" parameters in the
proxy class method that could "map" the generated names in the response
to the declared names in the WSDL? Or possibly a different solution?

=20

The generated proxy class method is as follows:

=20

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://myns/
API#validateuser",=20

RequestNamespace=3D"http://myns/API",=20

ResponseNamespace=3D"http://myns/API",=20

Use=3DSystem.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=3DSystem.Web.Services.Protocols.SoapParameterStyle.Wrapped=
)
]

=20

public void validateuser(string loginName, string domain, string
password, out int status,
[System.Xml.Serialization.XmlIgnoreAttribute()] out bool
statusSpecified, out string message) {

            object[] results =3D this.Invoke("validateuser", new =
object[]
{

                        loginName,

                        domain,

                        password});

            status =3D ((int)(results[0]));

            statusSpecified =3D ((bool)(results[1]));

            message =3D ((string)(results[2]));

=20

Thanks in advance!

=20

Paul

=20

=20

=20