473,698 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Errors Deserializing Soap Response

Hi guys,

when receiving a soap response posted back from a server i get the
following error when deserializing the soap message. The problem seems
to be with the item-collection of the nightlyrate-Array.

[InvalidCastExce ption: Cannot assign object of type
wsclient.res.ws qa.nightlyrate to an object of type
wsclient.res.ws qa.nightlyrate[].]

Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReader1.Re
ad6_nightlyrate array()

System.Xml.Seri alization.XmlSe rializationRead er.ReadReferenc ingElement(S
tring name, String ns, Boolean elementCanBeTyp e, String& fixupReference)

System.Xml.Seri alization.XmlSe rializationRead er.ReadReferenc ingElement(S
tring name, String ns, String& fixupReference)

[InvalidOperatio nException: There is an error in XML document (1,
3142).]
System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader
xmlReader, String encodingStyle)
System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader
xmlReader)

Generated WSDL-Proxy:

[System.Xml.Seri alization.SoapT ypeAttribute("n ightly-rate-array",
"http://websvc.worldres .com/BookingService" )]
public class nightlyratearra y {
public nightlyrate[] item;
}

[System.Xml.Seri alization.SoapT ypeAttribute("n ightly-rate",
"http://websvc.worldres .com/BookingService" )]
public class nightlyrate {
public System.Double baseRate;
public System.Double tax;
public System.Double extraAdult;
public System.Double extraChild;
}

Corresponding WSDL-Document part:

<xsd:complexTyp e name="nightly-rate">
<xsd:all>
<xsd:element minOccurs="1" maxOccurs="1" name="baseRate"
type="xsd:doubl e"/>
<xsd:element minOccurs="1" maxOccurs="1" name="tax" type="xsd:doubl e"/>
<xsd:element minOccurs="1" maxOccurs="1" name="extraAdul t"
type="xsd:doubl e"/>
<xsd:element minOccurs="1" maxOccurs="1" name="extraChil d"
type="xsd:doubl e"/>
</xsd:all>
</xsd:complexType >
<xsd:complexTyp e name="nightly-rate-array">
<xsd:sequence >
<xsd:element minOccurs="0" maxOccurs="unbo unded" name="item"
nillable="true" type="ns1:night ly-rate"/>
</xsd:sequence>
</xsd:complexType >

Any hints?

Thanks Artur

Nov 11 '05 #1
5 4628
Hi Artur,

DId you call a web service on the server? From the error message, It seems
it return a nightlyrate instead of nightlyrate[]. You may check the web
service with disco.exe to see what type it will return.
Luke
Microsoft Online Partner Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 11 '05 #2
Yes i checked it. From my view the Webservice assumes
like you said an nightrate array. But unfortunatly the
array has only one item in it. May this be the error
why .net is complaining?
-----Original Message-----
Hi Artur,

DId you call a web service on the server? From the error message, It seemsit return a nightlyrate instead of nightlyrate[]. You may check the webservice with disco.exe to see what type it will return.
Luke
Microsoft Online Partner Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers norights.)

.

Nov 11 '05 #3
Hi Artur,

Can you post the WSDL file disco.exe geneated? Itmay give us more
information on this. Additionally, did you add the web refference from the
WSDL file?

Luke
Microsoft Online Partner Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 11 '05 #4
Can you post the WSDL file disco.exe geneated? Itmay
give us more
information on this. Additionally, did you add the web
refference from the
WSDL file?


You can have a look at the WSDL at this URL:

https://wsqa.worldres.com/BookingSer...kingService_ve
r_1.wsdl

Artur

Nov 11 '05 #5
From the WSDL, the return XML data should be like:
...
<nightly-rate-array>
<nightly-rate>
<baseRate>... </baseRate>
<tax>...</tax>
<extraAdult>... </extraAdult>
<extraChild>... </extraChild>
</nightly-rate>
</nightly-rate-array>
...

However, from te error message, it only return from the web service:

<nightly-rate>
<baseRate>... </baseRate>
<tax>...</tax>
<extraAdult>... </extraAdult>
<extraChild>... </extraChild>
</nightly-rate>

Have you check with the XML data actually returned? Which is its actual
value?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 11 '05 #6

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

Similar topics

0
4206
by: bigbinc | last post by:
I have setup a soap machine on linux and similar configuration works properly. on a windows mahcine, I get these erros on the addressbook, samples, any ideas. I am pretty sure my classpaths are setup correctly. using jboss-tomcat engine. This looks like text formatting issues.
0
1443
by: craig | last post by:
Hi, I'm new to all this and having tremendous difficulty trying to deserialize the following: <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header><TransactionID xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0" soap-env:mustUnderstand="1">-1433961100312413552</TransactionID></soap-env:Header><soap-env:Body><SubmitReq
4
6312
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having 2 strings <wsdl:portType name=SecurityLoginService"> <wsdl:operation name="login"> <wsdl:input message="tns:loginRequest" name="loginRequest"/> <wsdl:output message="tns:loginResponse" name="loginResponse"/> </wsdl:operation> </wsdl:portType>
4
7845
by: Christian Wilhelm | last post by:
Hi! I have a Problem understanding the deserialisation of SOAP-Responses. The "normal" way, calling a XML WebService is to use WSDL 1) Send Request 2) Get SOAP-Response 3) With Informations out of WSDL transform the SOAP-Response to an Object. Let us call it "Customer".
1
3291
by: Parag Mahajan | last post by:
Hello, I am getting exception when my .Net client tries to deserialize the response received. The excpetion thrown is: Unhandled Exception: System.InvalidOperationException: There is an error in XML document (3, 82). ---> System.InvalidCastException: Cannot assign object of type System.Xml.XmlNode to an object of type WindowsApplication1.DAFApi.userInfo.
7
5949
by: Railinc | last post by:
Hi... I'm trying to write a web service client and am running into a problem with getting a response back from the server. I know that a full xml message is being returned (thanks to a tcp/ip sniffer) but in VS.NET all I get is a null reference. The server is a java program running on websphere. The provider of the web service has gotten a websphere client and an apache axis client to work correctly, so I don't think it's a problem...
0
1442
by: leslie_tighe | last post by:
Hello, I have a web service that is running in a java server using axis that I want to use from .net. In VS.net 2003 I setup a project with a web reference. Using generated code I am able to invoke the web service. The Soapscape tells me that an xml reponse is coming back and its pasted below, along with the wsdl file. However, the object on the ..net side is not getting populated. Any ideas as to why that may be? I am using...
2
2040
by: Chris | last post by:
Hi, I seem to be having some problems connecting to webservices. I'm running a C# client connected to a Java webservice using GLUE. The difference between the two request and response pairs below is the first contains one item in the request and the second contains two. From what I can see, the only real difference between the two involves the following:
0
2800
by: theonlydavewilliams | last post by:
Hi there I'm hoping there's an easy answer to a (hopefully) not too long-winded issue... I'm building a C# web client using a proxy wsdl.exe'd from a wsdl file and six schemas, each in a different namespace. Some schemas extend complex types in others. When i get a soap:Fault from my test server it could contain a serialized exception object (called fault) from one of two of these schemas (and different namespaces, call them xmlns:b0="ns1" and...
0
8604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
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
8897
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
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.