Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

How TO Create JBoss 4.2 Web service client using Netbeans 6.

Posted on http://m-shaheen.blogspot.com

Contributed by me on http://wiki.netbeans.org/JbossWebService

Since JDK 1.6 is not officially supported by JBoss 4.2, so usage of Netbeans 6.5 IDE
to create web service client will not work, below is the solution of that JBoss issue :

1. Create java artifacts from WSDL file

wsconsume tool is then used to consume this contract, and produce


annotated Java classes (and optionally sources) that define it.

Type command :

JBOSS_HOME\bin\wsconsume –t 2.0 –k {wsdl location}

2. Move the generated files form JBOSS_HOME\bin\out dir to netbeans src dir

3. In the client code write :

import echo.*;

public class EchoClient


{
public static void main(String args[])
{
if (args.length != 1)
{
System.err.println("usage: EchoClient <message>");
System.exit(1);
}

EchoService service = new EchoService();


Echo echo = service.getEchoPort();
System.out.println("Server said: " + echo.echo(args[0]));
}
}

References:

http://jbossws.jboss.org/mediawiki/index.php?title=JBossWS_JAX-WS_Tools

You might also like