Solved

asp.net and html webservices ?

Posted on 2007-03-24
3
147 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Injector with Web Service 4 41
IIS redirect 1 68
encoding an href string 2 21
REXEX help Part 2 2 25
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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