| By Deepak Vohra, Ajay Vohra | Article Rating: |
|
| June 27, 2007 03:00 PM EDT | Reads: |
22,589 |
Add a target build-client to the build.xml file to generate the client artifacts. Add a clientgen element to the target element. Specify type as JAXWS, destDir as output/clientclass, packageName as webservices.jaxws.client, and wsdl as http://localhost:7001/HelloWsImpl/HelloWsImplService?WSDL.
<clientgen type="JAXWS"
wsdl="http://localhost:7001/HelloWsImpl/HelloWsImplService?WSDL"
destDir="output/clientclass" packageName="webservices.jaxws.client"/>
Add javac elements to the target element to com-pile the client artifact Java classes and the Main.java client Java application. The build.xml file is listed below.
<project name="webservices-simple_client" default="all">
<taskdef name="clientgen"
classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
<target name="build-client"> <clientgen type="JAXWS"
wsdl="http://localhost:7001/HelloWsImpl/HelloWsImplService?WSDL"
destDir="output/clientclass" packageName="webservices.jaxws.client"/>
<javac srcdir="output/clientclass" destdir="output/clientclass" includes="**/*.java"/>
<javac srcdir="src" destdir="output/clientclass"
includes="webservices/jaxws/client/*.java"/></target>
</project>
Run the build-client target to generate the client artifacts and compile the Java classes.
C:\BEA\user_projects\webservices\simple_client> ant build-client
The client artifacts get generated and the Java classes get compiled. The output from the build-client target is shown in Figure 3.
Next, add a target to the build.xml file to run the client Java application Main.java. Add a target run. Also add a path element to specify the classpath to run the Main.java application. The classpath should include the output/clientclass directory that contains the client artifacts and the system property java.class.path. The modified build.xml file is shown below.
<project name="webservices-simple_client" default="all"> <taskdef name="clientgen"
classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
<target name="build-client"> <clientgen type="JAXWS"
wsdl="http://localhost:7001/HelloWsImpl/HelloWsImplService?WSDL"
destDir="output/clientclass" packageName="webservices.jaxws.client"/> <javac
srcdir="output/clientclass" destdir="output/clientclass" includes="**/*.java"/> <javac
srcdir="src" destdir="output/clientclass"
includes="webservices/jaxws/client/*.java"/></target>
<path id="client.class.path">
<pathelement path="output/clientclass"/> <pathelement
path="${java.class.path}"/> </path> <target name="run" >
<java fork="true"
classname="webservices.jaxws.client.Main"failonerror="true" >
<classpath refid="client.class.path"/> </java> </target>
</project>
Next, run the target run.
The Web Service operation hello() gets invoked with a String argument and the result returned by the Web Service gets output as shown in Figure 4.
Conclusion
WebLogic Server 10 Technical Preview
supports JEE 5 and the JAX-WS 2.0 Web Services. WebLogic server 10 also
provides Ant tasks jwsc and clientgen to generate the Web Service
artifacts and client artifacts.
Published June 27, 2007 Reads 22,589
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Deepak Vohra
Deepak Vohra is a Sun Certified Java 1.4 Programmer and a Web developer.
More Stories By Ajay Vohra
Ajay Vohra is a senior solutions architect with DataSynapse Inc.
![]() |
nayanj 10/26/07 02:49:39 PM EDT | |||
The example give in this article is too simple. Information given in this article can even be found in weblogic documentation.. so what additional value does this article? to me NIL. I would have appreciated a more realistic example where webservice is used along with other libraries like beehive controls and then see how you can jwsc to package this application into an .ear or .war. There are a bunch of cases in which jwsc gives warnings and errors and none of them seem to be discussed/explained in this article. |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?




































