Author: richard.opalka(a)jboss.com
Date: 2008-02-22 14:23:03 -0500 (Fri, 22 Feb 2008)
New Revision: 5780
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/Constants.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
[JBWS-1850] force jaxws:bindings WSDL extensions generation when proprietary documentation
annotation is available
Modified: stack/native/trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/Constants.java 2008-02-22 19:20:31 UTC
(rev 5779)
+++ stack/native/trunk/src/main/java/org/jboss/ws/Constants.java 2008-02-22 19:23:03 UTC
(rev 5780)
@@ -107,6 +107,9 @@
/** WS-Addressing namespace uri **/
static final String URI_WS_ADDRESSING =
"http://www.w3.org/2005/08/addressing";
+ /** JAX-WS binding customizations namespace uri **/
+ static final String URI_JAXWS_WSDL_CUSTOMIZATIONS =
"http://java.sun.com/xml/ns/jaxws";
+
/**Style of WSDL */
static final String RPC_LITERAL = "RPC/Literal";
static final String DOCUMENT_LITERAL = "Document/Literal";
@@ -304,6 +307,10 @@
static final QName WSDL_ATTRIBUTE_WSP_POLICYURIS = new QName(URI_WS_POLICY,
"PolicyURIs");
static final QName WSDL_ELEMENT_WSP_POLICYREFERENCE = new QName(URI_WS_POLICY,
"PolicyReference");
+ static final QName WSDL_ELEMENT_JAXWS_BINDINGS = new
QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "bindings");
+ static final QName WSDL_ELEMENT_JAXWS_CLASS = new QName(URI_JAXWS_WSDL_CUSTOMIZATIONS,
"class");
+ static final QName WSDL_ELEMENT_JAXWS_METHOD = new
QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "method");
+ static final QName WSDL_ELEMENT_JAXWS_JAVADOC = new
QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "javadoc");
/** WSDL-2.0 exchange patterns */
static final String WSDL20_PATTERN_IN_ONLY =
"http://www.w3.org/2004/08/wsdl/in-only";
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-02-22
19:20:31 UTC (rev 5779)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-02-22
19:23:03 UTC (rev 5780)
@@ -179,6 +179,7 @@
for (WSDLExtensibilityElement ext : extendable.getAllExtensibilityElements())
{
appendPolicyElements(builder, ext);
+ appendJAXWSCustomizationElements(builder, ext);
//add processing of further extensibility element types below
}
}
@@ -192,6 +193,14 @@
}
}
+ private void appendJAXWSCustomizationElements(StringBuilder builder,
WSDLExtensibilityElement extElem)
+ {
+ if (Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS.equalsIgnoreCase(extElem.getUri()))
+ {
+ appendElementSkippingKnownNs(builder, extElem.getElement());
+ }
+ }
+
private void appendElementSkippingKnownNs(StringBuilder builder, Element el)
{
builder.append("<"+el.getNodeName());
@@ -388,6 +397,7 @@
}
buffer.append(">");
appendDocumentation(buffer, intf.getDocumentationElement());
+ appendUnknownExtensibilityElements(buffer, intf);
appendPortOperations(buffer, intf);
buffer.append("</portType>");
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2008-02-22
19:20:31 UTC (rev 5779)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2008-02-22
19:23:03 UTC (rev 5780)
@@ -112,6 +112,22 @@
if (endpoint.getDocumentation() != null)
{
+ String prefix = wsdl.getPrefix(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS);
+ if (prefix == null)
+ {
+ prefix = "jaxws";
+ wsdl.registerNamespaceURI(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS, prefix);
+ }
+
+ Element javadocElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_JAVADOC.getLocalPart(), prefix);
+ javadocElement.setTextContent(endpoint.getDocumentation());
+ Element classElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_CLASS.getLocalPart(), prefix);
+ classElement.setAttribute("name", interfaceQName.getLocalPart());
+ classElement.appendChild(javadocElement);
+ Element bindingsElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_BINDINGS.getLocalPart(), prefix);
+ bindingsElement.appendChild(classElement);
+ WSDLExtensibilityElement ext = new
WSDLExtensibilityElement(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS, bindingsElement);
+ wsdlInterface.addExtensibilityElement(ext);
wsdlInterface.setDocumentationElement(new
WSDLDocumentation(endpoint.getDocumentation()));
}
@@ -233,6 +249,22 @@
// process optional documentation
if (operation.getDocumentation() != null)
{
+ String prefix = wsdl.getPrefix(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS);
+ if (prefix == null)
+ {
+ prefix = "jaxws";
+ wsdl.registerNamespaceURI(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS, prefix);
+ }
+
+ Element javadocElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_JAVADOC.getLocalPart(), prefix);
+ javadocElement.setTextContent(operation.getDocumentation());
+ Element methodElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_METHOD.getLocalPart(), prefix);
+ methodElement.setAttribute("name",
operation.getQName().getLocalPart());
+ methodElement.appendChild(javadocElement);
+ Element bindingsElement =
DOMUtils.createElement(Constants.WSDL_ELEMENT_JAXWS_BINDINGS.getLocalPart(), prefix);
+ bindingsElement.appendChild(methodElement);
+ WSDLExtensibilityElement ext = new
WSDLExtensibilityElement(Constants.URI_JAXWS_WSDL_CUSTOMIZATIONS, bindingsElement);
+ interfaceOperation.addExtensibilityElement(ext);
interfaceOperation.setDocumentationElement(new
WSDLDocumentation(operation.getDocumentation()));
}
Show replies by date