axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From silver17 <silver...@hotmail.com>
Subject Which Annotations work in Axis 2.1.3?
Date Tue, 15 Apr 2008 03:06:13 GMT

Hi guys,

I've been experimenting with annotations and axis2 web services, and have
some degree of success, but would like some help.  Some things i've noticed:

1.  @WebResult has seems to have no affect when you load the services
auto-generated ?WSDL
2.  the targetNamespace functionality in both the @WebResult and @WebParam
don't seem to work when trying to access the services wsdl via ?WSDL.

Is there something i'm missing?

My development setting is Eclipse Europa with the Axis2-1.3 service archiver
and code-gen plugins.  I build a java project and develop a service like
this:

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.soap.SOAPBinding;

/**
 * Implementation of a calculator web service.
 * @author Bill
 *
 */
@WebService(
	serviceName="CalculatorService",
	targetNamespace="http://services.agr.gc.ca/CalculatorService"
)
@SOAPBinding(
		style=SOAPBinding.Style.DOCUMENT,
		use=SOAPBinding.Use.LITERAL,
		parameterStyle=SOAPBinding.ParameterStyle.BARE
)
public class CalculatorService {

	/**
	 * Adds two numbers.
	 * @param a
	 * @param b
	 * @return the addition of two numbers.
	 */
	@WebMethod (
		action="action:Add",
		operationName="Add"
	)
	public @WebResult(name="Add") int add(
			@WebParam (mode=WebParam.Mode.IN, 
					   name="param1") int a, 
			@WebParam (mode=WebParam.Mode.IN, 
					   name="param2") int b) {
		return a + b;
	}
}

Everything seems to be hit and miss with the annotations.  For the
@WebMethod the targetNamespace and operationName seems to have no effect. 
The @WebResult has no effect.  So if I want to have a document literal web
service with a response parameter as addResult instead of addResponse I
can't seem to do that.

Is there something i'm missing?

-- 
View this message in context: http://www.nabble.com/Which-Annotations-work-in-Axis-2.1.3--tp16694164p16694164.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message