Author: richard.opalka(a)jboss.com
Date: 2010-04-02 05:41:53 -0400 (Fri, 02 Apr 2010)
New Revision: 11927
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
[JBWS-2986] fixing NPE - there can be endpoints not providing wsdl publish location - e.g.
WSProvider endpoints
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2010-04-02
05:31:43 UTC (rev 11926)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2010-04-02
09:41:53 UTC (rev 11927)
@@ -67,9 +67,11 @@
String deploymentName = dep.getCanonicalName();
// For each service
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ for (ServiceMetaData serviceMD : wsMetaData.getServices())
{
- File wsdlFile = getPublishLocation(deploymentName,
serviceMetaData.getWsdlFileOrLocation().toExternalForm(),
serviceMetaData.getWsdlPublishLocation());
+ final String wsdlLocation = this.getWSDLLocation(serviceMD);
+ final String publishLocation = serviceMD.getWsdlPublishLocation();
+ final File wsdlFile = getPublishLocation(deploymentName, wsdlLocation,
publishLocation);
if (wsdlFile == null)
continue;
@@ -80,14 +82,14 @@
try
{
fWriter = IOUtils.getCharsetFileWriter(wsdlFile,
Constants.DEFAULT_XML_CHARSET);
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ WSDLDefinitions wsdlDefinitions = serviceMD.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter,
Constants.DEFAULT_XML_CHARSET);
URL wsdlPublishURL = wsdlFile.toURI().toURL();
log.info("WSDL published to: " + wsdlPublishURL);
// udpate the wsdl file location
- serviceMetaData.setWsdlLocation(wsdlPublishURL);
+ serviceMD.setWsdlLocation(wsdlPublishURL);
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
@@ -123,6 +125,14 @@
}
}
+ private String getWSDLLocation(final ServiceMetaData serviceMD)
+ {
+ if (serviceMD.getWsdlFileOrLocation() == null)
+ return null;
+
+ return serviceMD.getWsdlFileOrLocation().toExternalForm();
+ }
+
/**
* Get the file publish location
*/
Show replies by date