473,659 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deserialization Error in VS 2005

I have a vendor web service that I have created a web application to
interact with. The service works fine in VS 2003 but fails in VS 2005. I
have implemented a proxy between the web client and web service to capture
the soap calls and both the request and response are identical. The problem
occurs in VS 2005 when the .net runtime attempts to de-serialize the soap
response into the custom type defined in the wsdl. The exact error message
is

Unable to cast object of type 'System.Xml.Xml Text' to type
'System.Xml.Xml Element'.

Stack Trace:

[InvalidCastExce ption: Unable to cast object of type 'System.Xml.Xml Text' to
type 'System.Xml.Xml Element'.]
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReaderPRISMAP I.Read2_Contact DTO(Boolean
isNullable, Boolean checkType) +5470
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReaderPRISMAP I.Read30_Contac tNewResponse()
+439
Microsoft.Xml.S erialization.Ge neratedAssembly .ArrayOfObjectS erializer25.Des erialize(XmlSer ializationReade r
reader) +63
System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader xmlReader,
String encodingStyle, XmlDeserializat ionEvents events) +336

[InvalidOperatio nException: There is an error in XML document (1, 685).]
System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader xmlReader,
String encodingStyle, XmlDeserializat ionEvents events) +781
System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader xmlReader,
String encodingStyle) +53
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
+2551
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters) +292
PrismAPI.PRISMA PI.ContactNew() in
c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary ASP.NET
Files\webui\bcb 854b3\dc118bff\ App_WebReferenc es.cacsndbj.0.c s:443
_Default.Page_L oad(Object sender, EventArgs e) in
d:\work\<snip>\ WebPortalVS\tru nk\src\WebUI\De fault.aspx.cs:2 0
System.Web.Util .CalliHelper.Ev entArgFunctionC aller(IntPtr fp, Object o,
Object t, EventArgs e) +31
System.Web.Util .CalliEventHand lerDelegateProx y.Callback(Obje ct sender,
EventArgs e) +68
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +88
System.Web.UI.C ontrol.LoadRecu rsive() +74
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +3035

Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET
Version:2.0.507 27.42

My first thought was to look at the type definitions generated when I set
the web reference in VS 2005, but it appears from the stack trace that this
is not available in the IDE at design time as it is dynamically compiled.
How can I see the Xml serialization attributes that were applied when the
web reference was set?

Any help is most appreciated.

Nov 23 '05 #1
0 2899

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

Similar topics

2
2357
by: Serg | last post by:
Hi. I have a problem with deserialization decimal value. I have a simple class: public class A { public decimal d; } The serialization a value 0.00000001 is OK. The file is
0
1029
by: dave v | last post by:
I thought I read in an earlier post that there are known issues with deserialization in the System.Data.OracleClient.dll. Can anyone expand on that or give a workaround? I'm calling a custom database component that uses ODP.NET from a BizTalk 2004 map. When this component throws a System.Data.OracleClient.OracleException, I get this in the EventLog: Failed while creating a NUSTestHarness.NUSTest service.
2
9449
by: Shone | last post by:
I would like to perform a 2-pass XML reading from a stream. Once using the Validating reader, just to confirm the validity against the schema, and next time to do a reading to extract the data. Actually, second time I do a deserialization, the data from XML is fed directly to an object. The problem I am experiencing is the error at the second reading attempt, and error description implies that reader is winded to the end of the XML and...
4
3151
by: Mike Sarbu | last post by:
Hello all, I have an XML file like this: <?xml version="1.0" encoding="utf-8"?> <SomeObject xmlns="http://www.abcinc.com/objectdefinition" xmlns:someobj=http://www.abcinc.com/objectdefinition> ...... </SomeObject>
3
9792
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I am having problems deserializing an object which seems to be serializing just fine. I save the byte array of the serialized object in the database (when I check the database the field that holds the binary data seems populated), but when I want to deserialize this same byte array the application fails and gives me the following error: Binary stream does not contain a valid BinaryHeader, 0...
3
9791
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet deserialization routines to put the content in a generic object array (object) BUT the content is supposed to...
1
3738
by: parrot toes | last post by:
I tried to post this question before, but there was an error when posting. I case it did get posted and in order to avoid duplication, I'll just repost a summary. I have written a dotnet client that accesses a Axis provided web service. The client uses the code generated, using wsdl.exe, from the wsdl file provided by the web service provider. The web response has the following schema (roughly):
0
1310
by: =?Utf-8?B?UGllcmNlQnJvc25hbg==?= | last post by:
I am using C#(Vs.Net 2003) The error I am getting is... System.Xml.XmlException: This is an unexpected token. The expected token is 'EndElement' I have come to understand that this error is being caused by a character or set of characters...in the value of an xml element.
1
1367
by: Kapps | last post by:
Hi, I was wondering how I would go about deserializing a file that was serialized from a different project. I've tried a couple things, but I can't really seem to figure it out. When looking it up, it seemed like it would be solved by just including a class project that did the actual serializing and deserializing, but when I tried this, I still couldn't get it to work. I created a DLL that was referenced by both of my projects, the server...
0
8428
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
8851
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...
1
8535
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
8629
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
7360
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
6181
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
5650
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.