To establish and run this C # component, after editing the connection value to connect to Microsoft SQL Server™After the database, you need to use sn.exe to generate the sctrans. snk file to enhance the name keyword, and then compile it using assembly references in the using statement. If you deploy on the server, you should use gacutil.exe (if you are using SDK) or put the Assembly into GAC through the. NET Framework user interface, then run regsvcs.exe to register the COM + hosting component. Regsvcs.exe uses the following attributes to publish a component to the SOAP endpoint and server (out-of-process) activation on the server:
[Assembly: ApplicationActivation (ActivationOption. Server,
SoapVRoot = "CSSoapSQL")]
This component uses different transactions in each method call, has an automatic completion method, and is configured as a buffer. When hosted and unmanaged COM + components are used, the object pool and transactions 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.
Soap: wsdl = http: // jnoss3/sctrans/SCTrans. SCTransSQLNC. soap? WSDL
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