Author: dkulp
Date: Fri May 28 16:21:48 2010
New Revision: 949219
URL: http://svn.apache.org/viewvc?rev=949219&view=rev
Log:
More updates to make the wsa action and soap:action stuff match
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=949219&r1=949218&r2=949219&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Fri May 28 16:21:48 2010
@@ -40,6 +40,7 @@ import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.namespace.QName;
+import javax.xml.ws.Action;
import javax.xml.ws.Holder;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.Response;
@@ -798,11 +799,17 @@ public class JaxWsServiceConfiguration e
public String getAction(OperationInfo op, Method method) {
method = getDeclaredMethod(method);
WebMethod wm = method.getAnnotation(WebMethod.class);
+ String action = "";
if (wm != null) {
- return wm.action();
- } else {
- return "";
+ action = wm.action();
+ }
+ if (StringUtils.isEmpty(action)) {
+ Action act = method.getAnnotation(Action.class);
+ if (act != null) {
+ action = act.input();
+ }
}
+ return action;
}
public Boolean isHolder(Class<?> cls, Type type) {
return Holder.class.equals(cls);
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=949219&r1=949218&r2=949219&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Fri May 28 16:21:48 2010
@@ -31,6 +31,7 @@ import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.jws.WebMethod;
import javax.wsdl.Operation;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;
@@ -486,11 +487,22 @@ public class JaxWsServiceFactoryBean ext
if (action == null && addressing == null) {
return;
}
+ WebMethod wm = method.getAnnotation(WebMethod.class);
+ String inputAction = "";
+ if (action != null) {
+ inputAction = action.input();
+ }
+ if (wm != null && StringUtils.isEmpty(inputAction)) {
+ inputAction = wm.action();
+ }
+ if (StringUtils.isEmpty(inputAction)) {
+ inputAction = computeAction(operation, "Request");
+ }
if (action == null && addressing != null) {
operation.getInput().addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
-
computeAction(operation, "Request"));
+ inputAction);
operation.getInput().addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
-
computeAction(operation, "Request"));
+ inputAction);
operation.getOutput().addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
computeAction(operation, "Response"));
operation.getOutput().addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
@@ -498,13 +510,9 @@ public class JaxWsServiceFactoryBean ext
} else {
MessageInfo input = operation.getInput();
+ input.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
inputAction);
if (!StringUtils.isEmpty(action.input())) {
- input.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
action.input());
- input.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
action.input());
- } else {
- input.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
computeAction(operation,
-
"Request"));
-
+ input.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
inputAction);
}
MessageInfo output = operation.getOutput();
@@ -552,7 +560,7 @@ public class JaxWsServiceFactoryBean ext
}
}
- private Object computeAction(OperationInfo op, String postFix) {
+ private String computeAction(OperationInfo op, String postFix) {
StringBuilder s = new StringBuilder(op.getName().getNamespaceURI());
if (s.charAt(s.length() - 1) != '/') {
s.append('/');
Modified:
cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
URL:
http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl?rev=949219&r1=949218&r2=949219&view=diff
==============================================================================
---
cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
(original)
+++
cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
Fri May 28 16:21:48 2010
@@ -133,7 +133,7 @@
<wsaw:UsingAddressing wsdl:required="false"/>
<wsp:PolicyReference
URI="#AddNumbersImplServiceSoapBinding_WSAM_Addressing_Policy"/>
<wsdl:operation name="addNumbers">
- <soap:operation soapAction="" style="document"/>
+ <soap:operation soapAction="http://cxf.apache.org/input"
style="document"/>
<wsdl:input name="addNumbers">
<soap:body use="literal"/>
</wsdl:input>
@@ -145,7 +145,7 @@
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="addNumbers4">
- <soap:operation soapAction="" style="document"/>
+ <soap:operation soapAction="http://cxf.apache.org/input4"
style="document"/>
<wsdl:input name="addNumbers4">
<soap:body use="literal"/>
</wsdl:input>
@@ -157,7 +157,7 @@
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="addNumbers3">
- <soap:operation soapAction="" style="document"/>
+ <soap:operation soapAction="http://cxf.apache.org/input3"
style="document"/>
<wsdl:input name="addNumbers3">
<soap:body use="literal"/>
</wsdl:input>