dcsimg
Results 1 to 5 of 5

Thread: [RESOLVED] Is this possible?

  1. #1

    Thread Starter
    Addicted Member Goggy's Avatar
    Join Date
    Oct 2017
    Posts
    147

    Resolved [RESOLVED] Is this possible?

    Hello dear Guru's.

    Is the following senario posilble?

    I have lets say Class A, and a Collection Of A.
    What i do is serialize the collection using XmlSerializer.

    I also have a Message class that has a header and body.

    Now i want to add the serialized collection to the body of the message and then serialize the Message.

    The problem i'm having is the deserialization on the other end. Because the XML hold the xml header "<?xml version="1.0"?>" twice. Once at the beginning (serialized message) and once in the body (serialized Collection)
    Utterly useless, but always willing to help

    As a finishing touch god created the dutch

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,912

    Re: Is this possible?

    You might encode the inner XML much as this site does:

    https://www.freeformatter.com/xml-escape.html

  3. #3

    Thread Starter
    Addicted Member Goggy's Avatar
    Join Date
    Oct 2017
    Posts
    147

    Re: Is this possible?

    Thank you jmcilhinney.

    i thought about that. I will go that route.

    Was just hopen for a.... ermmm.. i don't know... a magic method that would be all understanding and wise...
    Utterly useless, but always willing to help

    As a finishing touch god created the dutch

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,912

    Re: Is this possible?


  5. #5

    Thread Starter
    Addicted Member Goggy's Avatar
    Join Date
    Oct 2017
    Posts
    147

    Re: Is this possible?

    Thx jmcilhinney,

    the second option looks like a more elegant solution.
    The first solution is already up and running, but will dive in the second one as well.

    Thx again
    Utterly useless, but always willing to help

    As a finishing touch god created the dutch

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width