Java CXF calls the WebService interface written by. Net

Source: Internet
Author: User

The new company's first job is to invoke the WebService interface written by the previous. NET program in the Java environment.

The interface returns a JSON-formatted data

Because all said WebService cross-language, originally thought is a simple rough work, found that is not the case, the. NET generated WSDL file format Some tags are not known in the Java environment, need to re-edit the next WSDL file.

First, unzip the downloaded CXF the latest version of the compressed package, DOS window down to the Bin directory, and then execute

Wsdl2java-p ws HTTP://192.168.1.137:8007/CIS_SERVER.ASMX?WSDL

Found an error Wsdltojava Error:thrown by jaxb:undefined Element declaration ' S:schema '

The reason is that Java parsing WSDL does not recognize <s:element ref= "S:schema"/><s:any/>

The workaround is to open the http://192.168.1.137:8007/CIS_Server.asmx?wsdl on the browser

The ctrl+s is then saved locally, replacing the <s:element ref= "S:schema"/><s:any/> In the local WSDL with <s:any minoccurs= "2" maxoccurs= "2"/ >

Execution Wsdl2java points to a locally saved WSDL file to generate the corresponding program file

Java CXF calls the WebService interface written by. Net

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.