Author: richard.opalka(a)jboss.com
Date: 2010-05-12 03:15:27 -0400 (Wed, 12 May 2010)
New Revision: 12210
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
[JBWS-2960] fixing @Addressing.responses mapping to WSDL
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-05-12
07:13:01 UTC (rev 12209)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2010-05-12
07:15:27 UTC (rev 12210)
@@ -217,12 +217,21 @@
}
}
- /*
- * <wsp:Policy wsu:Id="SOME_ID">
- * <wsam:Addressing wsp:Optional="true">
- * <wsp:Policy/>
- * </wsam:Addressing>
- * </wsp:Policy>
+ /**
+ * JAX-WS 3.11 Service and Ports
+ * <p>
+ * Conformance (Use of Addressing): Endpoint’s use of addressing, if any, MUST be
indicated in the
+ * wsdl:binding or wsdl:port sections of the WSDL 1.1 as per WS-Addressing 1.0 -
Metadata.
+ * </p>
+ * <pre>
+ * <wsp:Policy wsu:Id="SOME_ID">
+ * <wsam:Addressing wsp:Optional="true">
+ * <wsp:Policy>
+ * <wsam:NonAnonymousResponses/>
+ * </wsp:Policy>
+ * </wsam:Addressing>
+ * </wsp:Policy>
+ * <pre>
*/
private String addAddressingPolicyDefinition(final AddressingFeature addressing)
{
@@ -241,6 +250,16 @@
}
Element nestedPolicyElement = DOMUtils.createElement(new QName(WSP_NS,
"Policy", "wsp"));
addressingElement.appendChild(nestedPolicyElement);
+ if (addressing.getResponses() == AddressingFeature.Responses.ANONYMOUS)
+ {
+ Element anonymousResponsesElement = DOMUtils.createElement(new QName(WSAM_NS,
"AnonymousResponses", "wsam"));
+ nestedPolicyElement.appendChild(anonymousResponsesElement);
+ }
+ else if (addressing.getResponses() == AddressingFeature.Responses.NON_ANONYMOUS)
+ {
+ Element anonymousResponsesElement = DOMUtils.createElement(new QName(WSAM_NS,
"NonAnonymousResponses", "wsam"));
+ nestedPolicyElement.appendChild(anonymousResponsesElement);
+ }
// bind policy to WSDL
wsdl.addExtensibilityElement(new WSDLExtensibilityElement(WSP_NS, policyElement));