services|web|xml| check box This C # program has two classes: Child and Parent. If you run the following VBScript example, the difference between the Wko and the CAO model is more pronounced:
The name and value describe the stateless nature of a single call to a known object, because the component is created with a different method invocation, so the name or value is not preserved between the method calls.
If you export a client agent and then import it to another client computer and run the following VBScript, SOAP activation will be CAO instead of Wko:
' Create two objects directly
Set C1=createobject ("Refpass.child")
Set C2=createobject ("Refpass.child")
' Sets the name of the first object and calls several times
' To increment an object's internal counter
C1. SetName ("C1")
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
' Sets the name of the first object and calls several times
' To increment an object's internal counter
C2. SetName ("C2")
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
' Create parent object
Set P=createobject ("Refpass.parent")
' Passing child objects to the parent object and calling child objects from the parent object
WScript.Echo P.setref (C1)
WScript.Echo P.countup (C2)
WScript.Echo P.countup (C2)
WScript.Echo P.countup (C2)
WScript.Echo P.countup (C2)
' Now call the child objects stored inside the parent object
Dim C9
WScript.Echo P.countup (C9)
' Get the object from the parent object and call directly
Set C3 = P.getref ()
WScript.Echo C3. Countup ()
When run from the command line, the following output is displayed:
C:\moniker>refpasscl
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
CAO activation retains state even when invoked through SOAP, and allows object references to be passed back and forth through soap. Both the name and the value remain in the class instance on the server, and the reference works correctly. Both scripts invoke the same compiled C # component, except that the. NET Remoting activation model is different.
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.