You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Janvier F <jm...@hotmail.com> on 2009/09/22 11:19:52 UTC

My service is running only the first operation

Hi people,
I am new to CXF and I would to setup a simple service with two operations add and subtract.
My service interface is as follow :
@WebService (name="PlusMinusService")@SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)public interface PlusMinus {
	@WebMethod(operationName="add")	@RequestWrapper(className="java.lang.Double")	@ResponseWrapper(className="java.lang.Double")  	public Double add(@WebParam(name="leftParam", mode=Mode.IN) Double left, 					  @WebParam(name="rightParam", mode=Mode.IN) Double right);		@WebMethod(operationName="subtract")	@RequestWrapper(className="java.lang.Double")	@ResponseWrapper(className="java.lang.Double")  	public Double subtract(@WebParam(name="leftParam", mode=Mode.IN) Double left, 					  @WebParam(name="rightParam", mode=Mode.IN) Double right); 	}
When I call the second operation from the client (for example client.subtract(1.2, 1.4)) it is the operation add that is called. If i remove the operation add from the interface then the correct operation is called.
Could anyone please tell me what is wrong here? I will appreciate your replies very much.
Regards,
J. 		 	   		  
_________________________________________________________________
Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !
http://www.microsoft.com/windows/windowslive/default.aspx

RE: My service is running only the first operation

Posted by Janvier F <jm...@hotmail.com>.
Dear Anne,
Thank you so much for your suggestions. I give different names to the operation and things are fine now.
Thank you so much indeed

> Subject: Re: My service is running only the first operation
> Date: Tue, 22 Sep 2009 11:46:57 +0200
> From: anne.diefenbach@fkie.fraunhofer.de
> To: users@cxf.apache.org
> 
> Hi,
> 
> I'd suspect that both your operations use the same message, in which case CXF can't distinguish between them. Perhaps check the generated WSDL. If that's the case, you will probably have to use different parameter names for your two operations (I'm not sure, I've always built the WSDL first).
> 
> Regards,
> 
> Anne
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Janvier F [mailto:jmfansi@hotmail.com]
> > Gesendet: Dienstag, 22. September 2009 11:20
> > An: users@cxf.apache.org
> > Betreff: My service is running only the first operation
> > 
> > 
> > Hi people,
> > I am new to CXF and I would to setup a simple service with two operations
> > add and subtract.
> > My service interface is as follow :
> > @WebService (name="PlusMinusService")@SOAPBinding(style=Style.DOCUMENT,
> > use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)public interface
> > PlusMinus {
> > 	@WebMethod(operationName="add")
> > 	@RequestWrapper(className="java.lang.Double")
> > 	@ResponseWrapper(className="java.lang.Double")  	public Double
> > add(@WebParam(name="leftParam", mode=Mode.IN) Double left,
> > 			  @WebParam(name="rightParam", mode=Mode.IN) Double
> > right);		@WebMethod(operationName="subtract")
> > 	@RequestWrapper(className="java.lang.Double")
> > 	@ResponseWrapper(className="java.lang.Double")  	public Double
> > subtract(@WebParam(name="leftParam", mode=Mode.IN) Double left,
> > 			  @WebParam(name="rightParam", mode=Mode.IN) Double
> > right); 	}
> > When I call the second operation from the client (for example
> > client.subtract(1.2, 1.4)) it is the operation add that is called. If i
> > remove the operation add from the interface then the correct operation is
> > called.
> > Could anyone please tell me what is wrong here? I will appreciate your
> > replies very much.
> > Regards,
> > J.
> > _________________________________________________________________
> > Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
> > Lancez-vous !
> > http://www.microsoft.com/windows/windowslive/default.aspx
 		 	   		  
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

Re: My service is running only the first operation

Posted by Diefenbach Anne <an...@fkie.fraunhofer.de>.
Hi,

I'd suspect that both your operations use the same message, in which case CXF can't distinguish between them. Perhaps check the generated WSDL. If that's the case, you will probably have to use different parameter names for your two operations (I'm not sure, I've always built the WSDL first).

Regards,

Anne

> -----Ursprüngliche Nachricht-----
> Von: Janvier F [mailto:jmfansi@hotmail.com]
> Gesendet: Dienstag, 22. September 2009 11:20
> An: users@cxf.apache.org
> Betreff: My service is running only the first operation
> 
> 
> Hi people,
> I am new to CXF and I would to setup a simple service with two operations
> add and subtract.
> My service interface is as follow :
> @WebService (name="PlusMinusService")@SOAPBinding(style=Style.DOCUMENT,
> use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)public interface
> PlusMinus {
> 	@WebMethod(operationName="add")
> 	@RequestWrapper(className="java.lang.Double")
> 	@ResponseWrapper(className="java.lang.Double")  	public Double
> add(@WebParam(name="leftParam", mode=Mode.IN) Double left,
> 			  @WebParam(name="rightParam", mode=Mode.IN) Double
> right);		@WebMethod(operationName="subtract")
> 	@RequestWrapper(className="java.lang.Double")
> 	@ResponseWrapper(className="java.lang.Double")  	public Double
> subtract(@WebParam(name="leftParam", mode=Mode.IN) Double left,
> 			  @WebParam(name="rightParam", mode=Mode.IN) Double
> right); 	}
> When I call the second operation from the client (for example
> client.subtract(1.2, 1.4)) it is the operation add that is called. If i
> remove the operation add from the interface then the correct operation is
> called.
> Could anyone please tell me what is wrong here? I will appreciate your
> replies very much.
> Regards,
> J.
> _________________________________________________________________
> Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
> Lancez-vous !
> http://www.microsoft.com/windows/windowslive/default.aspx

Re: My service is running only the first operation

Posted by Daniel Kulp <dk...@apache.org>.
BTW: if you want this service to be WSI-Basic Profile compliant (and thus 
interopable) you would probably want to keep it WRAPPED, not BARE.  With BARE, 
you are ending up with two child elements of the soap:body (two element 
message parts in the wsdl),  which isn't a "norm". 

Dan



On Tue September 22 2009 5:19:52 am Janvier F wrote:
> Hi people,
> I am new to CXF and I would to setup a simple service with two operations
>  add and subtract. My service interface is as follow :
> @WebService (name="PlusMinusService")@SOAPBinding(style=Style.DOCUMENT,
>  use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)public interface
>  PlusMinus {
>  @WebMethod(operationName="add")	@RequestWrapper(className="java.lang.Doubl
> e")	@ResponseWrapper(className="java.lang.Double")  	public Double
>  add(@WebParam(name="leftParam", mode=Mode.IN) Double left, 					 
>  @WebParam(name="rightParam", mode=Mode.IN) Double
>  right);		@WebMethod(operationName="subtract")	@RequestWrapper(className="j
> ava.lang.Double")	@ResponseWrapper(className="java.lang.Double")  	public
>  Double subtract(@WebParam(name="leftParam", mode=Mode.IN) Double left,
>  					  @WebParam(name="rightParam", mode=Mode.IN) Double right); 	} When I
>  call the second operation from the client (for example
>  client.subtract(1.2, 1.4)) it is the operation add that is called. If i
>  remove the operation add from the interface then the correct operation is
>  called. Could anyone please tell me what is wrong here? I will appreciate
>  your replies very much. Regards,
> J.
> _________________________________________________________________
> Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
>  Lancez-vous ! http://www.microsoft.com/windows/windowslive/default.aspx
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog