Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 9th, 2006, 09:35 PM
joshjbond@gmail.com
Guest
 
Posts: n/a
Default XML Deserialization Issue

Hello All,
I am having some trouble deserializing some xml into a series of
objects that are part of a web service proxy. I know the XML is valid,
and the objects are up to date (the xml instance doc validates against
the original scheme, which is current with the WSDL). The issue looks
familiar, its identical to one that I have seen when the xmlserializer
chokes on a namespace. In past instances with simple XML docs I was
able to get things working by supplying the Deserialize method a
default namespace, but in this case I have 3 namespaces, and no
default.

Any ideas as to how I would go about solving this?

Here's the line the deserilizer chokes on:

<ns0:Document xmlns:add="http://SomeAddress/Address"
xmlns:con="http://SomeAddress/Contact"
xmlns:ns0="http://SomeAddress/Document">

  #2  
Old March 9th, 2006, 10:25 PM
joshjbond@gmail.com
Guest
 
Posts: n/a
Default Re: XML Deserialization Issue

Interestingly enough I was able to solve this issue through
experimentation. But now I am further confused.
The instance document was missing the encoding declaration, once I
added that

(<?xml version='1.0' encoding='utf-8'?>)

to the top of the instance doc, and included the default namespace in
the serializer declaration

new System.Xml.Serialization.XmlSerializer(typeof(Obje ctName),
"http://SomeAddress/Document"))

Everything works. So my new question is

Why? I would feel better if I understood what mysterious inner workings
lead to this resolution.

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles