Author: richard.opalka(a)jboss.com
Date: 2010-03-26 02:44:42 -0400 (Fri, 26 Mar 2010)
New Revision: 11864
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
[JBPAPP-3999] implementing support for protocol in wsprovide
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-03-26
06:37:26 UTC (rev 11863)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-03-26
06:44:42 UTC (rev 11864)
@@ -81,6 +81,7 @@
public class JAXWSWebServiceMetaDataBuilder extends JAXWSServerMetaDataBuilder
{
private boolean generateWsdl = true;
+ private boolean extension;
private boolean toolMode = false;
private File wsdlDirectory = null;
private PrintStream messageStream = null;
@@ -98,6 +99,11 @@
{
this.generateWsdl = generateWsdl;
}
+
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
public ServerEndpointMetaData buildWebServiceMetaData(Deployment dep, UnifiedMetaData
wsMetaData, Class<?> sepClass, String linkName)
{
@@ -371,6 +377,7 @@
try
{
WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ generator.setExtension(extension);
if (wsdlLocation != null)
{
serviceMetaData.setWsdlLocation(wsdlLocation);
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2010-03-26
06:37:26 UTC (rev 11863)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2010-03-26
06:44:42 UTC (rev 11864)
@@ -46,11 +46,12 @@
final class JBossWSProviderImpl extends WSContractProvider
{
private ClassLoader loader;
- private boolean generateWsdl = false;
- private boolean generateSource = false;
+ private boolean generateWsdl;
+ private boolean extension;
+ private boolean generateSource;
private File outputDir = new File("output");
- private File resourceDir = null;
- private File sourceDir = null;
+ private File resourceDir;
+ private File sourceDir;
private PrintStream messageStream = NullPrintStream.getInstance();
private void createDirectories(File resourceDir, File sourceDir)
@@ -95,7 +96,8 @@
builder.setGenerateWsdl(generateWsdl);
builder.setToolMode(true);
builder.setWsdlDirectory(resourceDir);
- builder.setMessageStream(messageStream);
+ builder.setMessageStream(messageStream);
+ builder.setExtension(extension);
if (generateWsdl)
messageStream.println("Generating WSDL:");
@@ -142,6 +144,12 @@
}
@Override
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
+
+ @Override
public void setOutputDirectory(File directory)
{
outputDir = directory;
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2010-03-26
06:37:26 UTC (rev 11863)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2010-03-26
06:44:42 UTC (rev 11864)
@@ -69,6 +69,8 @@
public abstract class WSDLGenerator
{
protected WSDLDefinitions wsdl;
+
+ protected boolean extension;
protected abstract void processTypes();
@@ -98,6 +100,8 @@
QName bindingQName = new QName(interfaceQName.getNamespaceURI(),
interfaceQName.getLocalPart() + "Binding");
WSDLBinding wsdlBinding = new WSDLBinding(wsdl, bindingQName);
wsdlBinding.setInterfaceName(interfaceQName);
+ if (extension)
+ endpoint.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
wsdlBinding.setType(endpoint.getBindingId());
wsdl.addBinding(wsdlBinding);
wsdlEndpoint.setBinding(bindingQName);
@@ -379,6 +383,16 @@
wsdlService.setInterfaceName(endpoint.getPortName());
}
+
+ /**
+ * Whether to force SOAP 1.2
+ *
+ * @param extension whether to force SOAP 1.2
+ */
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
/**
* Generate a WSDL object model from the passed in ServiceMetaData.
@@ -410,26 +424,30 @@
}
}
- String soapURI = null;
- String soapPrefix = null;
- for (EndpointMetaData ep : service.getEndpoints())
+ String soapPrefix = extension ? "soap12" : null;
+ String soapURI = extension ? Constants.NS_SOAP12 : null;
+ if (!extension)
{
- String bindingId = ep.getBindingId();
- if (bindingId.startsWith(SOAPBinding.SOAP11HTTP_BINDING))
+ for (EndpointMetaData ep : service.getEndpoints())
{
- soapPrefix = "soap";
- soapURI = Constants.NS_SOAP11;
+ String bindingId = ep.getBindingId();
+ if (bindingId.startsWith(SOAPBinding.SOAP11HTTP_BINDING))
+ {
+ soapPrefix = "soap";
+ soapURI = Constants.NS_SOAP11;
+ }
+ else if (bindingId.startsWith(SOAPBinding.SOAP12HTTP_BINDING))
+ {
+ soapPrefix = "soap12";
+ soapURI = Constants.NS_SOAP12;
+ }
+
}
- else if (bindingId.startsWith(SOAPBinding.SOAP12HTTP_BINDING))
- {
- soapPrefix = "soap12";
- soapURI = Constants.NS_SOAP12;
- }
}
if (soapURI != null && soapPrefix != null)
wsdl.registerNamespaceURI(soapURI, soapPrefix);
-
+
processTypes();
processService(service);