WebRequest request = WebRequest.Create(uri) as HttpWebRequest;
XmlSerializer ser = new XmlSerializer(typeof(eTraceEvents));
WebResponse response = request.GetResponse();
eTraceEvents result = (eTraceEvents)ser.Deserialize(response.GetResponseStream());
And here is the url after creating the webrequest object:
I'm no encoding expert, but don't those mean the same thing? A "/" can be represented as a "/" or "%2F". It's like saying the number "one" can be represented as "1" or "one" or "I" (roman numeral).
Yes, sorta. The problem the web service is expecting 2 parameters, delimited by the slash, just like any restful web service. What it gets is 4 parameters which it has no idea what to do with and proceeds to tell me to get lost. i don't wanna get lost,
i wanna get my data.
Sure, I understand that routing is making a distinction in segments and thus "/" is special but you're sending extra "/" characters via your date param (despite the encoding). Anyway, like I said I'm no encoding or URL spec expert... have you considered
passing the date differently or look into
wildard params? Just trying to help :)
sbrown999
Member
20 Points
6 Posts
WebRequest loses encoding
Apr 11, 2012 09:59 PM|LINK
Here is the url string encoded, as expected.
http://10.252.92.34:28080/vpulse-adzone-ws-1.0-SNAPSHOT/resources/comcast.sed.neto.vpulse.data.entity.etraceevent/3%2F29%2F2012/111111111111111
Below is my code:
And here is the url after creating the webrequest object:
http://10.252.92.34:28080/vpulse-adzone-ws-1.0-SNAPSHOT/resources/comcast.sed.neto.vpulse.data.entity.etraceevent/3/29/2012/111111111111111
Notice the encoding is GONE.
Any ideas?
BrockAllen
All-Star
27516 Points
4897 Posts
MVP
Re: WebRequest loses encoding
Apr 11, 2012 10:03 PM|LINK
I'm no encoding expert, but don't those mean the same thing? A "/" can be represented as a "/" or "%2F". It's like saying the number "one" can be represented as "1" or "one" or "I" (roman numeral).
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
sbrown999
Member
20 Points
6 Posts
Re: WebRequest loses encoding
Apr 12, 2012 03:02 AM|LINK
Yes, sorta. The problem the web service is expecting 2 parameters, delimited by the slash, just like any restful web service. What it gets is 4 parameters which it has no idea what to do with and proceeds to tell me to get lost. i don't wanna get lost, i wanna get my data.
BrockAllen
All-Star
27516 Points
4897 Posts
MVP
Re: WebRequest loses encoding
Apr 12, 2012 03:12 AM|LINK
Sure, I understand that routing is making a distinction in segments and thus "/" is special but you're sending extra "/" characters via your date param (despite the encoding). Anyway, like I said I'm no encoding or URL spec expert... have you considered passing the date differently or look into wildard params? Just trying to help :)
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/