Page 1 of 1

JAX-WS RI annotations

Posted: Tue Nov 11, 2014 4:55 am
by mujahed
Hi,

I am getting confused with the usage of annotations and preference that has if we use them on interface or service implementation bean.

For instance I found that SOAPBinding annotation if used to indicate that Style is RPC on interface and deployed on liberty app server generates a wsdl that has no effect of the RPC annotation, but if we use the annotation on class that wsdl generated is correct. So, to explain more clearly:

If I use below annotation on interface:

Code: Select all

@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
Than the generated wsdl:

Code: Select all

<definitions  .. >
  <types>
    <xsd:schema>
       <xsd:import namespace="com.masood" schemaLocation="http://localhost:9080/webservices/hello?xsd=1"/>
     </xsd:schema>
   </types>

....
<binding ..>
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
..... 
  <soap:body use="literal"/>
  </input>
  <output>
<soap:body use="literal"/>
..
</definitions>
as we can see that although we indicated that we want rpc but soap binding style is document and there is a types section. If I mark this on the SIB than i get the correct WSDL.

So the question is:
1. if my observation i.e. annotation if marked on interface doesnt effect the wsdl is correct than why does this link states we can mark soapbinding on interface or class: https://jax-ws.java.net/nonav/2.2/docs/ ... ng|outline

2. Can you please highlight the other jax-ws annotation that has effect only if they are marked on SIB and has no effect if they are marked on interface. is there a clear document which states this?

Thank you.
Mujahed

Re: JAX-WS RI annotations

Posted: Tue Nov 11, 2014 7:56 am
by fjwalraven
Unfortunately there is not one document stating this.

The best way is to check the specifications.

In this case, JSR-181, specifies that it can be used on class and interface level:
6.1 Operation Modes
JSR-181 implementations are REQUIRED to support the following WS-I compliant
operation modes:
· Operations with the rpc style and literal use (rpc/literal)
· Operations with the document style and literal use (document/literal).
Implementations MAY optionally support operation modes with the encoded use (document or rpc style). The developer MAY indicate which operation mode is in effect by specifying the appropriate @SOAPBinding.style and @SOAPBinding.use annotations at the class or interface level.
Regards,
Frits