You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2007/07/11 03:18:31 UTC
svn commit: r555133 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2:
client/async/ dataretrieval/ deployment/ deployment/repository/util/
description/
Author: gdaniels
Date: Tue Jul 10 18:18:30 2007
New Revision: 555133
URL: http://svn.apache.org/viewvc?view=rev&rev=555133
Log:
* Introduce WSDLSupplier interface so services can plug in custom ways of generating WSDL (just 1.1 for the moment). This gets used in AxisService.printWSDL().
* Deprecate AsyncResult
* Get rid of unused members of DeploymentFileData. Also throw IllegalArgumentException if a null File arg is passed to the constructor.
* AxisService.nameSpacesMap -> namespaceMap
* General cleanups
Added:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DataLocatorFactory.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java Tue Jul 10 18:18:30 2007
@@ -28,6 +28,8 @@
* engine returns an instance of this class via the {@link
* Callback#onComplete(AsyncResult)} method when the operation completes
* successfully.
+ *
+ * @deprecated please see org.apache.axis2.client.async.AxisCallback.
*/
public class AsyncResult {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DataLocatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DataLocatorFactory.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DataLocatorFactory.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/DataLocatorFactory.java Tue Jul 10 18:18:30 2007
@@ -37,11 +37,11 @@
}
public static AxisDataLocator createDataLocator(String dialect,
- ServiceData[] serviceDataArray) {
- AxisDataLocator dataLocator = null;
+ ServiceData[] serviceDataArray) {
+ AxisDataLocator dataLocator;
+
if (dialect.equals(DRConstants.SPEC.DIALECT_TYPE_WSDL)) {
dataLocator = getWsdlDataLocator(serviceDataArray);
-
} else if (dialect.trim().equals(DRConstants.SPEC.DIALECT_TYPE_POLICY)) {
if (policyDataLocator == null) {
dataLocator = new PolicyDataLocator(serviceDataArray);
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java Tue Jul 10 18:18:30 2007
@@ -23,6 +23,7 @@
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisService2WSDL11;
+import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -35,9 +36,7 @@
AxisService theService = null;
String request_Identifier = null;
-
protected WSDLDataLocator() {
-
}
/**
@@ -58,15 +57,15 @@
MessageContext msgContext) throws DataRetrievalException {
log.trace("Default WSDL DataLocator getData starts");
- request_Identifier = (String) request.getIdentifier();
+ request_Identifier = request.getIdentifier();
- OutputForm outputform = (OutputForm) request.getOutputForm();
+ OutputForm outputform = request.getOutputForm();
if (outputform == null) { // not defined, defualt to inline
outputform = OutputForm.INLINE_FORM;
}
- Data[] output = null;
+ Data[] output;
String outputFormString = outputform.getType();
@@ -87,8 +86,7 @@
if (log.isTraceEnabled()) {
log.trace(
"Null data return! Data Locator does not know how to handle request for dialect= " +
- (String) request.getDialect()
- + " in the form of " + outputFormString);
+ request.getDialect() + " in the form of " + outputFormString);
}
}
@@ -134,8 +132,7 @@
}
if (wsdlElement != null) {
- log
- .trace("Default WSDL DataLocator successfully generated WSDL.");
+ log.trace("Default WSDL DataLocator successfully generated WSDL.");
result = new Data[1];
result[0] = new Data(wsdlElement, null);
}
Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java?view=auto&rev=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java Tue Jul 10 18:18:30 2007
@@ -0,0 +1,36 @@
+package org.apache.axis2.dataretrieval;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.context.MessageContext;
+
+import javax.wsdl.Definition;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Return a WSDL as an OMElement. This is used by any AxisService that wishes
+ * to override the standard AxisService2WSDL (see the org.apache.axis2.description
+ * package) method of getting WSDL. If one of these is present in the AxisService
+ * Parameters under the name "WSDLSupplier", it will be queried.
+ */
+public interface WSDLSupplier {
+ Definition getWSDL(AxisService service) throws AxisFault;
+}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Tue Jul 10 18:18:30 2007
@@ -72,7 +72,8 @@
File parentFile = file.getParentFile();
if (file != null) {
ClassLoader classLoader =
- Utils.getClassLoader(configCtx.getAxisConfiguration().getSystemClassLoader(), parentFile);
+ Utils.getClassLoader(configCtx.getAxisConfiguration().
+ getSystemClassLoader(), parentFile);
Thread.currentThread().setContextClassLoader(classLoader);
String className = file.getName();
@@ -127,12 +128,14 @@
messageReciverMap.put(
WSDL2Constants.MEP_URI_IN_OUT,
inOutmessageReceiver);
- messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,inOutmessageReceiver);
- AxisService axisService = AxisService.createService(className,
- configCtx.getAxisConfiguration(),
- messageReciverMap,
- null, null,
- classLoader);
+ messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,
+ inOutmessageReceiver);
+ AxisService axisService =
+ AxisService.createService(className,
+ configCtx.getAxisConfiguration(),
+ messageReciverMap,
+ null, null,
+ classLoader);
configCtx.getAxisConfiguration().addService(axisService);
}
}
@@ -173,7 +176,8 @@
new URL[]{deploymentFileData.getFile().toURL()},
configCtx.getAxisConfiguration().getSystemClassLoader(),
true,
- (File)configCtx.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
+ (File)configCtx.getAxisConfiguration().
+ getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
Thread.currentThread().setContextClassLoader(classLoader);
className = className.replaceAll(".class", "");
className = className.replaceAll("/", ".");
@@ -217,7 +221,7 @@
}
}
AxisServiceGroup serviceGroup = new AxisServiceGroup();
- serviceGroup.setServiceGroupName(deploymentFileData.getServiceName());
+ serviceGroup.setServiceGroupName(deploymentFileData.getName());
for (int i = 0; i < axisServiceList.size(); i++) {
AxisService axisService = (AxisService) axisServiceList.get(i);
serviceGroup.addService(axisService);
@@ -298,6 +302,5 @@
}
}
}
-
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Tue Jul 10 18:18:30 2007
@@ -462,8 +462,7 @@
// get attribute values
boolean moduleXMLFound = false;
- String shortFileName =
- DescriptionBuilder.getShortFileName(deploymentFile.getServiceName());
+ String shortFileName = DescriptionBuilder.getShortFileName(deploymentFile.getName());
if (!explodedDir) {
ZipInputStream zin;
FileInputStream fin;
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Tue Jul 10 18:18:30 2007
@@ -29,25 +29,23 @@
import java.io.File;
import java.net.URL;
-import java.util.ArrayList;
/**
- * ArchiveFileData stores information about the module or service item to be deployed.
+ * DeploymentFileData represents a "thing to deploy" in Axis2. It consists of a file,
+ * a deployment ClassLoader, and a Deployer.
*/
public class DeploymentFileData {
- private File file = null;
- private ArrayList deployableServices = new ArrayList();
+ private File file;
private ClassLoader classLoader;
- private String messageReceiver;
-
private Deployer deployer;
public DeploymentFileData(File file) {
+ if (file == null) throw new IllegalArgumentException("Filename must not be null");
this.file = file;
}
public DeploymentFileData(File file, Deployer deployer) {
- this.file = file;
+ this(file);
this.deployer = deployer;
}
@@ -59,28 +57,27 @@
return classLoader;
}
- public ArrayList getDeployableServices() {
- return deployableServices;
- }
-
public File getFile() {
return file;
}
- public String getMessageReceiver() {
- return messageReceiver;
- }
-
+ /**
+ * Get the name of the file.
+ *
+ * @return the name of the referenced file
+ */
public String getName() {
- return file.getName();
+ return file.getName(); // No need to check for null due to constructor check
}
+ /**
+ * Get the name of the file.
+ *
+ * @return the name of the referenced file
+ * @deprecated please use getName() instead - this will disappear after 1.3.
+ */
public String getServiceName() {
- if (file != null) {
- return file.getName();
- } else {
- return null;
- }
+ return getName();
}
public static boolean isModuleArchiveFile(String filename) {
@@ -127,15 +124,6 @@
}
}
}
-
- public void setDeployableServices(ArrayList deployableServices) {
- this.deployableServices = deployableServices;
- }
-
- public void setMessageReceiver(String messageReceiver) {
- this.messageReceiver = messageReceiver;
- }
-
public Deployer getDeployer() {
return deployer;
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Tue Jul 10 18:18:30 2007
@@ -36,6 +36,7 @@
import org.apache.axis2.dataretrieval.DataRetrievalRequest;
import org.apache.axis2.dataretrieval.LocatorType;
import org.apache.axis2.dataretrieval.OutputForm;
+import org.apache.axis2.dataretrieval.WSDLSupplier;
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.deployment.util.Utils;
import org.apache.axis2.deployment.DeploymentConstants;
@@ -68,8 +69,6 @@
import javax.wsdl.*;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.schema.SchemaReference;
-import javax.wsdl.extensions.schema.SchemaImport;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.wsdl.xml.WSDLWriter;
@@ -78,6 +77,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.PrintWriter;
import java.net.SocketException;
import java.net.URL;
import java.security.PrivilegedAction;
@@ -120,7 +120,6 @@
// to store module ref at deploy time parsing
private ArrayList moduleRefs = null;
- // to store the wsdl definition , which is build at the deployment time
// to keep the time that last update time of the service
private long lastupdate;
private HashMap moduleConfigmap;
@@ -202,7 +201,7 @@
/////////////////////////////////////////
// WSDL related stuff ////////////////////
////////////////////////////////////////
- private NamespaceMap nameSpacesMap;
+ private NamespaceMap namespaceMap;
private String soapNsUri;
private String endpointName;
@@ -226,11 +225,13 @@
private HashMap dataLocatorClassNames;
private AxisDataLocatorImpl defaultDataLocator;
// Define search sequence for datalocator based on Data Locator types.
- LocatorType[] availableDataLocatorTypes = new LocatorType[]{LocatorType.SERVICE_DIALECT,
- LocatorType.SERVICE_LEVEL,
- LocatorType.GLOBAL_DIALECT,
- LocatorType.GLOBAL_LEVEL,
- LocatorType.DEFAULT_AXIS};
+ LocatorType[] availableDataLocatorTypes = new LocatorType[] {
+ LocatorType.SERVICE_DIALECT,
+ LocatorType.SERVICE_LEVEL,
+ LocatorType.GLOBAL_DIALECT,
+ LocatorType.GLOBAL_LEVEL,
+ LocatorType.DEFAULT_AXIS
+ };
// name of the binding used : use in codegeneration
private String bindingName;
@@ -794,7 +795,7 @@
private XmlSchema addNameSpaces(int i) {
XmlSchema schema = (XmlSchema) schemaList.get(i);
- NamespaceMap map = (NamespaceMap) nameSpacesMap.clone();
+ NamespaceMap map = (NamespaceMap) namespaceMap.clone();
NamespacePrefixList namespaceContext = schema.getNamespaceContext();
String prefixes[] = namespaceContext.getDeclaredPrefixes();
for (int j = 0; j < prefixes.length; j++) {
@@ -891,20 +892,6 @@
return eprs;
}
- private void printUserWSDL(OutputStream out) throws AxisFault {
- Parameter wsld4jdefinition = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
- if (wsld4jdefinition != null) {
- try {
- Definition definition = (Definition) wsld4jdefinition.getValue();
- printDefinitionObject(definition, out);
- } catch (WSDLException e) {
- throw AxisFault.makeFault(e);
- }
- } else {
- printWSDLError(out);
- }
- }
-
private void printDefinitionObject(Definition definition, OutputStream out)
throws AxisFault, WSDLException {
if (isModifyUserWSDLPortAddress()) {
@@ -920,12 +907,16 @@
public void printUserWSDL(OutputStream out,
String wsdlName) throws AxisFault {
+ Definition definition = null;
// first find the correct wsdl definition
- Parameter wsld4jdefinition = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
- if (wsld4jdefinition != null) {
+ Parameter wsdlParameter = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
+ if (wsdlParameter != null) {
+ definition = (Definition) wsdlParameter.getValue();
+ }
+
+ if (definition != null) {
try {
- Definition definition = (Definition) wsld4jdefinition.getValue();
- printDefinitionObject(getWSDLDefinition(definition,wsdlName), out);
+ printDefinitionObject(getWSDLDefinition(definition, wsdlName), out);
} catch (WSDLException e) {
throw AxisFault.makeFault(e);
}
@@ -943,6 +934,8 @@
*/
private Definition getWSDLDefinition(Definition parentDefinition, String name) {
+ if (name == null) return parentDefinition;
+
Definition importedDefinition = null;
Iterator iter = parentDefinition.getImports().values().iterator();
Vector values = null;
@@ -977,14 +970,16 @@
//adjust the schema locations in types section
Types types = definition.getTypes();
- List extensibilityElements = types.getExtensibilityElements();
- Object extensibilityElement = null;
- Schema schema = null;
- for (Iterator iter = extensibilityElements.iterator(); iter.hasNext();) {
- extensibilityElement = iter.next();
- if (extensibilityElement instanceof Schema) {
- schema = (Schema) extensibilityElement;
- changeLocations(schema.getElement());
+ if (types != null) {
+ List extensibilityElements = types.getExtensibilityElements();
+ Object extensibilityElement = null;
+ Schema schema = null;
+ for (Iterator iter = extensibilityElements.iterator(); iter.hasNext();) {
+ extensibilityElement = iter.next();
+ if (extensibilityElement instanceof Schema) {
+ schema = (Schema) extensibilityElement;
+ changeLocations(schema.getElement());
+ }
}
}
@@ -1033,17 +1028,38 @@
}
/**
- * @param out
- * @param requestIP
- * @throws AxisFault
+ * Produces a WSDL for this AxisService and prints it to the specified OutputStream.
+ *
+ * @param out destination stream. The WSDL will be sent here.
+ * @param requestIP the hostname the WSDL request was directed at. This should be the address
+ * that appears in the generated WSDL.
+ * @throws AxisFault if an error occurs
*/
public void printWSDL(OutputStream out, String requestIP) throws AxisFault {
+ // If we're looking for pre-existing WSDL, use that.
if (isUseUserWSDL()) {
- printUserWSDL(out);
- } else {
- String[] eprArray = calculateEPRs(requestIP);
- getWSDL(out, eprArray);
+ printUserWSDL(out, null);
+ return;
+ }
+
+ // If we find a WSDLSupplier, use that
+ WSDLSupplier supplier = (WSDLSupplier)getParameterValue("WSDLSupplier");
+ if (supplier != null) {
+ try {
+ Definition definition = supplier.getWSDL(this);
+ if (definition != null) {
+ printDefinitionObject(getWSDLDefinition(definition, null), out);
+ }
+ } catch (Exception e) {
+ printWSDLError(out, e);
+ }
+ return;
}
+
+ // Otherwise, generate WSDL ourselves
+ String[] eprArray = requestIP == null ? new String[] { this.endpointName } :
+ calculateEPRs(requestIP);
+ getWSDL(out, eprArray);
}
/**
@@ -1053,13 +1069,7 @@
* @throws AxisFault
*/
public void printWSDL(OutputStream out) throws AxisFault {
- if (isUseUserWSDL()) {
- printUserWSDL(out);
- } else {
- setWsdlFound(true);
- //pick the endpointName and take it as the epr for the WSDL
- getWSDL(out, new String[]{this.endpointName});
- }
+ printWSDL(out, null);
}
private void setPortAddress(Definition definition) throws AxisFault {
@@ -1114,17 +1124,24 @@
}
private void printWSDLError(OutputStream out) throws AxisFault {
+ printWSDLError(out, null);
+ }
+
+ private void printWSDLError(OutputStream out, Exception e) throws AxisFault {
try {
String wsdlntfound = "<error>" +
"<description>Unable to generate WSDL 1.1 for this service</description>" +
"<reason>If you wish Axis2 to automatically generate the WSDL 1.1, then please +" +
- "set useOriginalwsdl as false in your services.xml</reason>" +
- "</error>";
+ "set useOriginalwsdl as false in your services.xml</reason>";
out.write(wsdlntfound.getBytes());
+ if (e != null) {
+ e.printStackTrace(new PrintWriter(out));
+ }
+ out.write("</error>".getBytes());
out.flush();
out.close();
- } catch (IOException e) {
- throw AxisFault.makeFault(e);
+ } catch (IOException ex) {
+ throw AxisFault.makeFault(ex);
}
}
@@ -1799,11 +1816,23 @@
}
public Map getNameSpacesMap() {
- return nameSpacesMap;
+ return namespaceMap;
+ }
+
+ public Map getNamespaceMap() {
+ return namespaceMap;
}
+ /**
+ * Sets the
+ * @param nameSpacesMap
+ */
public void setNameSpacesMap(NamespaceMap nameSpacesMap) {
- this.nameSpacesMap = nameSpacesMap;
+ this.namespaceMap = nameSpacesMap;
+ }
+
+ public void setNamespaceMap(NamespaceMap namespaceMap) {
+ this.namespaceMap = namespaceMap;
}
private void addSchemaNameSpace(XmlSchema schema) {
@@ -1811,9 +1840,9 @@
String prefix = schema.getNamespaceContext().getPrefix(targetNameSpace);
boolean found = false;
- if (nameSpacesMap != null && nameSpacesMap.size() > 0) {
- Iterator itr = nameSpacesMap.values().iterator();
- Set keys = nameSpacesMap.keySet();
+ if (namespaceMap != null && namespaceMap.size() > 0) {
+ Iterator itr = namespaceMap.values().iterator();
+ Set keys = namespaceMap.keySet();
while (itr.hasNext()) {
String value = (String) itr.next();
if (value.equals(targetNameSpace) && keys.contains(prefix)) {
@@ -1821,11 +1850,11 @@
}
}
}
- if (nameSpacesMap == null) {
- nameSpacesMap = new NamespaceMap();
+ if (namespaceMap == null) {
+ namespaceMap = new NamespaceMap();
}
if (!found) {
- nameSpacesMap.put("ns" + nsCount, targetNameSpace);
+ namespaceMap.put("ns" + nsCount, targetNameSpace);
nsCount++;
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?view=diff&rev=555133&r1=555132&r2=555133
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java Tue Jul 10 18:18:30 2007
@@ -128,7 +128,9 @@
policiesInDefinitions = new HashMap();
- Map namespaceMap = axisService.getNameSpacesMap();
+ Map namespaceMap = axisService.getNamespaceMap();
+ if (namespaceMap == null) namespaceMap = new HashMap();
+
WSDLSerializationUtil.populateNamespaces(ele, namespaceMap);
soap = ele.declareNamespace(URI_WSDL11_SOAP, SOAP11_PREFIX);
soap12 = ele.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
@@ -434,7 +436,7 @@
if (!disableREST) {
generateHTTPPorts(fac, service);
}
- }
+ }
private void generateSOAP11Ports(OMFactory fac, OMElement service)
throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org