java - What is difference Javax.jws and javax.xml.ws -


i new java , trying jump webservices. found 2 examples somewhere , confused available options.

firstly, javax.jws.webservice annotation seem work fine there loads of material on javax.xml.ws. difference between these 2 approaches. seems javax.jws newer , there not material available on same. please throw light.

thanks , regards

web services metadata annotations (jsr 181)

using annotations jsr 181 specification (java.jws.xxx), can annotate web service implementation class or web service interface.

e.g. deploy jax-ws web services on tomcat

package com.mkyong.ws;  import javax.jws.webmethod; import javax.jws.webservice; import javax.jws.soap.soapbinding; import javax.jws.soap.soapbinding.style;  //service endpoint interface @webservice @soapbinding(style = style.rpc) public interface helloworld{      @webmethod string gethelloworldasstring();  } 

jax-ws 2.0 annotations (jsr 224)

the jsr 224 specification defines annotations jax-ws 2.0 (javax.xml.ws.xxx).

e.g. using soap faults , exceptions in java jax-ws

@webfault(name="checkverifyfault",     targetnamespace="http://www.example.com") public class checkverifyfault extends exception {      /**      * java type goes soapenv:fault detail element.      */     private checkfaultbean faultinfo;      public checkverifyfault(string message, checkfaultbean faultinfo) {         super(message);         this.faultinfo = faultinfo;     }      public checkverifyfault(string message, checkfaultbean faultinfo,                                 throwable cause) {         super(message, cause);         this.faultinfo = faultinfo;     }      public checkfaultbean getfaultinfo() {         return faultinfo;     } } 

peer reynders says:

my guess bea wanted put weblogic compete equivalent feature in .net. (see, developing web services in weblogic "as easy"). annotations specified in jax-ws 2.0 (jsr-224) seem provide more control. jsr-224 explicitly support/include jsr-181 (jsr-224: 7.10 annotations defined jsr-181).

for more complete discussion about, see jsr 181: java simplification request

see also:


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -