By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,081 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,081 IT Pros & Developers. It's quick & easy.

Create cgi web service

P: n/a
Using Visual Studio 2008 can someone point me to an example to create a cgi
web service in C# ?

Thanks.

Jun 27 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Michael Tissington" <mt*********@newsgroup.nospamwrote in
news:eB**************@TK2MSFTNGP03.phx.gbl:
Using Visual Studio 2008 can someone point me to an example to create
a cgi web service in C# ?
How come you want to create a CGI applicaion? Even if you get it working as
a CGI application, the server will need the .NET runtime, at which point
it's probably better to create an ASP.NET application?
--
sp**********@rogers.com (Do not e-mail)
Jun 27 '08 #2

P: n/a
Hi Michael,

For C# based CGI program, you can build a console application which read
environment variables and write output to standard output. Here are some
articles introcuding this:

#Creating a C#/.NET CGI Executable
http://www.west-wind.com/WebLog/posts/1143.aspx

#Understanding CGI with C#
http://www.codeproject.com/KB/cs/cgi_csharp.aspx

However, I think for CGI or ISAPI filters, unmanaged interface will still
be preferred. Also, for webservice, since it receive SOAP XML message and
return SOAP response, if you create your own CGI application as webservice,
you will have to do the XML processing yourself which may require much more
work. Is there any particular reason here that you can not use the ASP.NET
webservice or even WCF service?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Michael Tissington" <mt*********@newsgroup.nospam>
Subject: Create cgi web service
Date: Fri, 18 Apr 2008 11:43:54 -0700
Using Visual Studio 2008 can someone point me to an example to create a cgi
web service in C# ?

Thanks.
Jun 27 '08 #3

P: n/a
I need to create aCGI application because that is how the external site is
talking to us and I have no control over them.

"Spam Catcher" <sp**********@rogers.comwrote in message
news:Xn**********************************@127.0.0. 1...
"Michael Tissington" <mt*********@newsgroup.nospamwrote in
news:eB**************@TK2MSFTNGP03.phx.gbl:
>Using Visual Studio 2008 can someone point me to an example to create
a cgi web service in C# ?

How come you want to create a CGI applicaion? Even if you get it working
as
a CGI application, the server will need the .NET runtime, at which point
it's probably better to create an ASP.NET application?
--
sp**********@rogers.com (Do not e-mail)
Jun 27 '08 #4

P: n/a
Hi,

Thanks for the link ... I would love to do something else other than cgi
but the extrenal website is expecting a cgi ...

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:nL****************@TK2MSFTNGHUB02.phx.gbl...
Hi Michael,

For C# based CGI program, you can build a console application which read
environment variables and write output to standard output. Here are some
articles introcuding this:

#Creating a C#/.NET CGI Executable
http://www.west-wind.com/WebLog/posts/1143.aspx

#Understanding CGI with C#
http://www.codeproject.com/KB/cs/cgi_csharp.aspx

However, I think for CGI or ISAPI filters, unmanaged interface will still
be preferred. Also, for webservice, since it receive SOAP XML message and
return SOAP response, if you create your own CGI application as
webservice,
you will have to do the XML processing yourself which may require much
more
work. Is there any particular reason here that you can not use the ASP.NET
webservice or even WCF service?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Michael Tissington" <mt*********@newsgroup.nospam>
Subject: Create cgi web service
Date: Fri, 18 Apr 2008 11:43:54 -0700
Using Visual Studio 2008 can someone point me to an example to create a
cgi
web service in C# ?

Thanks.

Jun 27 '08 #5

P: n/a
I''m really just needing to create a cgi application.

I tried the first link and link some of the comments I too get the error
HRESULT: 0x80070057 (E_INVALIDARG)) ..... do you have any ideas about this
....

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:nL****************@TK2MSFTNGHUB02.phx.gbl...
Hi Michael,

For C# based CGI program, you can build a console application which read
environment variables and write output to standard output. Here are some
articles introcuding this:

#Creating a C#/.NET CGI Executable
http://www.west-wind.com/WebLog/posts/1143.aspx

#Understanding CGI with C#
http://www.codeproject.com/KB/cs/cgi_csharp.aspx

However, I think for CGI or ISAPI filters, unmanaged interface will still
be preferred. Also, for webservice, since it receive SOAP XML message and
return SOAP response, if you create your own CGI application as
webservice,
you will have to do the XML processing yourself which may require much
more
work. Is there any particular reason here that you can not use the ASP.NET
webservice or even WCF service?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Michael Tissington" <mt*********@newsgroup.nospam>
Subject: Create cgi web service
Date: Fri, 18 Apr 2008 11:43:54 -0700
Using Visual Studio 2008 can someone point me to an example to create a
cgi
web service in C# ?

Thanks.

Jun 27 '08 #6

P: n/a
Hi Michael,

Thanks for your reply.

Yes, I've also performed some tests on my side and did find the problem you
mentioned. I've also consult some .NET framework and IIS engineers and
they've told me that the problem is likey due to how the IIS load the CGI
exe program. Running a managed dll/exe as an ISAPI extension/ISAPI
filter/CGI does not work (in most cases) because IIS loads the dll/exe with
path that looks like \\?\d:\path\foo.dll (for various reasons) and CLR does
not like managed code invoked with the leading \\?\ - this has come up
multiple times in the past and CLR team has in the past said that it is too
expensive to fix this in the CLR.

A possible workaround would be to use a native dll/exe and load your
managed assemblies manually from them (i.e. the asp.net approach). However,
I think creating an unmanaged CGI program will be better than mixed
unmanaged and managed code.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Michael Tissington" <mt*********@newsgroup.nospam>
References: <eB**************@TK2MSFTNGP03.phx.gbl>
<nL**************@TK2MSFTNGHUB02.phx.gbl>
In-Reply-To: <nL**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: Create cgi web service
Date: Wed, 23 Apr 2008 11:13:52 -0700

I''m really just needing to create a cgi application.

I tried the first link and link some of the comments I too get the error
HRESULT: 0x80070057 (E_INVALIDARG)) ..... do you have any ideas about this
...

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:nL****************@TK2MSFTNGHUB02.phx.gbl...
Hi Michael,

For C# based CGI program, you can build a console application which read
environment variables and write output to standard output. Here are some
articles introcuding this:

#Creating a C#/.NET CGI Executable
http://www.west-wind.com/WebLog/posts/1143.aspx

#Understanding CGI with C#
http://www.codeproject.com/KB/cs/cgi_csharp.aspx

However, I think for CGI or ISAPI filters, unmanaged interface will still
be preferred. Also, for webservice, since it receive SOAP XML message and
return SOAP response, if you create your own CGI application as
webservice,
you will have to do the XML processing yourself which may require much
more
work. Is there any particular reason here that you can not use the ASP.NET
webservice or even WCF service?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Michael Tissington" <mt*********@newsgroup.nospam>
Subject: Create cgi web service
Date: Fri, 18 Apr 2008 11:43:54 -0700
Using Visual Studio 2008 can someone point me to an example to create a
cgi
web service in C# ?

Thanks.


Jun 27 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.