HI there!
I am trying to consume a web service implemented in Perl (SOAP::Lite)
using VS Express 2008. I already implemented a client in java without
problems.
I succeeded in calling the web service, but the SOAP-Call returns a
complex type which is not handled correctly.
Invoke() throws an exception stating that an object of type
system.String can not be assigned to type RetDataType. Debugging shows
that the deserializer seems to handle the first return variable only
(string), ignoring the second (int), completely unaware of the complex
return type.
I would be glad if anybody could give me a hint.
Excerpt from WSDL-proxy:
-------------------
/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodAttribu te("",
RequestNamespace="http://temp.de/aPOTs", ResponseNamespace="http://
temp.de/aPOTs")]
[return:
System.Xml.Serialization.SoapElementAttribute("mak ePDFReturn")]
public RetDataType makePDF(string type, string result,
[System.Xml.Serialization.SoapElementAttribute(Data Type="base64Binary")]
byte[] data) {
object[] results = this.Invoke("makePDF", new object[] {
type,
result,
data}); // THROWS EXCEPTION!
return (RetDataType)(results[0]);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.SoapTypeAttribute(Namespa ce="http://temp.de/
aPOTs")]
public partial class RetDataType {
private string refidField;
private System.Nullable<inteetField;
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNu llable=true)]
public string refid {
get { return this.refidField; }
set { this.refidField = value; }
}
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNu llable=true)]
public System.Nullable<inteet {
get { return this.eetField; }
set { this.eetField = value; }
}
}
------------------------
Captured SOAP-Response:
-----------------------
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" soap:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<makePDFResponse xmlns="http://temp.de/aPOTs">
<refid xsi:type="xsd:string">qAmkBf5OxL.1199270773</refid>
<eet xsi:type="xsd:int">5</eet>
</makePDFResponse>
</soap:Body>
</soap:Envelope>
--------------------------
Best regards,
Sebastian