Creating a Webservice-Client using the “maven-jaxws-tools-plugin”

Creating a Webservice-Client using the JBoss Maven Plugin is pretty straight forward.
Create a new Maven Project and make sure the pom.xml looks like this and the JBoss Maven Repository (including snaphshots) is added in your settings.xml.


The path in the <wsdl></wsdl> Tag should point to an actual existing/vaild WSDL location. In the src/resources/META-INF Folder add standard-jaxws-client-config.xml, wich should have the following entries:

<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
              	xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">

      <config-name>Standard WSSecurity Client</config-name>


The goal “wsconsume” will create all necessary Proxy- and DTO-Classes
to use the Webservice in the folder src/main/java. Check that there is a “” Class in the specified target package. Create a new instance of this Class and invoke desired methods. Assuming the Webservicename was HelloService, you can then invoke a method like the “sayHello”-Method of the HelloWebservice like this:

package de.test.main;

import de.test.generated.classes.HelloService;

public class CallWebservice {
  public static void main(String[] args) {    
    HelloService service = new HelloService();

About javacodeblog

J2EE Developer
This entry was posted in Webservice Client and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s