consuming php web service in

Below is the code to consume a webservice of php in

In the given code we assume the web service return a string value to us.

We are passing the string type input to that web service.

Then we can use the return value according to our requirements.

private string GetResults(string url of web service)
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url of web service);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string Test;
StreamReader reader = new StreamReader(response.GetResponseStream());
Test = reader.ReadToEnd();
Test = Server.HtmlDecode(Test);
return Test;
catch (Exception ex)
throw ex;

Now call this function on page load and pass the url of webservice with your input. Like:
GetTextFromPPT("http://webservice/index.php?value=" + test);



~ by UTS on May 9, 2010.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: