Author: richard.opalka(a)jboss.com
Date: 2009-11-27 02:17:15 -0500 (Fri, 27 Nov 2009)
New Revision: 11162
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
[JBWS-2840] implementing in Native
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2009-11-27
07:16:00 UTC (rev 11161)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2009-11-27
07:17:15 UTC (rev 11162)
@@ -82,6 +82,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;
@@ -99,6 +100,11 @@
{
this.generateWsdl = generateWsdl;
}
+
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
public ServerEndpointMetaData buildWebServiceMetaData(Deployment dep, UnifiedMetaData
wsMetaData, Class<?> sepClass, String linkName)
{
@@ -382,6 +388,7 @@
try
{
WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ generator.setExtension(extension);
WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
if (wsdlLocation != null)
{
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2009-11-27
07:16:00 UTC (rev 11161)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2009-11-27
07:17:15 UTC (rev 11162)
@@ -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/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 2009-11-27
07:16:00 UTC (rev 11161)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2009-11-27
07:17:15 UTC (rev 11162)
@@ -80,6 +80,8 @@
public abstract class WSDLGenerator
{
protected WSDLDefinitions wsdl;
+
+ protected boolean extension;
protected abstract void processTypes();
@@ -109,6 +111,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);
@@ -466,6 +470,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.
@@ -497,26 +511,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);
Show replies by date