COM components provide Web Services (1)

zhaozj2021-02-16  49

COM components provide Web Service (1) Visualsw

The Internet is evolving to the next generation of Web sites. Today's Web site can only provide user interfaces for your browser, and next-generation programmable web site links companies, applications, services, and devices to each other. These programmable Web sites will not be just passive sites, and will become a reusable intelligent web service. Web Service in the Microsoft®.NET frame is a solution to centralized Web services.

In our previous project development, we have developed a variety of COM components. Can we let these COM components provide Web services? This way we can reuse the components, and you can enjoy the advantages of Web Service, why not?

There are two ways to implement the COM component to provide Web Service:

One .microsoft® SOAP Toolkit

2. Create a component of the component .NET proxy class

Microsoft® SOAP Toolkit Download

Microsoft SOAP Toolkit 3.0 provides a complete set of COM objects to process all data related to SOAP, which encapsulates the internal implementation of SOAP and XML.

I. Features:

1. Provides the client's components that allow you to specify WSDL and easily call the corresponding Web Service.

2. Provides the server's components that allow you to specify WSDL, WSML, and COM objects to automatically generate Web Service.

3. It also provides the underlying processing component that allows you to manipulate the specific creation, processing, and transfer of the SOAP message.

Today we have to use the second function, let's see how to use SOAP Toolkit to implement the web service of the COM component.

Create a COM component

1. Open VB, create an ActiveX DLL function

2. Name Project is VBDLL, add classes, named CLSADD

3. The add functions are as follows:

Public Function Add (Byval A As Integer, Byval B AS Integer) AS INTEGER

Add = a b

END FUNCTION

4. Compile components, generate vbdll.dll components

Generate WSDL / WSML files

1. Install Microsoft® Soap Toolkit 3.0

2. Open WSDL Generator, as shown below:

3. Select Next

4. Select Next

Enter the name of the web service you want to generate, select COM components

5. After filling, choose the next step

You can see your Web service (DLLService), the class of the following components, and its public methods, and choose the class and its methods you need. Click Next.

6.

Listener Uri:

URI Enter the client program access path

Listener Type:

Here, ISAPI is selected, or the ASP can also be selected so that the web service is completed via the ASP.

Select Next

7.

Name Space: It can be ignored, or change some of them to your URL address.

8.

转载请注明原文地址:https://www.9cbs.com/read-25153.html

New Post(0)