vb.net中的Web服务 [英] Web service in vb.net

查看:92
本文介绍了vb.net中的Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求编写一个Web服务,该服务将同时为许多基于Web的客户端提供服务.

我以前创建了仅服务于一个客户端的Web服务.

我的Web服务将连接到com-object,并从该com-object的另一个应用程序检索数据.

由于Web服务是无状态的,我该怎么做?

将有很多GetFirst/GetNext调用来检索数据,但是我不知道如何在不将变量声明为共享的情况下做到这一点.

例如,如果我在Web服务中将com-object声明为public并在InitializeClass调用期间创建它,则在初始化后立即调用GetFirst时,com-objects值为NOTHING.

任何帮助将不胜感激...

谢谢

I''ve been asked to write a web service that will serve many web based clients simultaneously.

I have previously created web services that service only one client.

My web service will connect to a com-object and retrieve data from another application from that com-object.

With a web service being stateless, how can I do this?

There will be a lot of GetFirst / GetNext calls to retrieve data, but I can''t figure out how to do this without declaring my variables as shared.

For instance, if I declare the com-object as public in my web service and create it during a InitializeClass call, the com-objects value is NOTHING when I call GetFirst immediately after initializing.


Any help would be greatly appreciated...

Thanks

推荐答案

我不确定您的问题在哪里.正如您已经注意到的那样,由于服务是无状态的,因此与一个或多个客户端进行交易没有区别. COM对象应根据需要实例化,并根据实例进行实例化.这样您就不会有问题.
I''m not sure where your problem is. Because a service is stateless as you already note, then dealing with one client or multiple clients makes no difference. COM objects should be instantiated as you need them on an instance by instance basis. Then you''ll have no issues.


这篇关于vb.net中的Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆