In JAX-RPC the service and clients have to have proxies (Skeletons at service and Stubs at client) to establish the communication, because Bindings and parsings are proproitery and deployment descriptors are required during execution/runtim.
Since JDK1.5 has come up with annotations that enable JEE5.0 to arrive with new feature (a dynamic proxy generation) during execution time which eliminated stubs, skeletons generation and deployment descriptors.
The Dynamic Proxy client is dynamically generated at run time using the Java 5 Dynamic Proxy functionality, while the JAX-RPC-based stub client is a non-portable Java file that is generated by tooling. Unlike the JAX-RPC stub clients, the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor because the generated interface does not require the specific vendor information.
To minimize the developer effort to create webservice and client, I've created a sample maven-archetype that uses jaxws-maven-plugin from org.apache.maven.plugins. The archetype creates a sample webservice (AppWS) with one method (sayHello) and client (AppWSClient) to access the service.
Junit test cases are also provided to prove service and clients and tested are successfully.
Please follow below steps to feel the webservice and client creation using JAX-WS.
Assumptions: Any IDE (I've used NetBean6.8) is preferred that allows to develop JEE1.5 applications on Maven, ANT and any JEE 5 server (Ex. Glassfish V2 orV3 or WAS7.0 and WAS6.1 with JAXWS enabled).
1. Download and extract mycompany-archetype-j2ee1.5-jaxws.rar into local machine
2. Run mvn (assuming Maven 2.x is installed)
3. Notice mycompany-archetype-j2ee1.5-jaxws-1.0.jar created in local maven2 repository (Ex. USERHOME/.m2\repository\org\mycompany\archetypes\mycompany-archetype-j2ee1.5-jaxws\1.0 )
4. Add this new archetype to USERHOME/.m2/archetype-catalog.xml)
Creating a Project from mycompany-archetype-j2ee1.5-jaxws(1.0)
5. Create a new project (ex. jaxwsSample1) from this archetype
6. Click on 'Next' button to select this archetype
8. Click on 'Finish' to see 4 projects getting created from archetype
Maven main/parent project that has web project (jaxwsSample1WS), ear project (jaxwsSample1WSEAR) and Webservice client jar(jaxwsSample1Client)
9. Right Click on jaxwsSample1 project and select 'Set as Main Project'. This is only for NetBeans. As pom.xml of jaxwsSample1 has the information of other 3 projects as modules, a clean,build and install goals on this project builds the other 3 projects too.
IRAD7.5 has some difficulties in identifying maven enabled parent-child projects.
14. Click on 'OK" button deploy
15. Verify to access the deployed application at http://localhost:8080/jaxwsSample1/AppWSService?wsdl . The server and port can be different in your scenario. If there is no error (404, 500 or 403) then see view source of page using context-menu on page.
16. Open pom.xml for client and refer to use wsdl provided by WebService running in server.
The client can use .wsdl file available with source of service or obtain while service is running.
In production (not demo) version it is recommended to copy .wsdl file into client source instead of obtaining from server.
17a. Now rebuild all the projects or just client. Please move to Netbeans to select jaxwsSample1Client as Main Project to build only client