473,765 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Serv ices.Protocols. SoapRpcMethodAt tribute("",
RequestNamespac e="http://temp.de/aPOTs", ResponseNamespa ce="http://
temp.de/aPOTs")]
[return:
System.Xml.Seri alization.SoapE lementAttribute ("makePDFReturn ")]
public RetDataType makePDF(string type, string result,
[System.Xml.Seri alization.SoapE lementAttribute (DataType="base 64Binary")]
byte[] data) {
object[] results = this.Invoke("ma kePDF", new object[] {
type,
result,
data}); // THROWS EXCEPTION!
return (RetDataType)(r esults[0]);
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("wsdl",
"2.0.50727. 42")]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.SoapT ypeAttribute(Na mespace="http://temp.de/
aPOTs")]
public partial class RetDataType {

private string refidField;
private System.Nullable <inteetField;

/// <remarks/>
[System.Xml.Seri alization.SoapE lementAttribute (IsNullable=tru e)]
public string refid {
get { return this.refidField ; }
set { this.refidField = value; }
}

/// <remarks/>
[System.Xml.Seri alization.SoapE lementAttribute (IsNullable=tru e)]
public System.Nullable <inteet {
get { return this.eetField; }
set { this.eetField = value; }
}
}
------------------------

Captured SOAP-Response:
-----------------------
<soap:Envelop e xmlns:soap="htt p://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:encodingSt yle="http://
schemas.xmlsoap .org/soap/encoding/">
<soap:Body>
<makePDFRespons e xmlns="http://temp.de/aPOTs">
<refid xsi:type="xsd:s tring">qAmkBf5O xL.1199270773</refid>
<eet xsi:type="xsd:i nt">5</eet>
</makePDFResponse >
</soap:Body>
</soap:Envelope>
--------------------------

Best regards,
Sebastian
Jan 2 '08 #1
1 1608
<se************ **@gmail.comwro te in message
news:3d******** *************** ***********@u10 g2000prn.google groups.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.Serv ices.Protocols. SoapRpcMethodAt tribute("",
RequestNamespac e="http://temp.de/aPOTs", ResponseNamespa ce="http://
temp.de/aPOTs")]
[return:
System.Xml.Seri alization.SoapE lementAttribute ("makePDFReturn ")]
public RetDataType makePDF(string type, string result,
[System.Xml.Seri alization.SoapE lementAttribute (DataType="base 64Binary")]
byte[] data) {
object[] results = this.Invoke("ma kePDF", new object[] {
type,
result,
data}); // THROWS EXCEPTION!
return (RetDataType)(r esults[0]);
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("wsdl",
"2.0.50727. 42")]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.SoapT ypeAttribute(Na mespace="http://temp.de/
aPOTs")]
public partial class RetDataType {

private string refidField;
private System.Nullable <inteetField;

/// <remarks/>
[System.Xml.Seri alization.SoapE lementAttribute (IsNullable=tru e)]
public string refid {
get { return this.refidField ; }
set { this.refidField = value; }
}

/// <remarks/>
[System.Xml.Seri alization.SoapE lementAttribute (IsNullable=tru e)]
public System.Nullable <inteet {
get { return this.eetField; }
set { this.eetField = value; }
}
}
------------------------

Captured SOAP-Response:
-----------------------
<soap:Envelop e xmlns:soap="htt p://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:encodingSt yle="http://
schemas.xmlsoap .org/soap/encoding/">
<soap:Body>
<makePDFRespons e xmlns="http://temp.de/aPOTs">
<refid xsi:type="xsd:s tring">qAmkBf5O xL.1199270773</refid>
<eet xsi:type="xsd:i nt">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
32083
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 complex type: <s:complexContent><s:restriction base="SOAP-ENC:Array"><s:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string"/></s:complexContent> Actual Output :
0
1004
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 I invoke a method in the "Main" web service directly it returns an xml document that lists all the "type" information of each element and they appear to be correctly reflecting my complex type. However, when I invoke the "Main" web service...
2
9093
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 other declaration. An error occurred at , (11, 3). Schema compile error: System.Exception: Schema error ---> System.Xml.Schema.XmlSchemaException: May no
17
3168
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 able to CRASH the backend, there is a bug here somewhere... test=# select version(); version
2
4840
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. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In order to indicate if a property should be serialized you can include a boolean function named...
12
2767
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 thankful if someone can tell me where is the problem. I am aware that my code is far from being efficient and organized, and also there are many extra #include statements not really required for the code. I am a novice programmer, as you can see ! At...
2
9790
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 double() of class B is called for the member complex::operator*=(double) as expected, but not for operator*(complex, double). The effect is, that the template matching (or overload resolution)
1
2145
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() ! */ int op_type; /* of "op_t" type: operation type; submit (>0), response (<0) */
11
2429
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); r=sqrt(ldexp(r+fabs(z.re),-1));
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10161
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9955
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.