Java calls the WSDL interface

Source: Internet
Author: User
Tags wsdl

Premise:

The ① already provides a WSDL interface

② the interface can be called normally

Step 1: generate a local class using the cxf wsdl2java Tool

Download CXF: http://cxf.apache.org/download.html

To configure environment variables:

cxf_home=e:\webservice\cxf\apache-cxf-2.1.1\apache-cxf-2.1.1

add ";%cxf_home%\bin" after PATH

Verify: The cmd command line is entered Wsdl2java, and if it shows its usage, the configuration is OK.

Run command: wsdl2java http://localhost:8080/XXX.wsdl ( Path to WSDL)

Class that will be generated for use at the current path of the Run command after running

Step 2: Import the generated Java class file into our project to see its structure.

In general, the service is called Xxxservice, this is our most concerned about the interface file

Step 3: View The document structure of the service

Red Box Two methods one is to instantiate the service method, one is to invoke the specific interface method



Step 4: Write the tool class to test the interface invocation situation



Java calls the WSDL interface

Related Article

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.