COM + Web Service: route to XML Web Services 5 through the check box

Source: Internet
Author: User

In the COM + application export wizard shown in figure 3, enter the location and name of the proxy. msi file.
In the COM + application export wizard shown in figure 3, enter the location and name of the proxy. msi file.

Figure 3: the COM + application export wizard installs the proxy. msi file on a separate client computer as a pre-generated COM + application.
During installation, the proxy is configured appropriately to access the correct server and virtual root through SOAP. For client activation, you can use a conventional unmanaged COM + activation (such as CoCreateInstance and CreateObject) instead of a wsdl name object ). After the application proxy of the preceding Visual Basic calculator example is created on the server and installed on a separate client computer, the following VBScript accesses the server through SOAP: set c = CreateObject ("VB6Soap. calc ") for I = 1 to 10 WScript. echo I & "& c. add (I, I) & "& Timenext
If the agent does not enable the COM + Web Service, the preceding VBScript Code uses DCOM to access the server application.
Examples of transactional Components
A simple calculator is far from a heavy workload of business applications, so we now consider applications with an object pool suitable for COM + transactional components.
The most easily managed and configured component is the managed code component exported by ServicedComponent, as shown in the following C # example: using System; using System. reflection; using System. runtime. interopServices; using System. enterpriseServices; using System. data; using System. data. sqlClient; [assembly: ApplicationName ("SCTrans")] [assembly: ApplicationActivation (ActivationOption. server, SoapVRoot = "SCTrans")] [assembly: AssemblyKeyFile ("SCTrans. snk ")] namespace SCTrans {public interface ISCTrans {string CountUp (string Key);} [ObjectPooling (MinPoolSize = 0, MaxPoolSize = 25)] [JustInTimeActivation (true)] [ClassInterface (ClassInterfaceType. autoDual)] [TransactionAttribute (TransactionOption. requiresNew)] public class SCTransSQLNC: ServicedComponent, ISCTrans {[AutoComplete] public string CountUp (string Key) {_ command = new SqlCommand ("", _ connection); _ command. commandType = Comma NdType. text; _ command. connection. open (); _ command. commandText = "UPDATE CallCount WITH (ROWLOCK) SET CallCount = CallCount + 1 WHERE Machine = '" + Key + "'"; _ command. executeNonQuery (); _ command. connection. close (); _ numcballs ++; return (_ numcballs + "NC" + _ guid);} protected override bool CanBePooled () {return true ;} private int _ numcils = 0; private string _ guid = Guid. newGuid (). toString (); pr Ivate SqlConnection _ connection = new SqlConnection ("user id = MyUser; password = My! Password; database = SoapTest; server = MyServer "); private SqlCommand _ command ;}}

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.