|
-
August 4th, 2004, 08:50 AM
#1
some help in writing the webservice
Hi
I am need some help. following in my requirement.
There is a website which just https://dslreseller.tiscali-business.co.uk/avail( you can try it). it just has three things a label "telephone number" and text box for entering the telephone number and Go button. When you enter the telephone number and hit go and the same html page is displayed with some results as response text which will tell if the phone number has dsl service and other information.(it works only for uk phone numbers).
i have to write a webserive which will have a method taking the phone number as a paramter and pass information to the url and execute the go button click event with the telephone number passed and get the html result as a response output and which in turn i will put in XML file.. I hope the requirement is clear.
When i checked the source of the url they have a intput type TelNo and its value. When the url is called the first time, the value field is empty and if i put some telephone number in the telephone, value has the telephone number.
how can i simulate this using a webservice, how do i connect to url and pass the phone number to the value field and get the information
-
August 4th, 2004, 10:44 AM
#2
webmethod i wrote
Here is the webmethod i wrote. I am not able to figure it out , how to send the telephone number. let me know what mistake i am doing in the following. It still returns me the main page. only thing is problem is how to pass the value in send function
public string CheckBTNInfo()
{
HttpContext.Current.Response.Buffer=true;
MSXML2.XMLHTTPClass xml1 =new MSXML2.XMLHTTPClass();
string PostData = "TelNo=01895251212";
// Opens the connection to the remote server.
xml1.open("post", "https://dslreseller.tiscali-
business.co.uk/avail/index.html", false, null, null);
xml1.setRequestHeader("content-type", "text/xml; charset=utf-8");
xml1.setRequestHeader("SOAPAction", "\"\"");
// Actually Sends the request and returns the data:
xml1.send(PostData);
//Display the HTML both as HTML and as text
HttpContext.Current.Response.Write ("<h1>The HTML
text</h1><xmp>");
HttpContext.Current.Response.Write (xml1.responseText);
HttpContext.Current.Response.Write ("</xmp><p><hr><p><h1>The
HTML Output</h1>");
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|