473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Trouble with complex return types

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
Jan 2 '08 #1
1 1587
<se**************@gmail.comwrote in message
news:3d**********************************@u10g2000 prn.googlegroups.com...
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>
--------------------------
Please post a small WSDL that reproduces the problem. Also, please post the
entire exception, including any inner exceptions.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Jan 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
0
by: Demetri | last post by:
I have 2 web services. Web service "Main" and a Web Service "Proxy". I also have a shared libary of complex types. The "Proxy" web service simply calles methods of the "Main" web service. When...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
17
by: Chris Travers | last post by:
Hi all; I just made an interesting discovery. Not sure if it is a good thing or not, and using it certainly breakes first normal form.... Not even sure if it really works. However, as I am...
2
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
12
by: vj | last post by:
Hi! I have a piece of code (shown below) involving complex numbers. The code is not running and giving error ("Invalid floating point operation" and "SQRT:Domain error"). I would be very...
2
by: Arvid Requate | last post by:
Hello, I'd like to understand why the following code does not compile. It looks like a strangeness in connection with overload resolution for the <complex> header: The conversion operator...
1
by: yucikala | last post by:
Hello, I'm a "expert of beginner" in C#. I have a dll - in C. And in this dll is this struct: typedef struct msg_s { /* please make duplicates of strings before next call to emi_read() ! */ ...
11
by: jacob navia | last post by:
hi I am trying to use the complex data type. Consider this code, taken from the cclib library: struct complex csqrt(Cpx z) { double r; r=sqrt(z.re*z.re+z.im*z.im);...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.