?
Solved

asp.net and html webservices ?

Posted on 2007-03-24
3
Medium Priority
?
151 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 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

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