473,387 Members | 1,553 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,387 software developers and data experts.

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.XmlText' to type
'System.Xml.XmlElement'.

Stack Trace:

[InvalidCastException: Unable to cast object of type 'System.Xml.XmlText' to
type 'System.Xml.XmlElement'.]
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReaderPRISMAPI.Read2_ContactDTO(Boolea n
isNullable, Boolean checkType) +5470
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReaderPRISMAPI.Read30_ContactNewRespon se()
+439
Microsoft.Xml.Serialization.GeneratedAssembly.Arra yOfObjectSerializer25.Deserialize(XmlSerialization Reader
reader) +63
System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader,
String encodingStyle, XmlDeserializationEvents events) +336

[InvalidOperationException: There is an error in XML document (1, 685).]
System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader,
String encodingStyle, XmlDeserializationEvents events) +781
System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader,
String encodingStyle) +53
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
+2551
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters) +292
PrismAPI.PRISMAPI.ContactNew() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\webui\bcb854b3\dc118bff\App_WebReferences.ca csndbj.0.cs:443
_Default.Page_Load(Object sender, EventArgs e) in
d:\work\<snip>\WebPortalVS\trunk\src\WebUI\Default .aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o,
Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender,
EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.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 2881

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

Similar topics

2
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
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...
2
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....
4
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"...
3
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...
3
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...
1
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...
0
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...
1
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...
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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,...

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.