开发者

How to control WCF Session from a VBScript client

开发者 https://www.devze.com 2023-01-10 00:45 出处:网络
I have a scenario in which I have to call a WCF Service from VBScript (yes I know this is sad!) Now I know that when you instantiate a pro开发者_Go百科xy to the service in .Net code, that first call m

I have a scenario in which I have to call a WCF Service from VBScript (yes I know this is sad!) Now I know that when you instantiate a pro开发者_Go百科xy to the service in .Net code, that first call may take 10 to 20 seconds longer as WCF bootstraps the channel between the proxy and the service. Once that is done, all calls through that same proxy are quick. When that proxy is disposed, it seems that WCF keeps that channel open for short while (a minute or 3), because a second instantiation of a proxy and a call to the same service within that time does not carry the same bootstrapping burden...it executes quickly (sub-second response times).

Using VBScript, however, there is no concept of a proxy that gives you a "handle" on the channel...I'm just using ServerXMLHttp objects to send soap packets to the service address. I can certainly see that the first call takes a good 10 to 20 seconds longer than any subsequent call to the same service, indicating that WCF bootstrapping. I can also see that WCF timeout of the channel happening, because as long as my VBScript is making calls to the service not more than 2 or so minutes apart, the calls execute quickly. If I wait longer than that between calls, each call seems to cause a bootstrapping of a new WCF channel.

Is there anything I can do to keep that WCF channel open for longer between calls to the service? I'm thinking along the lines of changing the service instancing to PerSession. And I understand that the duration of a session is defined by the length of the life of the proxy (in .Net code). But in VBScript, there is no proxy!? Any idea what defines the length of a WCF Session when using PerSession instancing and calling from VBScript where there is no proxy? Or is there perhaps a way to get a handle on a proxy in VBScript?

Any advice would be appreciated. Thanks, Shawn.

0

精彩评论

暂无评论...
验证码 换一张
取 消