How to TO:BETA:Integrate A. NET Client with an Apache SOAP 2.2 XML Web Service

Source: Internet
Author: User
Tags include interface soap net command prepare web services microsoft c visual studio
Apache|client|web|xml how to TO:BETA:Integrate a. NET client with an Apache SOAP 2.2 XML Web Service

--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Visual Studio. NET Beta 2

--------------------------------------------------------------------------------
This is article discusses a Beta release of a Microsoft product. The information in this article are provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about obtaining support for a beta release, please do not have the documentation included with the Beta product fi Les, or check the Web location from which to you downloaded the release.
In the This TASK
SUMMARY
Requirements
Prepare WSDL File for. NET
Create the Proxy
Use the Wsdl.exe Tool to Create the Proxy
Use the Visual Studio. NET IDE to Create the Proxy


SUMMARY
This article describes how to integrate the A. NET client with an Apache SOAP 2.2-based Web service. This is article assumes that a web Services Description Language (WSDL) file exists and is created by using the IBM Web serv Ices Toolkit.

Back to the top

Requirements
This article assumes to are familiar with the following topics:
Reading and editing WSDL files
Microsoft. NET Framework Software Development Kit (SDK)
Back to the top
Prepare the WSDL File for. NET
The IBM Web Services Toolkit places the WSDL information in two files:
Java class name _service.wsdl (the Service file)
Java class name _SERVICE-INTERFACE.WSDL (the interface file)
The the "contains" service information. The second file contains the message, port type, and binding definitions. Because of incompatibilities between ibm-generated WSDL and the Microsoft. NET WSDL Implementation, you must edit the file S, IBM Web Services Toolkit generates so, the. NET environment can read them in.

Note:the. NET environment can handle WSDL imports. However, the WSDL that the IBM Web Services Toolkit generates improperly uses the targetnamespace attribute and Incorrectl Y references other internal elements (specifically, the <binding>, <message>, and <portType> elements). The easiest and quickest approach are to merge and edit the files as follows:
Copy both. wsdl files to your computer.


Open the service file, and delete the <import> element.


Open the interface file, and copy all of the elements except for the <definitions> tags. Paste these elements into the service file above the <service> element.


In the <portType> element, append the "TNS:" String to the "message attribute values on the <input> and <out put> child elements.


In the <binding> element, append the "TNS:" string to the type attribute value.


In the <service> element, append the "TNS:" The "binding" and "Name attribute", "the <port> chil D element.


For the Root-level <definitions> element, set xmlns:xsd namespace to reference Http://www.w3.org/2001/XMLSchema URI (That's, change "1999" to "2001").


Back to the top
Create the Proxy
To create the proxy, your can use either of the following methods:
Use the Wsdl.exe tool, and include the file in a project.
Create a Web reference from within the Microsoft Visual Studio. NET Integrated Development Environment (IDE).
After the "You" create the proxy, you can use the proxy as your would any other Microsoft. NET class.

Back to the top
Use the Wsdl.exe Tool to Create the Proxy
From the "Start" menu, point to Programs, point to Microsoft Visual Studio. NET, point to Visual Studio. NET Tools, and T Hen click Visual Studio. NET Command Prompt.


At the command prompt, browse to the folder that contains the edited. wsdl file.


Type the following command to produce a Microsoft Visual C #. NET language file, can include in your project:
WSDL Java class name _service.wsdl
If you are want Wsdl.exe to create the proxy in a different language, use The/language switch as follows:


For Microsoft Visual Basic. NET, use the following command:


WSDL Java class Name_service.wsdl/language:vb
For Microsoft JScript. NET, use the following command:


WSDL Java class Name_service.wsdl/language:js
For Microsoft C #. NET, use the following command:


WSDL Java class Name_service.wsdl/language:cs
To obtain this information, as the other options, type WSDL/? At the command prompt.

Back to the top
Use the Visual Studio. NET IDE to Create the Proxy
In Visual Studio. NET, from the Project menu, click Add Web Reference.


In the "Add Web Reference dialog box, in the" Address combo box, type the "path to" the local copy of the Java class name _ser VICE.WSDL file, and then click the arrow button next to the combo box.


Click Add Reference. This is produces a file in the project language and automatically includes the file in your project.


The Third-party products discussed at this article are manufactured by vendors independent of Microsoft; We make no warranty, implied or otherwise, regarding this products ' performance or reliability.

Back to the top



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.