Starr Duskk
asked on
HttpWebResponse.GetResponseStream converts &lt; instead of < etc.
I am using an HttpWebRequest to retrieve XML data from a web service.
My content type is:
request.ContentType = "text/xml; charset=utf-8";
The problem is, when I retrieve the text, everything inside the Envelope, the response, is converted. So <> are < and >, etc..
How do I retrieve the data, and retain the less than / greater than symbols for valid XML?
thanks!
My content type is:
request.ContentType = "text/xml; charset=utf-8";
The problem is, when I retrieve the text, everything inside the Envelope, the response, is converted. So <> are < and >, etc..
How do I retrieve the data, and retain the less than / greater than symbols for valid XML?
thanks!
ASKER
Well, yeah. But I thought there should be a way of retrieving the data WITHOUT it converting in the first place.
Is that not possible? Or do you not know?
thanks.
Is that not possible? Or do you not know?
thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
srosebabu,
That produces the same thing.. the < >'s are converted:
</client>
<order_dataset>
<subjects>
That produces the same thing.. the < >'s are converted:
</client>
<order_dataset>
<subjects>
ASKER
Decoding is not helping, because it also decodes values within the elements. Then I get an error:
>>Data at the root level is invalid. Line 1, position 1
Because the text was replaced with an open carat:
<class>GVWR<26001</class>
>>Data at the root level is invalid. Line 1, position 1
Because the text was replaced with an open carat:
<class>GVWR<26001</class>
any open carets and other XML keys have to be sent as <CData></CData>
strange... but, my sample code produces XML structure correctly.
update requestUrl with the below sample url and test once.
update requestUrl with the below sample url and test once.
string requestUrl = "http://constantine.lirmm.fr:8080/CentileParSaisieWS_GFV2/CentileWSService?wsdl";
//string requestUrl = "http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetWeatherInformation?";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There is only the one solution. Use: HtmlDecode
{
return Value.Replace ("&", "&").Replace("'", "'").Replace(""", "\"").Replace ("<", "<").Replace (">", ">");
}