Solved

asp.net and html webservices ?

Posted on 2007-03-24
3
149 Views
Last Modified: 2013-12-17
Hello,
i have an HTTP webservice that i would like to use with my asp,net project . i can control the webservice using http GET and POST . for examble , i want to send an sms message i use
http://some-url.com/service/sms.cgi?number=FROM&to=TO&message=MESSAGE

- my question how what should i do in asp.net so i can open the prevoius url and return result ?
- also , the webservice return results in TEXT and XML . what can i do in order to parase the XML ?

finally , what can i do so in case it faild to open the url it displays nothing , because the url will contain sensetave information

THANKS
0
Comment
Question by:os_abdo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 18785719
WebRequest req = null;
                  WebResponse rsp = null;
Stream rspStream = null,reqStream = null;
req = WebRequest.Create(http://some-url.com/service/sms.cgi?number=FROM&to=TO&message=MESSAGE
);
rsp = req.GetResponse();
                                    rspStream = rsp.GetResponseStream();      
if (rspStream != null)
                        {
                              // Load the XmlTextReader from the stream                                                      
                              XmlTextReader xmlread = null;
                              xmlread = new XmlTextReader (rspStream);

                              //SAVE THE RESPONSE XML
                              XmlDocument doc = new XmlDocument();
                              doc.Load(xmlread);
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question