C# Newbie

Discussion in 'Microsoft C# .NET' started by Gilbert, Oct 22, 2008.

  1. Gilbert

    Gilbert Guest

    Apologies if I'm posting this to the wrong group. I want to know if it
    possible to emulate Java servlet functionality in C# and .net. What I want
    to do is to be able to do is create a C# program that sits listens for an
    HTTP request to a specific URL and then access the C# equivalent of the
    HTTPServletRequest object so I can access the request parameters directly.
    I've googled and found out about the WebClient - what I want is the
    converse, something that sits on the webserver.

    I'm sure that it must be possible but as a newbie I'm not sure of the
    correct C# & .Net terminology yet to be able to effectively google for what
    I want.

    Regards
     
    Gilbert, Oct 22, 2008
    #1
    1. Advertisements

  2. On Oct 22, 10:43 am, Gilbert <> wrote:
    > Apologies if I'm posting this to the wrong group. I want to know if it
    > possible to emulate Java servlet functionality in C# and .net. What I want
    > to do is to be able to do is create a C# program that sits  listens foran
    > HTTP request to a specific URL and then access the C# equivalent of the
    > HTTPServletRequest object so I can access the request parameters directly..
    > I've googled and found out about the WebClient - what I want is the
    > converse, something that sits on the webserver.
    >
    > I'm sure that it must be possible but as a newbie I'm not sure of the
    > correct C# & .Net terminology yet to be able to effectively google for what
    > I want.
    >
    > Regards


    I think you need ADO.NET -- http://msdn.microsoft.com/en-us/library/aa286484.aspx
     
    puzzlecracker, Oct 22, 2008
    #2
    1. Advertisements

  3. Gilbert

    Hillbilly Guest

    I can say this, Microsoft has made webcasts and videos to explain how Java
    developers can use C# to achive their goals. One site I would check to start
    is http://asp.net/ and you can search for various webcasts

    // search term
    webcasts java site:msdn.microsoft.com

    "Gilbert" <> wrote in message
    news:pZGLk.89399$2...
    > Apologies if I'm posting this to the wrong group. I want to know if it
    > possible to emulate Java servlet functionality in C# and .net. What I want
    > to do is to be able to do is create a C# program that sits listens for an
    > HTTP request to a specific URL and then access the C# equivalent of the
    > HTTPServletRequest object so I can access the request parameters directly.
    > I've googled and found out about the WebClient - what I want is the
    > converse, something that sits on the webserver.
    >
    > I'm sure that it must be possible but as a newbie I'm not sure of the
    > correct C# & .Net terminology yet to be able to effectively google for
    > what
    > I want.
    >
    > Regards
     
    Hillbilly, Oct 22, 2008
    #3
  4. Gilbert

    sloan Guest

    I'm not a java to c# expert.

    However,....

    Check this:
    http://msdn.microsoft.com/en-us/library/ms227673.aspx
    Custom Http Module

    Off the top of my head, that is a "server side" thing that allow me to look
    at the incoming request

    and then:

    WCF allows its coded to be exposed as a WSHttpEndPoint WebService.
    http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
    Check that, and you'll have to make some changes to get WSHttpEndPoint to
    work.





    "Gilbert" <> wrote in message
    news:pZGLk.89399$2...
    > Apologies if I'm posting this to the wrong group. I want to know if it
    > possible to emulate Java servlet functionality in C# and .net. What I want
    > to do is to be able to do is create a C# program that sits listens for an
    > HTTP request to a specific URL and then access the C# equivalent of the
    > HTTPServletRequest object so I can access the request parameters directly.
    > I've googled and found out about the WebClient - what I want is the
    > converse, something that sits on the webserver.
    >
    > I'm sure that it must be possible but as a newbie I'm not sure of the
    > correct C# & .Net terminology yet to be able to effectively google for
    > what
    > I want.
    >
    > Regards
     
    sloan, Oct 22, 2008
    #4
  5. Gilbert

    Ralph Guest

    On Oct 22, 12:08 pm, "sloan" <> wrote:
    > I'm not a java to c# expert.
    >
    > However,....
    >
    > Check this:http://msdn.microsoft.com/en-us/library/ms227673.aspx
    > Custom Http Module
    >
    > Off the top of my head, that is a "server side" thing that allow me to look
    > at the incoming request
    >
    > and then:
    >
    > WCF allows its coded to be exposed as a WSHttpEndPoint WebService.http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
    > Check that, and you'll have to make some changes to get WSHttpEndPoint to
    > work.
    >
    > "Gilbert" <> wrote in message
    >
    > news:pZGLk.89399$2...
    >
    >
    >
    > > Apologies if I'm posting this to the wrong group. I want to know if it
    > > possible to emulate Java servlet functionality in C# and .net. What I want
    > > to do is to be able to do is create a C# program that sits  listens for an
    > > HTTP request to a specific URL and then access the C# equivalent of the
    > > HTTPServletRequest object so I can access the request parameters directly.
    > > I've googled and found out about the WebClient - what I want is the
    > > converse, something that sits on the webserver.

    >
    > > I'm sure that it must be possible but as a newbie I'm not sure of the
    > > correct C# & .Net terminology yet to be able to effectively google for
    > > what
    > > I want.

    >
    > > Regards- Hide quoted text -

    >
    > - Show quoted text -


    I believe what you need is a custom httpHandler. I believe that would
    be the "equivalent" of a servlet in java.

    Basically create an .ashx file with a class that implements
    IHttpHandler
    you need to have a function
    public void ProcessRequest (HttpContext context)
    {Put your code here}

    and the property

    public bool IsReusable {
    get {
    return true;
    }
    }
     
    Ralph, Oct 23, 2008
    #5
  6. Gilbert

    Gilbert Guest

    >
    > I believe what you need is a custom httpHandler. I believe that would
    > be the "equivalent" of a servlet in java.
    >
    > Basically create an .ashx file with a class that implements
    > IHttpHandler
    > you need to have a function
    > public void ProcessRequest (HttpContext context)
    > {Put your code here}
    >
    > and the property
    >
    > public bool IsReusable {
    > get {
    > return true;
    > }
    > }


    Thats the puppy! Thanks very much.
     
    Gilbert, Oct 24, 2008
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rafey

    Newbie - Small DataGrid Problem

    Rafey, Jul 12, 2003, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    412
    Tiki Wan
    Jul 14, 2003
  2. Jenny

    dotnet newbie question

    Jenny, Jul 13, 2003, in forum: Microsoft C# .NET
    Replies:
    11
    Views:
    610
    K_Lee
    Nov 6, 2003
  3. Dirk Schulze

    Newbie - When to use MarshalAs.UnmanagedType??

    Dirk Schulze, Jul 15, 2003, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    9,664
    Mattias Sjögren
    Jul 15, 2003
  4. Andrew Mueller

    VB newbie to C# - DLL Reference problem

    Andrew Mueller, Jul 15, 2003, in forum: Microsoft C# .NET
    Replies:
    4
    Views:
    794
    Scott
    Jul 16, 2003
  5. Bill Compton

    C# Newbie - mshtml

    Bill Compton, Jul 16, 2003, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    1,118
    Simon Trew
    Jul 16, 2003
Loading...

Share This Page