HOW TO: BETA: Integrate a .NET Client with an Apache SOAP 2.2 XML Web Service

來源:互聯網
上載者:User
apache|client|web|xml HOW 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 article discusses a Beta release of a Microsoft product. The information in this article is 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 see the documentation included with the Beta product files, or check the Web location from which you downloaded the release.
IN 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 a .NET client with an Apache SOAP 2.2-based Web service. This article assumes that a Web Services Description Language (WSDL) file exists and was created by using the IBM Web Services Toolkit.

back to the top

Requirements
This article assumes that you 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 first file contains the 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 files that the IBM Web Services Toolkit generates so that 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 incorrectly references other internal elements (specifically, the <binding>, <message>, and <portType> elements). The easiest and quickest approach is 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 <output> child elements.


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


In the <service> element, append the "tns:" string to the binding and name attribute values on the <port> child element.


For the root-level <definitions> element, set xmlns:xsd namespace to reference http://www.w3.org/2001/XMLSchema URI (that is, change "1999" to "2001").


back to the top
Create the Proxy
To create the proxy, you 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 you create the proxy, you can use the proxy as you 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 then 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 that you can include in your project:
wsdl Java class name _Service.wsdl
If you 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 well as 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 _Service.wsdl file, and then click the arrow button next to the combo box.


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


The third-party products discussed in this article are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

back to the top



相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。