Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Passing XML in a string parameter

Reply
Thread Tools

Passing XML in a string parameter

 
 
Ryan Champlin
Guest
Posts: n/a
 
      01-13-2004

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
 
Reply With Quote
 
 
 
 
Ryan Champlin
Guest
Posts: n/a
 
      01-13-2004
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
>-----Original Message-----
>
>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 < and > 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
>.
>

 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      01-13-2004
That's right, otherwise you'd end up with invalid xml.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"Ryan Champlin" <(E-Mail Removed)> wrote in message
news:09c801c3d9e0$19edea70$(E-Mail Removed)...
> 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
> >-----Original Message-----
> >
> >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 < and > 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
> >.
> >



 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameter to function not expecting parameter Mister B C Programming 8 08-26-2010 08:01 AM
ElementTree.XML(string XML) and ElementTree.fromstring(string XML)not working Kee Nethery Python 12 06-27-2009 06:06 AM
Parameter Passing - String Variable Truncated ? goldtech Python 5 09-01-2007 03:00 AM
Passing XML as parameter to Web page =?Utf-8?B?U3RldmVuIEouIFJlZWQ=?= ASP .Net 3 01-22-2005 12:31 AM
Passing parameter using XML data Peter ASP .Net Web Services 2 12-15-2003 08:09 PM



Advertisments