Author: amilas Date: Tue May 10 10:56:28 2011 New Revision: 1101401 URL: http://svn.apache.org/viewvc?rev=1101401&view=rev Log: adding @WebMethod annotations operationName attribute
Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/JSR181HelperImpl.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/WebMethodAnnotation.java Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?rev=1101401&r1=1101400&r2=1101401&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Tue May 10 10:56:28 2011 @@ -521,14 +521,19 @@ public class Utils { .getAxisOperation(WSDLConstants.MEP_CONSTANT_IN_OUT); } String opName = method.getName(); - operation.setName(new QName(opName)); + WebMethodAnnotation methodAnnon = JSR181Helper.INSTANCE.getWebMethodAnnotation(method); if (methodAnnon != null) { String action = methodAnnon.getAction(); if (action != null && !"".equals(action)) { operation.setSoapAction(action); } + if (methodAnnon.getOperationName() != null){ + opName = methodAnnon.getOperationName(); + } } + + operation.setName(new QName(opName)); return operation; } Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=1101401&r1=1101400&r2=1101401&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java Tue May 10 10:56:28 2011 @@ -22,6 +22,8 @@ package org.apache.axis2.description; import org.apache.axiom.om.OMElement; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; +import org.apache.axis2.jsr181.WebMethodAnnotation; +import org.apache.axis2.jsr181.JSR181Helper; import org.apache.axis2.addressing.AddressingHelper; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.addressing.AddressingConstants; @@ -2515,8 +2517,16 @@ public class AxisService extends AxisDes PhasesInfo pinfo = axisConfiguration.getPhasesInfo(); for (int i = 0; i < method.length; i++) { Method jmethod = method[i]; - AxisOperation operation = axisService.getOperation(new QName( - jmethod.getName())); + + String methodName = jmethod.getName(); + WebMethodAnnotation methodAnnon = JSR181Helper.INSTANCE.getWebMethodAnnotation(jmethod); + if (methodAnnon != null) { + if (methodAnnon.getOperationName() != null){ + methodName = methodAnnon.getOperationName(); + } + } + AxisOperation operation = axisService.getOperation(new QName(methodName)); + String mep = operation.getMessageExchangePattern(); MessageReceiver mr; if (messageReceiverClassMap != null) { Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=1101401&r1=1101400&r2=1101401&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java Tue May 10 10:56:28 2011 @@ -297,13 +297,18 @@ public class DefaultSchemaGenerator impl if (jMethod.isBridge()) { continue; } + WebMethodAnnotation methodAnnon = JSR181Helper.INSTANCE.getWebMethodAnnotation(jMethod); + String methodName = jMethod.getName(); if (methodAnnon != null) { if (methodAnnon.isExclude()) { continue; } + if (methodAnnon.getOperationName() != null){ + methodName = methodAnnon.getOperationName(); + } } - String methodName = jMethod.getName(); + // no need to think abt this method , since that is system // config method if (excludeMethods.contains(methodName)) { @@ -419,8 +424,6 @@ public class DefaultSchemaGenerator impl generateSchemaForType(sequence, returnType, returnName); } - - AxisMessage outMessage = axisOperation.getMessage( WSDLConstants.MESSAGE_LABEL_OUT_VALUE); outMessage.setElementQName(typeTable.getQNamefortheType(partQname)); Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/JSR181HelperImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/JSR181HelperImpl.java?rev=1101401&r1=1101400&r2=1101401&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/JSR181HelperImpl.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/JSR181HelperImpl.java Tue May 10 10:56:28 2011 @@ -39,7 +39,7 @@ class JSR181HelperImpl extends JSR181Hel public WebMethodAnnotation getWebMethodAnnotation(Method method) { WebMethod annotation = method.getAnnotation(WebMethod.class); return annotation == null ? null : new WebMethodAnnotation(annotation.exclude(), - annotation.action()); + annotation.action(),annotation.operationName()); } @Override Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/WebMethodAnnotation.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/WebMethodAnnotation.java?rev=1101401&r1=1101400&r2=1101401&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/WebMethodAnnotation.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/jsr181/WebMethodAnnotation.java Tue May 10 10:56:28 2011 @@ -25,10 +25,12 @@ package org.apache.axis2.jsr181; public class WebMethodAnnotation { private final boolean exclude; private final String action; + private final String operationName; - WebMethodAnnotation(boolean exclude, String action) { + WebMethodAnnotation(boolean exclude, String action, String operationName) { this.exclude = exclude; this.action = action; + this.operationName = operationName; } public boolean isExclude() { @@ -38,4 +40,8 @@ public class WebMethodAnnotation { public String getAction() { return action; } + + public String getOperationName() { + return operationName; + } }