. Net calls the WebService written in Java [original]

Source: Internet
Author: User

Recently, an application that uses. Net to call a WebService written in Java.ProgramProvide a file with the suffix "WSDL. the WSDL file generated in. NET is similar. I checked some information at first, knowing that I can compile this WSDL file into a dynamic library and call it directly, that is, generate a proxy, this is often used in the past. net's WebService description address for compilation seems to be almost the same, so I tried to write this, but it can basically be implemented.
The basic format is as follows:
Wsdl.exe/L: CS/N: nhws/out: C:/nhws. cs c:/isws. WSDL
Run the vs command line command to implement

Then, through communication, I also asked for the description address of the WSDL file, similar to the description address of. net, except that the file Suffix of Java is. JWS and. NET is. asmx.
Comparison
[Net] http: // 110.11.4.5/website1/service. asmx? WSDL
[Java] http: // ***. ***/website1/service? WSDL or http: // ***. ***/website1/service. JWS? WSDL
However, this is only my situation. I am not familiar with Java. the WebService address provided by Java is only one of its technologies. I don't know Java.

use. net can also call the Java address in many ways, basically with the call.. net addresses are the same.
(1) Add a WebService reference to the project. You can use the Wizard to complete the process.
(2) for ease of use, use the following two commands to compile the Java WebService description address into a dynamic library and use
A to generate a class file
wsdl.exe/L: CS/N: NWS/out: C:/NWS. CS http ://***. ***. **. **/website1/service? WSDL
B: Compile the class file into a dynamic library
CSC/Target: Library/out: "C: \ NWS. DLL "C: \ NWS. CS
the subsequent use is the same
but pay attention to the following two questions:
(1) Describe the final parameters of the address? WSDL is sometimes indispensable. It is best to add it, because what you ultimately need to compile is the WSDL file
(2)wsdl.exe is a tool provided by Microsoft, in the vs command, you can call it directly. Here, remember/N: testws, that is, testws, a namespace you define in/namespace: testws,

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.