Exposing Unmanaged C++ Windows Service code as a ASP.NET service.

Discussion in 'ASP .Net' started by =?Utf-8?B?c2h5YW0=?=, May 20, 2006.

  1. I have a C++ COM based windows service which have more than 30k lines of code
    and which is stablized over years. We need to take the advantage of the
    ..NET framework for this project, especially the GUI for this service and the
    other
    windows non gui .NET clients.

    What's the best migaration pattern for us considering not to rewrite the
    thousands of lines of code.

    The question i have are the follows.

    We would like to port this service code to a ASP.NET service and expose to
    the
    client. Doing this way we can take best advantage advantage of the Windows
    Communication Foundation (WCF) functionalities which is comming with Windows
    Vista.

    What will be the best way to do this. Can i make the new ASP.NET service
    talk directly to the windows unmanaged service, and then the GUI and the
    clients talk to the ASP.NET instead of the windows unmanaged service.

    In this approch the ASP.NET service can host all the new functionalities +
    the type conversion from .NET to COM and vice versa.

    Thanks,
    Shyam
     
    =?Utf-8?B?c2h5YW0=?=, May 20, 2006
    #1
    1. Advertising

  2. You case is pretty interesting. First of all if your code is COM unmanged
    code you can make it managed but creating wrapper class and then using Stubs
    (proxy) in your code, this is beauty of .Net Interoperability. But the main
    concern here is architecture. Microsoft Enterprise Architecture introduces
    what we call Service Agents which works on Gateway Design Pattern. In this
    case your unmanged COM service (which will become managed by
    interoperability) will act as service interface and then you can create
    Service Agent which will hide all communication and using details and this
    service agent can be used anywhere either asp.net application or webservice
    or winforms application.

    Pls provide feedback whether this post is helpful to you.

    "shyam" wrote:

    >
    > I have a C++ COM based windows service which have more than 30k lines of code
    > and which is stablized over years. We need to take the advantage of the
    > .NET framework for this project, especially the GUI for this service and the
    > other
    > windows non gui .NET clients.
    >
    > What's the best migaration pattern for us considering not to rewrite the
    > thousands of lines of code.
    >
    > The question i have are the follows.
    >
    > We would like to port this service code to a ASP.NET service and expose to
    > the
    > client. Doing this way we can take best advantage advantage of the Windows
    > Communication Foundation (WCF) functionalities which is comming with Windows
    > Vista.
    >
    > What will be the best way to do this. Can i make the new ASP.NET service
    > talk directly to the windows unmanaged service, and then the GUI and the
    > clients talk to the ASP.NET instead of the windows unmanaged service.
    >
    > In this approch the ASP.NET service can host all the new functionalities +
    > the type conversion from .NET to COM and vice versa.
    >
    > Thanks,
    > Shyam
    >
     
    =?Utf-8?B?QWx0YWYgQWwtQW1pbiBOYWp3YW5p?=, May 21, 2006
    #2
    1. Advertising

  3. RE: Exposing Unmanaged C++ Windows Service code as a ASP.NET servi

    Hi Alatf,

    Thanks for your valuable suggestions about the service agents, it was
    really helpfull for me(as i never knew such a patten exist)

    After reading about that in MSDN i think i need to extract out the conversion
    mechanisms(interops) from .NET to COM and vice versa in a seprate component .

    That leads to another question, is it a good design decision to put this
    component
    in a seprate ASP.NET webservice, and make the .NET clients talk to this
    service(which in turn talks to the real c++ COM service).

    Can i make use of SOAP protocols here for this kind of object accesing
    mechanisms?.

    Thanks,
    Vineeth


    "Altaf Al-Amin Najwani" wrote:

    > You case is pretty interesting. First of all if your code is COM unmanged
    > code you can make it managed but creating wrapper class and then using Stubs
    > (proxy) in your code, this is beauty of .Net Interoperability. But the main
    > concern here is architecture. Microsoft Enterprise Architecture introduces
    > what we call Service Agents which works on Gateway Design Pattern. In this
    > case your unmanged COM service (which will become managed by
    > interoperability) will act as service interface and then you can create
    > Service Agent which will hide all communication and using details and this
    > service agent can be used anywhere either asp.net application or webservice
    > or winforms application.
    >
    > Pls provide feedback whether this post is helpful to you.
    >
    > "shyam" wrote:
    >
    > >
    > > I have a C++ COM based windows service which have more than 30k lines of code
    > > and which is stablized over years. We need to take the advantage of the
    > > .NET framework for this project, especially the GUI for this service and the
    > > other
    > > windows non gui .NET clients.
    > >
    > > What's the best migaration pattern for us considering not to rewrite the
    > > thousands of lines of code.
    > >
    > > The question i have are the follows.
    > >
    > > We would like to port this service code to a ASP.NET service and expose to
    > > the
    > > client. Doing this way we can take best advantage advantage of the Windows
    > > Communication Foundation (WCF) functionalities which is comming with Windows
    > > Vista.
    > >
    > > What will be the best way to do this. Can i make the new ASP.NET service
    > > talk directly to the windows unmanaged service, and then the GUI and the
    > > clients talk to the ASP.NET instead of the windows unmanaged service.
    > >
    > > In this approch the ASP.NET service can host all the new functionalities +
    > > the type conversion from .NET to COM and vice versa.
    > >
    > > Thanks,
    > > Shyam
    > >
     
    =?Utf-8?B?c2h5YW0=?=, May 22, 2006
    #3
    1. Advertising

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. =?Utf-8?B?TWljaGFlbCBSIE1vcmdhbg==?=

    RE: Using unmanaged code in a Web Service

    =?Utf-8?B?TWljaGFlbCBSIE1vcmdhbg==?=, Aug 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,676
    =?Utf-8?B?TWljaGFlbCBSIE1vcmdhbg==?=
    Aug 26, 2004
  2. bill
    Replies:
    3
    Views:
    1,007
    Damien
    Oct 10, 2005
  3. Mark Duregon

    Access File Share from ASP.NET using Unmanaged Code

    Mark Duregon, Jul 14, 2004, in forum: ASP .Net Security
    Replies:
    13
    Views:
    270
    Yan-Hong Huang[MSFT]
    Jul 19, 2004
  4. Ted

    ASP.NET App with Unmanaged Code - HELP!

    Ted, Dec 10, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    162
    Kaustav
    Dec 15, 2004
  5. WTH
    Replies:
    1
    Views:
    178
Loading...

Share This Page