users@jax-rpc.java.net

Re: Use of SOAPBinding.ParameterStyle.BARE causes wsimport error

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Wed, 27 Jul 2005 12:35:03 -0700

Kevin,

Can you use this forum for JAX-WS 2.0 and JAXB 2.0 topics.

http://forums.java.net/jive/forum.jspa?forumID=46

Thanks,
Jitu

Fung, Kevin [IT] wrote:

>Here is the implementation class:
>@WebService(name="BackOffice",
> targetNamespace="http://kf.com/backoffice",
> serviceName="BackOfficeService")
>@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
> use=SOAPBinding.Use.LITERAL,
> parameterStyle=SOAPBinding.ParameterStyle.BARE)
>public class BackOfficeImpl {
> @WebMethod
> @WebResult(name="TradeStatus")
> public TradeStatus submitTrade(
> @WebParam(name="trade")Trade trade)
> throws InvalidTradeException
> {...}
> @WebMethod
> @WebResult(name="Trade")
> public Trade getTrade(
> @WebParam(name="tradeID")int tradeID)
> {...}
>}
>
>wsimport was used to generate client classes. The following error was reported:
> [wsimport] C:\project\java\backoffice-jax-ws2-final\build\gen\java\com\kf\backoffice\client\ObjectFactory.java:89: createTrade(com.kf.backoffice.client.Trade) is already defined in com.kf.backoffice.client.ObjectFactory
>
>The generated ObjectFactory code has the following two methods with same name:
>
> /**
> * Create an instance of {_at_link JAXBElement<Trade> }}
> *
> */
> @XmlElementDecl(name = "trade", namespace = "http://kf.com/backoffice")
> public JAXBElement<Trade> createTrade(Trade value) {
> return new JAXBElement<Trade>(_Trade_QNAME, ((Class) Trade.class), null, value);
> }
>
> /**
> * Create an instance of {_at_link JAXBElement<Trade> }}
> *
> */
> @XmlElementDecl(name = "Trade", namespace = "http://kf.com/backoffice")
> public JAXBElement<Trade> createTrade(Trade value) {
> return new JAXBElement<Trade>(_Trade_QNAME, ((Class) Trade.class), null, value);
> }
>
>It seems one was generated from the submitTrade operation that accept a trade and the other was generated from the getTrade operation that returns a trade.
>
>This problem does not exist for the default SOAPBinding, which is SOAPBinding.ParameterStyle.WRAPPED
>
>Kevin Fung
>Sr. Architect
>GCAT Engineering
>Citigroup, Inc.
>kevin.fung_at_citigroup.com
>908-563-0546
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
>For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
>