Author: richard.opalka(a)jboss.com
Date: 2010-03-17 11:06:32 -0400 (Wed, 17 Mar 2010)
New Revision: 11799
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/EchoImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/TestEndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/SimpleServiceImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/OneWayServiceImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/ReqResServiceImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredOneWayServiceImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredReqResServiceImpl.java
stack/native/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/native/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/native/trunk/modules/testsuite/test-excludes-jboss601.txt
Log:
[JBWS-2960] generating addressing policy in WSDL for @Addressing enabled endpoints
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.extensions.addressing.metadata;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.ws.metadata.umdm.MetaDataExtension;
/**
@@ -35,6 +38,7 @@
{
private String inboundAction;
private String outboundAction;
+ private Map<String, String> faultAction = new HashMap<String, String>();
public AddressingOpMetaExt(String extensionNameSpace)
{
@@ -60,5 +64,15 @@
{
this.outboundAction = outboundAction;
}
+
+ public void setFaultAction(String beanName, String action)
+ {
+ this.faultAction.put(beanName, action);
+ }
+
+ public String getFaultAction(String beanName)
+ {
+ return this.faultAction.get(beanName);
+ }
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -50,11 +50,13 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.BindingType;
+import javax.xml.ws.FaultAction;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.WebFault;
import javax.xml.ws.Action;
import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.soap.AddressingFeature;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
@@ -553,42 +555,145 @@
return (namespace != null) ? new QName(namespace, name) : new QName(name);
}
+
+ /*
+ * 1. A non-default @Action(input=...) or @WebMethod(action=...) value on a SEI
method
+ * MUST result into wsdl:input[@wsam:Action] attribute in the corresponding
wsdl:operation.
+ * Also, @Action(input=...) and @WebMethod(action=...) annotation element values
MUST
+ * be same, if present.
+ * 2. If wsdl:input[@wsam:Action] cannot be mapped from the above steps, then
wsam:Action
+ * is generated using the metadata defaulting algorithm as if wsdl:input[@name] is
+ * not present in WSDL.
+ */
+ private String getInputActionName(final Method method, final EndpointMetaData
endpointMD, final OperationMetaData operationMD)
+ {
+ String actionInput = null;
+ Action actionAnn = method.getAnnotation(Action.class);
+ if ((actionAnn != null) && (!"".equals(actionAnn.input())))
+ actionInput = actionAnn.input();
+
+ String webMethodAction = null;
+ WebMethod webMethodAnn = method.getAnnotation(WebMethod.class);
+ if ((webMethodAnn != null) &&
(!"".equals(webMethodAnn.action())))
+ webMethodAction = webMethodAnn.action();
+
+ if ((actionInput != null) && (webMethodAction != null) &&
!actionInput.equals(webMethodAction))
+ throw new RuntimeException("(a)Action.input and @WebMethod.action must have
same value if both specified: " + method);
+
+ if (actionInput != null)
+ return actionInput;
+
+ if (webMethodAction != null)
+ return webMethodAction;
+ if (endpointMD.isFeatureEnabled(AddressingFeature.class))
+ {
+ String tns = endpointMD.getPortTypeName().getNamespaceURI();
+ String portTypeName = endpointMD.getPortTypeName().getLocalPart();
+ String opName = operationMD.getQName().getLocalPart();
+
+ return tns + portTypeName + "/" + opName + "Request";
+ }
+
+ return null;
+ }
+
+ /*
+ * 2. A non-default @Action(output=...) value on a SEI method MUST result into
wsdl:output-
+ * [@wsam:Action] attribute in the corresponding wsdl:operation.
+ * 5. If wsdl:output[@wsam:Action] cannot be mapped from the above steps, then
wsam:Action
+ * is generated using the metadata defaulting algorithm as if wsdl:output[@name] is
not present in
+ * WSDL.
+ */
+ private String getOutputActionName(final Method method, final EndpointMetaData
endpointMD, final OperationMetaData operationMD)
+ {
+ if (operationMD.isOneWay())
+ return null;
+
+ Action actionAnn = method.getAnnotation(Action.class);
+ if ((actionAnn != null) && (!"".equals(actionAnn.output())))
+ return actionAnn.output();
+
+ if (endpointMD.isFeatureEnabled(AddressingFeature.class))
+ {
+ String tns = endpointMD.getPortTypeName().getNamespaceURI();
+ String portTypeName = endpointMD.getPortTypeName().getLocalPart();
+ String opName = operationMD.getQName().getLocalPart();
+
+ return tns + portTypeName + "/" + opName + "Response";
+ }
+
+ return null;
+ }
+
+ /*
+ * 3. A non-default @Action(@FaultAction=...) value on a SEI method MUST result into
wsdl:fault-
+ * [@wsam:Action] attribute in the corresponding wsdl:operation. The wsdl:fault
element
+ * MUST correspond to the exception specified by className annotated element
value.
+ * 6. If wsdl:fault[@wsam:Action] cannot be mapped from the above steps, then
wsam:Action is
+ * generated using the metadata defaulting algorithm as if wsdl:fault[@name] is the
corresponding
+ * exception class name.
+ */
+ private String getFaultActionName(final Method method, final EndpointMetaData
endpointMD, final OperationMetaData operationMD, final FaultMetaData faultMD)
+ {
+ if (operationMD.isOneWay())
+ return null;
+
+ String faultBeanName = faultMD.getJavaTypeName();
+ Action actionAnn = method.getAnnotation(Action.class);
+ FaultAction faultActionAnn = null;
+ if (actionAnn != null)
+ {
+ for (FaultAction faultAction : actionAnn.fault())
+ {
+ if (faultAction.className().getName().equals(faultBeanName))
+ {
+ faultActionAnn = faultAction;
+ break;
+ }
+ }
+ }
+
+ if ((faultActionAnn != null) &&
(!"".equals(faultActionAnn.value())))
+ return faultActionAnn.value();
+
+ if (endpointMD.isFeatureEnabled(AddressingFeature.class))
+ {
+ String tns = endpointMD.getPortTypeName().getNamespaceURI();
+ String portTypeName = endpointMD.getPortTypeName().getLocalPart();
+ String opName = operationMD.getQName().getLocalPart();
+ int dotIndex = faultBeanName.lastIndexOf('.');
+ String excetionClassName = dotIndex == -1 ? faultBeanName :
faultBeanName.substring(dotIndex + 1);
+
+ return tns + portTypeName + "/" + opName + "/Fault/" +
excetionClassName;
+ }
+
+ return null;
+ }
+
/**
* Process operation meta data extensions.
*/
- private void processMetaExtensions(Method method, EndpointMetaData epMetaData,
OperationMetaData opMetaData)
+ private void processMetaExtensions(Method method, EndpointMetaData endpointMD,
OperationMetaData operationMD)
{
AddressingProperties ADDR = new AddressingPropertiesImpl();
AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
- Action anAction = method.getAnnotation(Action.class);
- if (anAction != null)
+ addrExt.setInboundAction(this.getInputActionName(method, endpointMD,
operationMD));
+ addrExt.setOutboundAction(this.getOutputActionName(method, endpointMD,
operationMD));
+ for (FaultMetaData faultMD : operationMD.getFaults())
{
- addrExt.setInboundAction(anAction.input());
- addrExt.setOutboundAction(anAction.output());
+ addrExt.setFaultAction(faultMD.getFaultBeanName(),
this.getFaultActionName(method, endpointMD, operationMD, faultMD));
}
- else
- // default action values
- {
- String tns = epMetaData.getPortName().getNamespaceURI();
- String portTypeName = epMetaData.getPortName().getLocalPart();
- String opName = opMetaData.getQName().getLocalPart();
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
opName + "Request");
- if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/"
+ opName + "Response");
- }
-
- opMetaData.addExtension(addrExt);
+ operationMD.addExtension(addrExt);
}
private void processWebMethod(EndpointMetaData epMetaData, Method method)
{
String javaName = method.getName();
-
// skip async methods, they dont need meta data representation
- if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ if (javaName.endsWith(Constants.ASYNC_METHOD_SUFFIX))
return;
// reflection defaults
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -76,6 +76,11 @@
* Used for WSDL 1.1
*/
private QName messageName;
+
+ /**
+ * wsam:Action
+ */
+ private String action;
public WSDLInterfaceMessageReference(WSDLInterfaceOperation wsdlOperation)
{
@@ -218,6 +223,26 @@
}
/**
+ * Sets wsam:Action
+ *
+ * @param action action
+ */
+ public void setAction(String action)
+ {
+ this.action = action;
+ }
+
+ /**
+ * Gets wsam:Action
+ *
+ * return action
+ */
+ public String getAction()
+ {
+ return this.action;
+ }
+
+ /**
* Sets the WSDL 1.1 part name.
*
* @param partName The part name
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -49,6 +49,20 @@
*/
private String messageLabel;
+ /** An OPTIONAL wsam:Action
+ */
+ private String action;
+
+ public String getAction()
+ {
+ return this.action;
+ }
+
+ public void setAction(String action)
+ {
+ this.action = action;
+ }
+
public WSDLInterfaceOperationOutfault(WSDLInterfaceOperation wsdlInterfaceOperation)
{
this.wsdlInterfaceOperation = wsdlInterfaceOperation;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -59,6 +59,7 @@
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.addressing.AddressingConstants;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -185,6 +186,7 @@
for (WSDLExtensibilityElement ext : extendable.getAllExtensibilityElements())
{
appendPolicyElements(builder, ext);
+ appendAddressingPolicyElements(builder, ext);
appendJAXWSCustomizationElements(builder, ext);
//add processing of further extensibility element types below
}
@@ -199,6 +201,14 @@
}
}
+ private void appendAddressingPolicyElements(StringBuilder builder,
WSDLExtensibilityElement extElem)
+ {
+ if (WSDLGenerator.WSP_NS.equalsIgnoreCase(extElem.getUri()))
+ {
+ appendElementSkippingKnownNs(builder, extElem.getElement());
+ }
+ }
+
private void appendJAXWSCustomizationElements(StringBuilder builder,
WSDLExtensibilityElement extElem)
{
if (Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS.equalsIgnoreCase(extElem.getUri()))
@@ -427,6 +437,8 @@
protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
{
String prefix = wsdl.getPrefix(intf.getName().getNamespaceURI());
+ String wsamPrefix = wsdl.getPrefix(AddressingConstants.Metadata.NS);
+
WSDLInterfaceOperation[] operations = intf.getSortedOperations();
for (int i = 0; i < operations.length; i++)
{
@@ -449,20 +461,45 @@
String interfaceName = operation.getWsdlInterface().getName().getLocalPart();
String msgEl = prefix + ":" + interfaceName + "_" + opname;
- buffer.append("<input message='" + msgEl +
"'>").append("</input>");
+ String inputAction = operation.getInputs()[0].getAction();
+ if (inputAction == null)
+ {
+ buffer.append("<input message='" + msgEl +
"'>").append("</input>");
+ }
+ else
+ {
+ buffer.append("<input message='" + msgEl + "'
" + wsamPrefix + ":" + AddressingConstants.Metadata.Attributes.ACTION +
"='" + inputAction + "'/>");
+ }
if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
{
- buffer.append("<output message='" + msgEl +
"Response'>");
- buffer.append("</output>");
+ String outputAction = operation.getOutputs()[0].getAction();
+ if (outputAction == null)
+ {
+ buffer.append("<output message='" + msgEl +
"Response'>").append("</output>");
+ }
+ else
+ {
+ buffer.append("<output message='" + msgEl +
"Response' " + wsamPrefix + ":" +
AddressingConstants.Metadata.Attributes.ACTION + "='" + outputAction +
"'/>");
+ }
}
//Append the Faults
for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
{
QName element = fault.getRef();
- buffer.append("<fault message='" + prefix + ":" +
element.getLocalPart());
- buffer.append("' name='" + element.getLocalPart() +
"'/>");
+ String faultAction = fault.getAction();
+ if (faultAction == null)
+ {
+ buffer.append("<fault message='" + prefix +
":" + element.getLocalPart());
+ buffer.append("' name='" + element.getLocalPart() +
"'/>");
+ }
+ else
+ {
+ buffer.append("<fault message='" + prefix +
":" + element.getLocalPart());
+ buffer.append("' name='" + element.getLocalPart() +
"' ");
+ buffer.append(wsamPrefix + ":" +
AddressingConstants.Metadata.Attributes.ACTION + "='" + faultAction +
"'/>");
+ }
}
buffer.append("</operation>");
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -30,6 +30,8 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.soap.AddressingFeature;
import javax.xml.ws.soap.SOAPBinding;
import org.apache.ws.policy.Policy;
@@ -38,6 +40,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.soap.Style;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.policy.PolicyScopeLevel;
import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -70,6 +74,8 @@
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.addressing.AddressingConstants;
+import org.jboss.wsf.common.utils.UUIDGenerator;
import org.w3c.dom.Element;
/**
@@ -79,6 +85,10 @@
*/
public abstract class WSDLGenerator
{
+ private static final AddressingProperties WSA_PROPERTIES = new
AddressingPropertiesImpl();
+ public static final String WSU_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
+ public static final String WSAM_NS = AddressingConstants.Metadata.NS;
+ public static final String WSP_NS = "http://www.w3.org/ns/ws-policy";
protected WSDLDefinitions wsdl;
protected boolean extension;
@@ -116,6 +126,14 @@
wsdlBinding.setType(endpoint.getBindingId());
wsdl.addBinding(wsdlBinding);
wsdlEndpoint.setBinding(bindingQName);
+ if (endpoint.isFeatureEnabled(AddressingFeature.class))
+ {
+ // register WSAM namespace
+ if (wsdl.getPrefix(WSAM_NS) == null)
+ {
+ wsdl.registerNamespaceURI(WSAM_NS, "wsa");
+ }
+ }
if (endpoint.getDocumentation() != null)
{
@@ -164,6 +182,16 @@
addPolicyReference(policy, wsdlBinding);
}
}
+
+ // Addressing policies -
http://ws.apache.org/commons/neethi/ is not usable thus
hacking the code ATM :(
+ // TODO: implement WS-P facade?
+ if (endpoint.isFeatureEnabled(AddressingFeature.class))
+ {
+ AddressingFeature addressingFeature =
endpoint.getFeature(AddressingFeature.class);
+
+ String policyId = this.addAddressingPolicyDefinition(addressingFeature);
+ this.addAddressingPolicyReference(policyId, wsdlBinding);
+ }
}
protected void addPolicyDefinition(Policy policy)
@@ -189,6 +217,37 @@
}
}
+ /*
+ * <wsp:Policy wsu:Id="SOME_ID">
+ * <wsam:Addressing wsp:Optional="true">
+ * <wsp:Policy/>
+ * </wsam:Addressing>
+ * </wsp:Policy>
+ */
+ private String addAddressingPolicyDefinition(final AddressingFeature addressing)
+ {
+ // construct addressing policy
+ String policyId = UUIDGenerator.generateRandomUUIDString();
+ Element policyElement = DOMUtils.createElement(new QName(WSP_NS,
"Policy", "wsp"));
+ policyElement.setAttribute("xmlns:wsu", WSU_NS);
+ policyElement.setAttribute("xmlns:wsp", WSP_NS);
+ policyElement.setAttribute("wsu:Id", policyId);
+ Element addressingElement = DOMUtils.createElement(new QName(WSAM_NS,
"Addressing", "wsam"));
+ addressingElement.setAttribute("xmlns:wsam", WSAM_NS);
+ policyElement.appendChild(addressingElement);
+ if (!addressing.isRequired())
+ {
+ addressingElement.setAttributeNS(WSP_NS, "wsp:Optional",
"true");
+ }
+ Element nestedPolicyElement = DOMUtils.createElement(new QName(WSP_NS,
"Policy", "wsp"));
+ addressingElement.appendChild(nestedPolicyElement);
+
+ // bind policy to WSDL
+ wsdl.addExtensibilityElement(new WSDLExtensibilityElement(WSP_NS, policyElement));
+
+ return policyId;
+ }
+
protected void addPolicyReference(Policy policy, Extendable extendable)
{
QName policyRefQName = Constants.WSDL_ELEMENT_WSP_POLICYREFERENCE;
@@ -205,6 +264,17 @@
extendable.addExtensibilityElement(ext);
}
+ /*
+ * <wsp:PolicyReference URI="#SOME_ID"/>
+ */
+ protected void addAddressingPolicyReference(String policyId, Extendable extendable)
+ {
+ Element policyReferenceElement = DOMUtils.createElement(new QName(WSP_NS,
"PolicyReference", "wsp"));
+ policyReferenceElement.setAttribute("xmlns:wsp", WSP_NS);
+ policyReferenceElement.setAttribute("URI", "#" + policyId);
+ extendable.addExtensibilityElement(new WSDLExtensibilityElement(WSP_NS,
policyReferenceElement));
+ }
+
protected void addPolicyURIAttribute(Policy policy, Extendable extendable)
{
//TODO!! we need to understand if the policy is local or not...
@@ -248,6 +318,7 @@
String ns = getNamespace(fault.getJavaType(),
operation.getQName().getNamespaceURI());
QName outFaultName = new QName(ns, fault.getXmlName().getLocalPart());
outfault.setRef(outFaultName);
+ this.setAddressingAction(outfault, fault, operation);
interfaceOperation.addOutfault(outfault);
WSDLBindingFault bindingFault = new WSDLBindingFault(wsdlBinding);
@@ -342,6 +413,7 @@
// If there is no return parameter, it will most likely be set later with an
INOUT or OUT parameter.
// Otherwise, a null element means there is a 0 body element part, which is
allowed by BP 1.0
interfaceOperation.addOutput(output);
+ this.setAddressingAction(output, operation);
bindingOperation.addOutput(bindingOutput);
}
@@ -373,6 +445,7 @@
}
interfaceOperation.addInput(input);
+ this.setAddressingAction(input, operation);
bindingOperation.addInput(bindingInput);
}
@@ -419,6 +492,7 @@
}
interfaceOperation.addOutput(output);
+ this.setAddressingAction(output, operation);
bindingOperation.addOutput(bindingOutput);
}
@@ -449,9 +523,45 @@
}
interfaceOperation.addInput(input);
+ this.setAddressingAction(input, operation);
bindingOperation.addInput(bindingInput);
}
+ private void setAddressingAction(WSDLInterfaceOperationInput input, OperationMetaData
operationMD)
+ {
+ AddressingOpMetaExt addrExt = this.getAddressingMD(operationMD);
+ if (addrExt != null)
+ {
+ input.setAction(addrExt.getInboundAction());
+ }
+ }
+
+ private void setAddressingAction(WSDLInterfaceOperationOutput output,
OperationMetaData operationMD)
+ {
+ AddressingOpMetaExt addrExt = this.getAddressingMD(operationMD);
+ if (addrExt != null)
+ {
+ output.setAction(addrExt.getOutboundAction());
+ }
+ }
+
+ private void setAddressingAction(WSDLInterfaceOperationOutfault fault, FaultMetaData
faultMD, OperationMetaData operationMD)
+ {
+ AddressingOpMetaExt addrExt = this.getAddressingMD(operationMD);
+ if (addrExt != null)
+ {
+ fault.setAction(addrExt.getFaultAction(faultMD.getFaultBeanName()));
+ }
+ }
+
+ private AddressingOpMetaExt getAddressingMD(OperationMetaData operationMD)
+ {
+ if (operationMD.getEndpointMetaData().isFeatureEnabled(AddressingFeature.class))
+ return
(AddressingOpMetaExt)operationMD.getExtension(WSA_PROPERTIES.getNamespaceURI());
+
+ return null;
+ }
+
protected void processService(ServiceMetaData service)
{
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/EchoImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/EchoImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/EchoImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -21,13 +21,12 @@
*/
package org.jboss.test.ws.interop.wsa;
-import org.jboss.ws.annotation.EndpointConfig;
-
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.soap.Addressing;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -41,7 +40,7 @@
portName = "EchoPort"
)
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-@EndpointConfig(configName = "Standard WSAddressing Endpoint")
+@Addressing
public class EchoImpl implements EchoPortType {
@WebMethod(operationName = "EchoOp", action =
"http://example.org/action/echoIn")
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/TestEndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/TestEndpointImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/TestEndpointImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -35,14 +35,14 @@
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.soap.Addressing;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.EndpointConfig;
@WebService(serviceName = "TestEndpointService", name =
"TestEndpoint", targetNamespace = "http://org.jboss.ws/epr")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Stateless
-@EndpointConfig(configName = "Standard WSAddressing Endpoint")
+@Addressing
public class TestEndpointImpl implements TestEndpoint
{
// provide logging
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/SimpleServiceImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/SimpleServiceImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/SimpleServiceImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -24,6 +24,7 @@
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
import org.jboss.ws.annotation.EndpointConfig;
@@ -39,6 +40,7 @@
configFile = "META-INF/wsrm-jaxws-endpoint-config.xml",
configName = "Standard WSRM Endpoint"
)
+@Addressing
public class SimpleServiceImpl
{
@Oneway
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -26,9 +26,9 @@
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.soap.Addressing;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.EndpointConfig;
/**
* WS-Addressing service endpoint
@@ -43,7 +43,7 @@
targetNamespace = "http://org.jboss.ws/addressing/action",
endpointInterface =
"org.jboss.test.ws.jaxws.wsaddressing.action.ActionEndpoint"
)
-@EndpointConfig(configName = "Standard WSAddressing Endpoint")
+@Addressing
public class ActionRpcEndpointImpl implements ActionEndpoint
{
// provide logging
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -28,6 +28,7 @@
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.soap.Addressing;
import org.jboss.logging.Logger;
@@ -41,6 +42,7 @@
*/
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle =
SOAPBinding.ParameterStyle.BARE)
@WebService(name = "FaultToEndpoint", serviceName =
"FaultToEndpointService", targetNamespace =
"http://org.jboss.ws/addressing/replyto")
+@Addressing
public class FaultToEndpointImpl
{
// provide logging
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -26,9 +26,9 @@
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.soap.Addressing;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.EndpointConfig;
/**
* WS-Addressing service endpoint
@@ -39,7 +39,7 @@
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebService(name = "InitialEndpoint", serviceName =
"InitialEndpointService", targetNamespace =
"http://org.jboss.ws/addressing/replyto")
-@EndpointConfig(configName = "Standard WSAddressing Endpoint")
+@Addressing
public class InitialEndpointImpl implements InitialEndpoint
{
// provide logging
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -29,6 +29,7 @@
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.soap.Addressing;
import org.jboss.logging.Logger;
@@ -41,6 +42,7 @@
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebService(name = "ReplyToEndpoint", serviceName =
"ReplyToEndpointService", targetNamespace =
"http://org.jboss.ws/addressing/replyto")
+@Addressing
public class ReplyToEndpointImpl implements ReplyToEndpoint
{
// provide logging
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/OneWayServiceImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/OneWayServiceImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/OneWayServiceImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -23,6 +23,8 @@
import javax.jws.Oneway;
import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
+
import java.util.Arrays;
@WebService
@@ -33,6 +35,7 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsrm",
endpointInterface =
"org.jboss.test.ws.jaxws.wsrm.services.OneWayServiceIface"
)
+@Addressing
public class OneWayServiceImpl implements OneWayServiceIface
{
@Oneway
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/ReqResServiceImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/ReqResServiceImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/ReqResServiceImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -23,6 +23,7 @@
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
@WebService
(
@@ -32,6 +33,7 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsrm",
endpointInterface =
"org.jboss.test.ws.jaxws.wsrm.services.ReqResServiceIface"
)
+@Addressing
public class ReqResServiceImpl
{
@WebMethod
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredOneWayServiceImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredOneWayServiceImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredOneWayServiceImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -24,6 +24,7 @@
import java.util.Arrays;
import javax.jws.Oneway;
import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
@WebService
(
@@ -33,6 +34,7 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsrm",
endpointInterface =
"org.jboss.test.ws.jaxws.wsrm.services.SecuredOneWayServiceIface"
)
+@Addressing
public class SecuredOneWayServiceImpl implements SecuredOneWayServiceIface
{
@Oneway
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredReqResServiceImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredReqResServiceImpl.java 2010-03-17
14:43:56 UTC (rev 11798)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wsrm/services/SecuredReqResServiceImpl.java 2010-03-17
15:06:32 UTC (rev 11799)
@@ -23,6 +23,7 @@
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
@WebService
(
@@ -32,6 +33,7 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsrm",
endpointInterface =
"org.jboss.test.ws.jaxws.wsrm.services.SecuredReqResServiceIface"
)
+@Addressing
public class SecuredReqResServiceImpl
{
@WebMethod
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-03-17 14:43:56
UTC (rev 11798)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-03-17 15:06:32
UTC (rev 11799)
@@ -13,7 +13,3 @@
org/jboss/test/ws/jaxws/jbws2942/**
org/jboss/test/ws/jaxws/endpointReference/**
org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.*
-
-# [JBWS-2960] TODO
-org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-03-17 14:43:56
UTC (rev 11798)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-03-17 15:06:32
UTC (rev 11799)
@@ -13,7 +13,3 @@
org/jboss/test/ws/jaxws/jbws2942/**
org/jboss/test/ws/jaxws/endpointReference/**
org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.*
-
-# [JBWS-2960] TODO
-org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-03-17 14:43:56
UTC (rev 11798)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-03-17 15:06:32
UTC (rev 11799)
@@ -13,7 +13,3 @@
org/jboss/test/ws/jaxws/jbws2942/**
org/jboss/test/ws/jaxws/endpointReference/**
org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.*
-
-# [JBWS-2960] TODO
-org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-03-17 14:43:56
UTC (rev 11798)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-03-17 15:06:32
UTC (rev 11799)
@@ -6,7 +6,3 @@
# [JBWS-2718] Loading artifacts from WEB-INF/wsdl1 fails
org/jboss/test/ws/jaxws/jbws2718/**
-
-# [JBWS-2960] TODO
-org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-