services|web|xml| check box to establish and run this C # component, after you finish editing the connection value to connect to the Microsoft SQL Server™ database, you need to use Sn.exe to generate the Sctrans.snk enhanced name keyword file, and then in the using Statement to compile it using an assembly reference. If you are deploying on a server, use Gacutil.exe (if you are using the SDK) or put the assembly in the GAC through the. NET Framework user interface, and then run Regsvcs.exe to register the COM + managed component. Regsvcs.exe uses the following properties to publish the component as a SOAP endpoint and server (out-of-process) activation on the server:
This component uses a different transaction in each method invocation, has an automatic completion method, and is configured to buffer. When using managed and unmanaged COM + components, object pooling and transactions will run through SOAP as expected. For example, if you use the following VBScript to access the following ServicedComponent through SOAP:
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 10
WScript.Echo I & "" & J & "" & C.countup ("Scwkonc")
Next
Next
The following output is displayed:
C:\moniker>actscwko
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
This is the expected buffer component: Drag the object from the buffer pool and reuse it. The behavior of using a client-activated buffering component is the same.
The object pools and transactions of unmanaged components also run as expected (although the Visual Basic 6.0 component does not support object pooling). You need to set buffering and transaction properties for most unmanaged applications through the COM + Administration tool.
Passing references
A key difference between Wko and CAO models is their ability to pass references to stateful objects. The following is the C # ServicedComponent example, which shows the basic steps of this operation:
Using System;
Using System.Reflection;
Using System.EnterpriseServices;
Using System.Runtime.InteropServices;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.