I. INTRODUCTION
This article introduces the technology of mutual calls between Web Services developed by Java and. NET. This article consists of two parts: the first part describes how to use. NET as a client to call Web Services written in Java, and the second part describes how to use Java as a client to call Web Services developed by. NET.
II. Tools required by the project
Windows2000 Server (IIS)
Jbuilder9.0 (including Tomcat and axis)
JDK1.4 + Java Web Services Develop
VS. Net 2003
Note: If JBuilder is not available, you need to download and install the Tomcat4.1 and Axis development kits and configure them accordingly. Since there are many such articles on the Internet, I will not describe them here.
III. Use. NET as a client to call Web Services written in Java
1. Generate a Java Web Services
Using JBuilder to generate a Web service is very simple. I do it with its help, as long as I do it step by step.
You can proceed. The specific path is Developing Web Services-> tutorials: Web Services (Axis)-> Creating a simple Web Services
2. Publish this Web service and obtain its WSDL
After Web Services are generated, F9 runs the project. Then, click View to browse the existing Web service and click Bean1's WSDL connection. We can View its WSDL description in the browser. Copy the WSDL address in the address bar of the browser to prepare for the next step of using the. NET development client to call the program.
3. Use VS. NET to generate a. NET client.
Create a project (either WinForm or ASP.net). Here I use an Asp. Net project. On the start page, place a text input box to display the result of calling Web Services, and place a button to click to call Web Services. Then, select "Add Web reference" and copy the obtained WSDL address in the "WSDL" column. Enter the Web reference name "erervice" and click "Add Reference. In this case, we can see this Web reference in Solution Explore of VS.net.
Enter the following code in the button clicking event:
Assumervice. Bean1 bean = new assumervice. Bean1 ();
TextBox1.Text = bean. getSample. ToString ();
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.