Distinction and use of CXF Wsdl2java commands and JDK wsimport commands

Source: Internet
Author: User
Tags wsdl

The JDK provides a wsimport.exe command that is used primarily to generate client code for WebService and then invoke WebService.

Wsimport is based on jdk1.6.0_21 and above the generated local code, it can only resolve the server-side SOAP protocol is 1.1, can not resolve the SOAP1.2 protocol. If parsing SOAP1.2 will parse incomplete.

Usage: If you have already configured the JDK for the PATH environment variable C:\Documents and settings\administrator>wsimport-s f:\-P com.client.jdk.wsimporthttp:// localhost:1111/hello?wsdl

-S to specify the path to the build file, the-P custom class package http://localhost:1111/hello?wsdl is the path to the WSDL.

CXF also provides command Wsdl2java.exe to generate client code from WSDL. It is based on the local code generated by jdk1.7, so you need to make a little change to the generated code.
It can support the SOAP1.1 and SOAP1.2 protocols. The premise is that you have already downloaded the Apache CXF and configured the Wsdl2java.exe for the PATH environment variable.

Usage: C:\Documents and settings\administrator>wsdl2java-d f:\-P COM.CLIENT.CXF http://localhost:1111/hello?wsdl

-d Specifies the path to the build file, the-P custom class package http://localhost:1111/hello?wsdl is the path to the WSDL.

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.