Passing XML in a string parameter

R

Ryan Champlin

We have a parameter to a webmethod that is defined as a
string. We expect to pass XML in this string. What we've
found out is that the .Net web serivce seems to expect the
string to be in an htmlencoded format. By this I mean all
the characters such as "<", ">", "=" etc.. need to be
escaped such as &lt; and &gt; etc.. Why is it that .Net
seems to expect this? I'm assuming this is part of the
spec. somewhere that strings need to be encoded (I'm
guessing for de-serialization reasons when using a
parser). If anyone can point me to that in a spec
somewhere that would be helpful so I can explain why this
is happening.

Everything works fine when we make sure we pass this
string htmlencoded.

Thanks
Ryan
 
R

Ryan Champlin

I think I may have found the answer but could someone
verify that i am correct on this. From what I can tell
the SOAP spec. says that a type of string follows the XML
Schema specification for a string type. The string type
for an XML Schema says that this string contain contain
child elements thus the charaters that typically make up
element tags (such as < or >) are not allowed or basically
need to be converted to their escaped equivalent.

Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top