Keep object across web service calls?

Discussion in 'ASP .Net Web Services' started by John Granade, Oct 9, 2007.

  1. John Granade

    John Granade Guest

    I have a 3rd party .dll that makes and keeps a connection to their server.
    They offer a web service but for high volume transactions they offer this
    ..dll where you initially open the connection and then just keep using that
    connection for all subsequent calls. I'm trying to leverage that in our web
    service but I can't figure out how to have that 'shared' instance of their
    dll. I thought I might could put it in the global.asax and just load it in
    the application_start but I'm missing how to expose that instance of the
    object to my web service and asp.net pages that need to access it.

    What's the right way to initiate this object once and then have subsequent
    web services and web pages use that object going forward?

    Thanks,

    John
     
    John Granade, Oct 9, 2007
    #1
    1. Advertising

  2. "John Granade @GTSolutions.us>" <John<nospam> wrote in message
    news:...
    >I have a 3rd party .dll that makes and keeps a connection to their server.
    >They offer a web service but for high volume transactions they offer this
    >.dll where you initially open the connection and then just keep using that
    >connection for all subsequent calls. I'm trying to leverage that in our
    >web service but I can't figure out how to have that 'shared' instance of
    >their dll. I thought I might could put it in the global.asax and just load
    >it in the application_start but I'm missing how to expose that instance of
    >the object to my web service and asp.net pages that need to access it.
    >
    > What's the right way to initiate this object once and then have subsequent
    > web services and web pages use that object going forward?


    I would create a small Windows Service to host the third party DLL and to
    expose its features through .NET Remoting. If you've never done it before,
    it's very easy to create a Windows Service. Visual Studio will basically
    create the infrastructure for you.

    This will allow you to concentrate on the issues involved with managing the
    access to this DLL by multiple callers. In particular, you need to find out
    from the third party whether their DLL is thread safe. Not only whether they
    _say_ it's thread-safe, but whether they've really _tested_ it on multi-CPU
    systems. This is not always the case.

    If you have any doubts about the safety of this DLL, you will have to code
    your service so that only a single request can be processed at a time. You
    may also need to ensure that all access to this DLL occurs on a single
    thread.

    I have experience with third party code that claims to be thread safe, but
    is not. In the case I'm thinking of, the company had not actually tested
    their product as called by an ASP.NET web service. I suggest you either make
    sure that it has been properly tested, or else protect yourself in case it
    has not been!

    Good Luck!
    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
     
    John Saunders [MVP], Oct 9, 2007
    #2
    1. Advertising

  3. John Granade

    John Granade Guest

    John,

    Awesome information. Thank you so much for your insight. Based on your
    direction, .NET Remoting seems to be what I need so I'm headed in that
    direction now. The 3rd party .dll is a somewhat old C++ .dll.

    Again, thanks for your insight.

    John

    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:...
    > "John Granade @GTSolutions.us>" <John<nospam> wrote in message
    > news:...
    >>I have a 3rd party .dll that makes and keeps a connection to their server.
    >>They offer a web service but for high volume transactions they offer this
    >>.dll where you initially open the connection and then just keep using that
    >>connection for all subsequent calls. I'm trying to leverage that in our
    >>web service but I can't figure out how to have that 'shared' instance of
    >>their dll. I thought I might could put it in the global.asax and just
    >>load it in the application_start but I'm missing how to expose that
    >>instance of the object to my web service and asp.net pages that need to
    >>access it.
    >>
    >> What's the right way to initiate this object once and then have
    >> subsequent web services and web pages use that object going forward?

    >
    > I would create a small Windows Service to host the third party DLL and to
    > expose its features through .NET Remoting. If you've never done it before,
    > it's very easy to create a Windows Service. Visual Studio will basically
    > create the infrastructure for you.
    >
    > This will allow you to concentrate on the issues involved with managing
    > the access to this DLL by multiple callers. In particular, you need to
    > find out from the third party whether their DLL is thread safe. Not only
    > whether they _say_ it's thread-safe, but whether they've really _tested_
    > it on multi-CPU systems. This is not always the case.
    >
    > If you have any doubts about the safety of this DLL, you will have to code
    > your service so that only a single request can be processed at a time. You
    > may also need to ensure that all access to this DLL occurs on a single
    > thread.
    >
    > I have experience with third party code that claims to be thread safe, but
    > is not. In the case I'm thinking of, the company had not actually tested
    > their product as called by an ASP.NET web service. I suggest you either
    > make sure that it has been properly tested, or else protect yourself in
    > case it has not been!
    >
    > Good Luck!
    > --
    > --------------------------------------------------------------------------------
    > John Saunders | MVP - Windows Server System - Connected System Developer
    >
    >
     
    John Granade, Oct 9, 2007
    #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. Isaias Formacio Serna

    Web Service that calls an external Web Service

    Isaias Formacio Serna, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    5
    Views:
    262
  2. Replies:
    1
    Views:
    245
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  3. Multiple web service calls from web service

    , Jan 5, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    191
    Rodrigo García
    Jan 9, 2006
  4. PerlFAQ Server
    Replies:
    0
    Views:
    139
    PerlFAQ Server
    Jan 21, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    120
    PerlFAQ Server
    Mar 12, 2011
Loading...

Share This Page