COM + Web service: Routing to XML Web services by check box 7

Source: Internet
Author: User
Tags command line soap reserved web services wsdl
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:

Set C1 = GetObject
("SOAP:WSDL=HTTP://JNOSS4/REFPASS/REFPASS.CHILD.SOAP?WSDL")
Set C2 = GetObject
("SOAP:WSDL=HTTP://JNOSS4/REFPASS/REFPASS.CHILD.SOAP?WSDL")
C1. SetName ("C1")
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
WScript.Echo C1. Countup ()
C2. SetName ("C2")
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()
WScript.Echo C2. Countup ()

The following output is displayed at run time:

C:\moniker>refpasswko
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

None 1
None 1
None 1
None 1
None 1
None 1
None 1
None 1
None 1
None 1

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.

C1 1
C1 2
C1 3
C1 4
C1 5
C2 1
C2 2
C2 3
C2 4
C2 5
C1 5
C2 6
C2 7
C2 8
C2 9
C1 6
C1 7

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.



Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.