Hi, First of all, I am very much impressed with IFBY Phone... Good Works... Now the problem: I am in need of getting the status of the call. For this I used normal way of web request/response... But i got stuck in 1 place, where the response is obsolete...
The code snipped i used: HttpWebRequest oWebRequest = WebRequest.Create(strURL.ToString()) as HttpWebRequest; HttpWebResponse oWebResponse = oWebRequest.GetResponse() as HttpWebResponse; using (var streamReader = new StreamReader(oWebResponse.GetResponseStream(), Encoding.UTF8)) { strResult = streamReader.ReadToEnd(); } File.WriteAllText("C:\\Save9.xml", strResult);
For a single phone number call it is giving the correct xml output. Whereas if it is multiple phone numbers, the response is not perfect...
Output 1: Single Phone number: Working properly...
Output 2:3 Phone numbers <?xml version='1.0' encoding='iso-8859-1'?> <!DOCTYPE data [ <!ELEMENT data (record+)> <!ELEMENT record ()> ]> <data> </data>
the actual web response: <?xml version="1.0" encoding="iso-8859-1" ?>
I'm not sure I understand exactly what the issue is. The XML you posted looks ok to me. So your code snippet is having a hard time parsing it - is that what is happening?
Thanks for your reply! I tried this code snippet which was suggested by IfByPhone for asp: [Modified according to Asp.net] HttpWebRequest oWebRequest = (HttpWebRequest)WebRequest.Create(strURL); HttpWebResponse oWebResponse = (HttpWebResponse)oWebRequest.GetResponse(); StreamReader oStreamReader = new StreamReader(oWebResponse.GetResponseStream()); String strRes = oStreamReader.ReadToEnd();
Hi, 1 more hint... there is no problem with the XML parsing... I guess it is from webresponse. I displayed the web response for this url, it gave me 157, whereas if i pass the single response url it is giving 957...
Hi, I mean to say, the content length of the web response is 157 for the URL i gave. but for the url which is having single phone number response the content length is 957... It means there is no content coming from response thats why xml looks blank.
Vimal - I am having trouble recreating the behavior you are seeing. Can you send me an email (see above) with the actual URLs and the exact responses? When I hit the URLs - I saw the expected XML.
Vimal - in order to help you, I will need the details I asked for above. As I mentioned, I cannot replicate the issue on my side. Can you please email me the exact URLs and responses? Thanks.