users@jax-ws.java.net

Re: knowns Issues with JAX-WS and apt and multiples services using parameterStyle=SOAPBinding.ParameterStyle.BARE ?

From: Anne Thomas Manes <atmanes_at_gmail.com>
Date: Sat, 7 Apr 2007 07:55:58 -0400

When using document/literal with multiple parameters, you must use
WRAPPED. A document style message may have at most one child element
in the SOAP Body. If you specify WRAPPED, then JAX-WS generates a
wrapper element for your parameters. If you specify BARE, then the
parameters are not wrapped and appear as direct children of the SOAP
Body (not allowed).

Anne

On 3/20/07, Henri Gomez <henri.gomez_at_gmail.com> wrote:
> Hi to all,
>
> I've got an eclipse project where I defined many Services like this :
>
> ReferentialService .java
>
> package com.mycorp.soa.referential.services;
>
> @WebService(targetNamespace="http://www.mycorp.com/soa/referential/services/v1/",
> name = "ReferentialService", serviceName = "ReferentialService")
> @SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
> use=SOAPBinding.Use.LITERAL,
> parameterStyle=SOAPBinding.ParameterStyle.BARE)
> public class ReferentialService {
>
> /***
> * @param tracker
> * @param criteria
> * @return
> * @throws ReferentialException
> */
> @WebMethod(action="getListType")
> @WebResult(name="types")
> public TypeValeurParCodeResponse getListType(
> @WebParam(name = "tracker", header = true) Tracker tracker,
> @WebParam(name = "pager") Pager pager
> ) throws ReferentialException
> {
> ...
> }
> }
>
> ....
>
> ValorService .java
>
> package com.mycorp.soa.valor.services;
>
>
> @WebService(targetNamespace="http://www.mycorp.com/soa/valor/services/v1/",
> name = "ValorService", serviceName = "ValorService")
> @SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
> use=SOAPBinding.Use.LITERAL,
> parameterStyle=SOAPBinding.ParameterStyle.BARE)
> public class ValorService
> {
> /***
> * Retourne une liste de codifications
> *
> * @param tracker
> * @param CodificationsRequest
> * @return CodificationsResponse
> * @throws ValorException
> */
> @WebMethod(action="getCodes")
> @WebResult(name="codes")
> public CodificationsResponse getCodes(
> @WebParam(name = "tracker", header = true) Tracker tracker,
> @WebParam(name = "codificationsRequest") CodificationsRequest request
> ) throws ValorException
> {
> }
> }
>
>
> When I used parameterStyle=SOAPBinding.ParameterStyle.WRAPPED for both
> Service, it worked without any problem.
>
> Now that I switched to parameterStyle=SOAPBinding.ParameterStyle.BARE,
> I get apt errors unless I exclude valor or referential (like this ..)
>
> <apt fork="true" debug="${debug}" verbose="${verbose}"
> destdir="${build.classes.dir}" sourcedestdir="${build.classes.dir}"
> sourcepath="${basedir}/src">
> <classpath>
> <path refid="jaxws.classpath" />
> <pathelement location="${basedir}/src" />
> </classpath>
> <option key="r" value="${build.dir}" />
> <source dir="${basedir}/src">
> <include name="**/*.java" />
> <exclude name="**/referential/**" />
> </source>
> </apt>
>
> <apt fork="true" debug="${debug}" verbose="${verbose}"
> destdir="${build.classes.dir}" sourcedestdir="${build.classes.dir}"
> sourcepath="${basedir}/src">
> <classpath>
> <path refid="jaxws.classpath" />
> <pathelement location="${basedir}/src" />
> </classpath>
> <option key="r" value="${build.dir}" />
> <source dir="${basedir}/src">
> <include name="**/*.java" />
> <exclude name="**/valor/**" />
> </source>
> </apt>
>
> This hack didn't help me when under Eclipse where I couldn't tuned the
> annotation generation. Also I wonder why I should exclude referential
> or valor when using SOAPBinding.ParameterStyle.BARE since I didn't
> have to do before ?
>
> Did someone else encoutered such problem or had an idea ?
>
> I'm using (JAX-WS RI 2.1-02/02/2007 03:56 AM(vivekp)-FCS)
>
>
> thanks for you help
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>
>