Page 1 of 1
Mixing document and RPC styles
Posted: Thu Nov 28, 2013 5:28 pm
by socialguy
I'm wondering if document and RPC styles can both be used for an endpoint? The WSDL allows you to configure it for each operation using <soap:operation style="rpc" />, so it looks theoretically possible, but wsimport complains that
Ignoring port "Calculator", its not WS-I BP 1.1 compliant: the wsdl binding has mixed style, it must be rpc-literal or document-literal operation. try running wsimport with -extension switch.
Re: Mixing document and RPC styles
Posted: Fri Nov 29, 2013 2:09 am
by fjwalraven
No that is not possible.
The restriction comes from JAX-WS 2.2:
The javax.jws.SOAPBinding annotation MAY be used to specify at the type level which style to use for all methods it contains or on a per method basis if the style is document.
and JSR-181:
The annotation may be placed on a method if and only if the SOAPBinding.style is DOCUMENT. Implementations MUST report an error if the SOAPBinding annotation is placed on a method with a SOAPBinding.style of RPC. Methods that do not have a SOAPBinding annotation accept the SOAPBinding behavior defined on the type.
So in your case when you start from WSDL-to-Java, the following rule (Conformance (
Using javax.jws.SOAPBinding)) applies:
An SEI mapped from a port type that is bound using the WSDL SOAP binding MUST be annotated with a javax.jws.SOAPBinding annotation describing the choice of style, encoding and parameter style. The annotation MAY be omitted if all its properties would have the default values (i.e. document/literal/wrapped).
JAX-WS cannot generate a SEI that does not follow the rules of JSR-181 and will generate an error.
Basic Profile v1.1 has been explicit in this case:
The style, "document" or "rpc", of an interaction is specified at the wsdl:operation level, permitting wsdl:bindings whose wsdl:operations have different styles. This has led to interoperability problems.
R2705 A wsdl:binding in a DESCRIPTION MUST either be a rpc-literal binding or a document-literal binding.
Regards,
Frits
Re: Mixing document and RPC styles
Posted: Fri Nov 29, 2013 3:17 am
by socialguy
Thank you. I'm glad to have asked the first question in this forum

Re: Mixing document and RPC styles
Posted: Fri Nov 29, 2013 12:38 pm
by fjwalraven
Welcome!
