?
Solved

asp.net and html webservices ?

Posted on 2007-03-24
3
Medium Priority
?
153 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
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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 …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 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