Solved

asp.net and html webservices ?

Posted on 2007-03-24
3
144 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
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now