Use eclipse to create a simple WebService client and use WSDL for sending text message Interfaces

Source: Internet
Author: User

Use tools: eclipse Standard Edition, without any plug-ins.

Procedure:

XxxxLocator service = java.net. URL url = java.net. URL ("URL? WSDL "xxxxStub stub = String x2 = stub. sendMessageFunction ("String", "String" }}} new test class

Extension:

In fact, you can not only create a java project, but also create a Dynamic Web Project, but more people use it for the C/S architecture;

Attached to the previous article about various WebServices: Summary of various methods for java to call webService

Postscript:

I have read a lot of information online, but I have limited capabilities and various frameworks. If there is a problem or not, the following reasons may occur:

XFire: In eclipse plugin, xfire prompts "UnsupportedOperationException ()" exception in the xxxxImpl class. As a result, the progress is changed for half a day without any progress!

CXF: After using Apache's latest CXF2.7.6 and getting started with wsdl2java. bat,

Cmd to the bat file directory

Run: set JAVA_HOME = "E: \ Progra ~ 1 \ Java \ jdk1.7.0 _ 05"

Run: call wsdl2java. bat "URL? Wsdl"

In this way, the java code of the webservice client can be automatically generated, !, "WSDLToJava Error: Rpc/encoded wsdls are not supported with CXF ";

Axis: SAOP: Now let's look at the Axis1.x and Axis2.x examples!

It's easy to learn.

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.