JAX-WS Client Side
JAX-WS is designed in such a way that for the client the service invocation is similar to a local java method call.JAX-WS uses the SEI(Service End Point Interface). A dynamic proxy is created at runtime which handles the service invocation. JAX-WS does not uses stubs as its predecessor JAX-RPCLet's use the web service hosted by JAX-WS Start From WSDL-doc style. Make a Java project and generate the code using wsimport utility. In Java 6+ the wsimport utility comes with the JDK. If your java is configured in the path, wsimport can be invoked at the command line.
wsimport.sh -keep -s <source folder> -d <class folder> http://localhost:8080/JAX_WS_Servlet/TemperaturConvertor?wsdl![]()
Change the WSDL location as per your configuration. This will generate the JAXB mapping and the Service endpoint. Put the jars in Metro download (lib folder). Call the service from the main method.
TemperatureConvertorService service = new TemperatureConvertorService(); TemperatureConvertor port = service.getPort(TemperatureConvertor.class); TemperatureCelsius celsius = new TemperatureCelsius(); celsius.setReturn(100.0); TemperatureFar fahr = port.celsiusToFarenheitOp(celsius); System.out.println(fahr.getReturn());
For the client of RPC style services, again run the wsimport against RPC style wsdl. This will again generate the artifacts. Now from the main method call the service as follows:
TemperatureConvertorServiceRPC service = new TemperatureConvertorServiceRPC(); TemperatureConvertorRPC port = service.getPort(TemperatureConvertorRPC.class); Holder<Double> fahr = new Holder<Double>(); fahr.value = 212.0; port.farenheitToCelsiusOp(fahr); System.out.println(fahr.value);
Back to JAX-WS Index
Back To Java Home
Back To Home
Sidebar
Last wiki comments
- AOP: Thanks
- Lalit Bhatt: Superb Collection
- Lalit Bhatt: J2EE training
- Introduction to ORM: timberland shoes
- Introduction to ORM: jordan shoes
- Introduction to ORM: nike air max
- Pune Tourist Spots: KONARK PARK CLOSED
- jQuery Form Validations: Jquery Developer
- Spring Introduction: RG
- SOAP: Re: Assertion
Sidebar
Random Pages
- Comprehensive Overview of Java Technologies
- SOAP
- Pune Hill Forts For Trekking
- Windows Antivirus
- Source Code Control Systems
- JavaFX Data Binding and Trigger
- Introduction to Seam
- CSS - Handling Browser Moods
- Parsers Introduction
- Spring Annotation driven Aspects
- JAXB Validation using Schema
- Spring POJO Aspects
- What markets work on?
- Why projects fail?
- Bharat Band - Jai ho
- The concept of Nation
- Don't hide complexity if it cannot be handled in a robustway
Last blog post comments
-
Bharat Band - Jai ho: How do we protest?
Wed 18 of Aug., 2010 13:13 IST
-
Divided by Destiny: Contact
Fri 23 of July, 2010 16:02 IST
-
Future of Java: thesis writing
Sat 17 of July, 2010 01:50 IST
-
Hang till Death Mr. Kasab: some change
Mon 28 of June, 2010 16:03 IST
-
God Religion : Why we are confused?: Re: Is GOD Necessary?
Tue 15 of June, 2010 17:29 IST
-
God Religion : Why we are confused?: Is GOD Necessary?
Tue 15 of June, 2010 13:06 IST
-
The reason in religion: good
Wed 10 of Mar., 2010 18:30 IST
-
The confusion of Design Patterns: I think at macro level you are right...
Tue 23 of Feb., 2010 03:31 IST
-
The Indian Municipality: Comment
Fri 22 of Jan., 2010 13:20 IST
-
What Government should do?: Re: Review of the Indian Law and Order and Justice Dispensation regime.
Fri 22 of Jan., 2010 13:16 IST
Post new comment