Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Keep object across web service calls?

Reply
Thread Tools

Keep object across web service calls?

 
 
John Granade
Guest
Posts: n/a
 
      10-09-2007
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

 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      10-09-2007
"John Granade @GTSolutions.us>" <John<nospam> wrote in message
news:1C949F8E-A860-4469-8222-...
>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


 
Reply With Quote
 
 
 
 
John Granade
Guest
Posts: n/a
 
      10-09-2007
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:1C949F8E-A860-4469-8222-...
>>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
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Groups "Keep Me Signed In" NOT keeping me logged in across thekmanrocks@gmail.com Computer Information 3 07-20-2012 05:56 PM
FAQ 4.74 How do I keep persistent data across program calls? PerlFAQ Server Perl Misc 0 03-12-2011 05:00 PM
FAQ 4.74 How do I keep persistent data across program calls? PerlFAQ Server Perl Misc 0 01-21-2011 11:00 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
How to keep session information across several appliations? Terry Olsen ASP .Net 2 09-29-2005 03:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57