calling an url from a webservice
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.webservices.

Post a new message to this list...

Christian Kreimer
Hi NG,

I have a webservice that acts as a proxy for an internal cgi programm. So
when i get an request i have to create a new request from the parameters an
call this cgi programm that runs on
http://localhost/cgi-bin/mycgi.exe?request=myrequest¶m=param1
What's the easiest way to implement this. I tried with inheriting a class
from System.Web.Services.Protocols.HttpGetClientProtocol and use the
invoke() mehtod but it didn't work properly.

Thanks for your time

Chris

Reply to this message...
 
    
Arthur Nesterovsky
Hi,

[Original message clipped]

Try to use the following:

WebRequest request =

WebRequest.Create("http://localhost/cgi-bin/mycgi.exe?request=myrequest¶
m=param1");
request.Method = "GET";

WebResponse response = request.GetResponse();
try
{
Stream inpStream = response.GetResponseStream();

// TODO:process your data here
}
finally
{
response.Close();
}

--
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com

Reply to this message...
 
 
System.Net.WebRequest
System.Net.WebResponse
System.Web.Services.Protocols.HttpGetClientProtocol




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com