大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> NET专区 -> COM+ Web 服务:通过复选框路由到 XML Web Services (转)6

COM+ Web 服务:通过复选框路由到 XML Web Services (转)6

时间: 2021-07-31 作者:daque

要创造并运转此 c# 组件,在实行编纂贯穿值以贯穿到 microsoft sql server™ 数据库之后,须要运用 sn.exe 天生 sctrans.snk 巩固称呼要害字文献,而后在 using 语句中运用步调集援用对其举行编写翻译。即使您在效劳器长进行安置,应运用 gacutil.exe(即使正在运用 sdk)或经过 .net 框架用户界面将步调集放入 gac,而后运转 regsvcs.exe,备案 com+ 托管组件。regsvcs.exe 将运用以部下性,将组件颁布为效劳器上的 soap 端点和效劳器(过程外)激活:[assembly: applicationactivation(activationoption.server,  soapvroot="cssoapsql")]此组件在每种本领挪用中运用各别的工作,具备一个机动实行本领,并被摆设为举行缓冲。运用托管和非托管 com+ 组件时,东西池和工作将如所预期的那么经过 soap 运转。比方,即使运用下列 vbscript 经过 soap 考察以次 servicedcomponent:mon = "soap:wsdl=http://jnoss3/sctrans/sctrans.sctranssqlnc.soap?wsdl"wscript.echo(mon)for i = 1 to 2 set c = getobject(mon) for j = 1 to 10wscript.echo i & " " & j & " " & c.countup("scwkonc") nextnext将表露以次输入实质:c:\moniker>actscwkomicrosoft (r) windows script host version 5.6copyright (c) microsoft corporation 1996-2001. all rights reserved.soap:wsdl=http://jnoss3/sctrans/sctrans.sctranssqlnc.soap?wsdl1 1 486 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 2 487 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 3 488 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 4 489 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 5 490 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 68 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 1 79 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 1 8 10 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 1 9 494 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 1 10 495 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 2 1 13 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 2 14 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 3 15 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 4 499 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 2 5 17 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 6 501 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 2 7 502 nc 6e41f32f-74be-45f0-94c0-989e7e1c5672 2 8 19 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 9 20 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 2 10 21 nc af26b53b-4a1f-48c8-8880-518c2b55a7ce 这即是所预期的缓冲的组件:从缓冲池中拖出东西并从新运用。运用存户端激活的缓冲组件的动作都是沟通的。非托管组件的东西池和工作也如所预期的那么运转(固然 visual basic 6.0 组件不扶助东西池)。须要为大普遍非托管运用步调经过 com+ 处置东西树立缓冲和工作属性。传播援用wko 与 cao 模子的一个要害辨别在乎它们向有状况的东西传播援用的本领。以次是 c# servicedcomponent 示例,表露了此操纵的基础办法:using system;using system.reflection;using system.enterpriseservices;using system.runtime.interopservices;[assembly: applicationname("refpass")][assembly: applicationactivation(activationoption.server,  soapvroot="refpass")][assembly: assemblykeyfile("refpass.snk")]namespace refpass{public interface iparent{string setref(object inkid);object getref();string countup(object obj); }public interface ichild{string getvalue ();string countup();void setname(string key);}[classinterface(classinterfacetype.autodual)]public class parent: servicedcomponent, iparent{protected child _kid = null;public string setref(object inkid){_kid = (child)inkid;return _kid.getvalue();}public object getref(){return (object)_kid;}public string countup(object obj){child kid = (child)obj;if (kid == null) return _kid.countup();else return kid.countup();} }[classinterface(classinterfacetype.autodual)]public class child : servicedcomponent, ichild{private int _counter = 0;private string _name = "none";public string countup() { _counter++; return getvalue(); }public string getvalue() { return (_name + " "  +_counter.tostring()); }public void setname(string key) { _name = key; }}}此 c# 步调有两个类:child 和 parent

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.