Author: mageshbk(a)jboss.com
Date: 2009-08-11 13:56:42 -0400 (Tue, 11 Aug 2009)
New Revision: 10520
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
Log:
[JBPAPP-2327] JavatoWSDL Package to Namespace mapping does not support multiple packages
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -25,8 +25,10 @@
import java.io.StringWriter;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.rpc.encoding.TypeMapping;
@@ -242,11 +244,18 @@
* think about changing just the type namespace as the types are
* generated using the typenamespace.
*
- * @param pn The Map
+ * @param map The Map
*/
- public void setPackageNamespaceMap(Map<String,String> pn)
+ public void setPackageNamespaceMap(Map<String,String> map)
{
- this.packageNamespaceMap = pn;
+ //Lets convert the namespace->package map to package->namespace map
+ Set<String> keys = map.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ packageNamespaceMap.put(map.get(pkg), pkg);
+ }
}
public void setOperationMap(Map<String, List<OperationConfig>>
operationMap)
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -82,7 +82,6 @@
private JavaWsdlMapping javaWsdlMapping = new JavaWsdlMapping();
private Map<QName, JavaXmlTypeMapping> mappedTypes = new HashMap<QName,
JavaXmlTypeMapping>();
private Set<String> mappedPackages = new HashSet<String>();
- private Map<String,String> packageNamespaceMap = new
HashMap<String,String>();
private Set<String> mappedExceptions = new HashSet<String>();
protected void processTypes()
@@ -249,7 +248,9 @@
for(FaultMetaData fmd : operation.getFaults())
{
- JavaXmlTypeMapping typeMapping = mappedTypes.get(fmd.getXmlType());
+ String ns = getNamespace(fmd.getJavaType(),
fmd.getXmlType().getNamespaceURI());
+ QName newXmlType = new QName(ns, fmd.getXmlType().getLocalPart());
+ JavaXmlTypeMapping typeMapping = mappedTypes.get(newXmlType);
if (typeMapping == null)
continue;
@@ -277,7 +278,7 @@
// Add package mapping for SEI
String name = endpoint.getServiceEndpointInterface().getPackage().getName();
- String namespace = packageNamespaceMap.get(name);
+ String namespace = getNamespace(name);
if (namespace == null)
namespace = WSDLUtils.getInstance().getTypeNamespace(name);
addPackageMapping(name, namespace);
@@ -358,6 +359,7 @@
if(Holder.class.isAssignableFrom(javaType))
javaType = WSDLUtils.getInstance().getJavaTypeForHolder(javaType);
JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType,
elementNames);
+ String namespace = getNamespace(javaType, xmlType.getNamespaceURI());
// Now that the schema object graph is built,
// ask JavaToXSD to provide a list of xsmodels to be plugged
// into WSDLTypes
@@ -365,20 +367,21 @@
throw new WSException("XSModel is null");
WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- WSDLUtils.addSchemaModel(wsdlTypes, xmlType.getNamespaceURI(), xsModel);
- wsdl.registerNamespaceURI(xmlType.getNamespaceURI(), null);
+ WSDLUtils.addSchemaModel(wsdlTypes, namespace, xsModel);
+ wsdl.registerNamespaceURI(namespace, null);
//Also get any custom namespaces
SchemaCreatorIntf schemaCreator = javaToXSD.getSchemaCreator();
mergeJavaWsdlMapping(schemaCreator.getJavaWsdlMapping());
- HashMap map = schemaCreator.getCustomNamespaceMap();
- Set keys = map != null ? map.keySet() : null;
+ //Register the custom generated namespaces
+ Map<String, String> nsmap = schemaCreator.getCustomNamespaceMap();
+ Set keys = nsmap != null ? nsmap.keySet() : null;
Iterator iter = (keys != null && !keys.isEmpty()) ? keys.iterator() :
null;
while (iter != null && iter.hasNext())
{
- String pref = (String)iter.next();
- String ns = (String)map.get(pref);
+ String prefix = (String)iter.next();
+ String ns = nsmap.get(prefix);
if (ns != null)
wsdl.registerNamespaceURI(ns, null);
}
@@ -390,7 +393,7 @@
for (PackageMapping packageMapping : source.getPackageMappings())
{
String name = packageMapping.getPackageType();
- String namespaceURI = packageMapping.getNamespaceURI();
+ String namespaceURI = getNamespace(name, packageMapping.getNamespaceURI());
addPackageMapping(name, namespaceURI);
}
@@ -401,16 +404,22 @@
if (name == null)
name = type.getAnonymousTypeQName();
+ //override namespace from globalconfig
+ String pkgName = getJustPackageName(type.getJavaType());
+ String ns = getNamespace(pkgName, name.getNamespaceURI());
+ name = new QName(ns, name.getLocalPart(), name.getPrefix());
+
if (mappedTypes.containsKey(name))
continue;
+ addPackageMapping(pkgName, ns);
mappedTypes.put(name, type);
JavaXmlTypeMapping typeCopy = new JavaXmlTypeMapping(javaWsdlMapping);
typeCopy.setQNameScope(type.getQnameScope());
typeCopy.setAnonymousTypeQName(type.getAnonymousTypeQName());
typeCopy.setJavaType(type.getJavaType());
- typeCopy.setRootTypeQName(type.getRootTypeQName());
+ typeCopy.setRootTypeQName(name);
for (VariableMapping variable : type.getVariableMappings())
{
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -304,12 +304,12 @@
if (xmlType != null)
{
name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
}
else
{
name = WSDLUtils.getJustClassName(javaType);
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
}
// Check if it is a JAX-RPC enumeration
@@ -567,19 +567,19 @@
if (xmlType != null)
{
name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(componentType, xmlType.getNamespaceURI());
}
else
{
if (isComponentArray == false)
{
name = utils.getJustClassName(componentType.getName()) + ".Array";
- namespace = getNamespace(componentType);
+ namespace = getNamespace(componentType, null);
}
else
{
name = xst.getName() + ".Array";
- namespace = xst.getNamespace();
+ namespace = getNamespace(componentType, xst.getNamespace());
}
}
@@ -701,23 +701,42 @@
}
}
- private String getNamespace(Class javaType)
+ private String getNamespace(Class javaType, String defaultNS)
{
- if (javaType.isPrimitive())
- return Constants.NS_JBOSSWS_URI + "/primitives";
+ String retNS = defaultNS;
+ if (javaType.isPrimitive() && retNS == null)
+ {
+ retNS = Constants.NS_JBOSSWS_URI + "/primitives";
+ }
+ else
+ {
+ while (javaType.isArray())
+ {
+ javaType = javaType.getComponentType();
+ }
- Package javaPackage = javaType.getPackage();
- if (javaPackage == null)
- throw new WSException("Cannot determine namespace, Class had no
package");
- String packageName = javaPackage.getName();
+ Package javaPackage = javaType.getPackage();
+ if (javaPackage != null)
+ {
+ String packageName = javaPackage.getName();
+ String ns = packageNamespaceMap.get(packageName);
+ if (ns != null)
+ {
+ retNS = ns;
+ }
+ else if (retNS == null)
+ {
+ retNS = utils.getTypeNamespace(packageName);
+ }
- String ns = packageNamespaceMap.get(packageName);
- if (ns == null)
- ns = utils.getTypeNamespace(packageName);
-
- allocatePrefix(ns);
-
- return ns;
+ allocatePrefix(retNS);
+ }
+ else if (retNS == null)
+ {
+ throw new WSException("Cannot determine namespace, Class had no
package");
+ }
+ }
+ return retNS;
}
private JBossXSComplexTypeDefinition getComplexTypeForJavaException(QName xmlType,
Class javaType)
@@ -731,12 +750,12 @@
String namespace;
if (xmlType != null)
{
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
name = xmlType.getLocalPart();
}
else
{
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
name = WSDLUtils.getJustClassName(javaType);
}
@@ -749,6 +768,8 @@
xsModel.addXSComplexTypeDefinition(complexType);
xsModel.addXSElementDeclaration(sutils.createGlobalXSElementDeclaration(name,
complexType, namespace));
typeMapping.register(javaType, new QName(namespace, name), null, null);
+ generateExceptionParticles(namespace, javaType, types, particles);
+
registerJavaTypeMapping(new QName(namespace, name), javaType,
"complexType", particles, null);
Class superClass = javaType.getSuperclass();
@@ -758,7 +779,6 @@
complexType.setBaseType(baseType);
}
- generateExceptionParticles(namespace, javaType, types, particles);
boolean found = hasConstructor(javaType, types);
boolean noarg = found && types.size() == 0;
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -288,8 +288,7 @@
if (writtenFaultMessages.contains(exceptionName))
continue;
- WSDLInterfaceFault interfaceFault =
operation.getWsdlInterface().getFault(fault.getRef());
- QName xmlName = interfaceFault.getElement();
+ QName xmlName = fault.getRef();
buffer.append("<message name='" + exceptionName + "'
>");
String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
@@ -449,8 +448,7 @@
for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
{
QName element = fault.getRef();
- String faultPrefix = wsdl.getPrefix(element.getNamespaceURI());
- buffer.append("<fault message='" + faultPrefix +
":" + element.getLocalPart());
+ buffer.append("<fault message='" + prefix + ":" +
element.getLocalPart());
buffer.append("' name='" + element.getLocalPart() +
"'/>");
}
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -23,7 +23,10 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
@@ -81,6 +84,8 @@
protected abstract void processTypes();
+ protected Map<String,String> packageNamespaceMap = new
HashMap<String,String>();
+
protected void processEndpoint(WSDLService service, EndpointMetaData endpoint)
{
WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(service, endpoint.getPortName());
@@ -216,7 +221,9 @@
wsdlInterface.addFault(interfaceFault);
WSDLInterfaceOperationOutfault outfault = new
WSDLInterfaceOperationOutfault(interfaceOperation);
- outfault.setRef(faultName);
+ String ns = getNamespace(fault.getJavaType(),
operation.getQName().getNamespaceURI());
+ QName outFaultName = new QName(ns, fault.getXmlName().getLocalPart());
+ outfault.setRef(outFaultName);
interfaceOperation.addOutfault(outfault);
WSDLBindingFault bindingFault = new WSDLBindingFault(wsdlBinding);
@@ -355,7 +362,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(returnParameter.getPartName(),
returnParameter.getXmlType());
+ QName xmlType = returnParameter.getXmlType();
+ String ns = getNamespace(returnParameter.getJavaType(),
xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(partName, newXmlType);
+
output.addChildPart(part);
}
addSignatureItem(interfaceOperation, returnParameter, true);
@@ -378,7 +389,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), param.getXmlType());
+ QName xmlType = param.getXmlType();
+
+ String ns = getNamespace(param.getJavaType(), xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), newXmlType);
if (param.getMode() != ParameterMode.OUT)
input.addChildPart(part);
if (twoWay && param.getMode() != ParameterMode.IN)
@@ -428,6 +443,18 @@
wsdl.registerNamespaceURI(ns, "tns");
wsdl.registerNamespaceURI(Constants.NS_SCHEMA_XSD, "xsd");
+ // Register global namespaces
+ if (packageNamespaceMap != null)
+ {
+ Set<String> keys = packageNamespaceMap.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ wsdl.registerNamespaceURI(packageNamespaceMap.get(pkg), null);
+ }
+ }
+
String soapURI = null;
String soapPrefix = null;
for (EndpointMetaData ep : service.getEndpoints())
@@ -453,4 +480,47 @@
return wsdl;
}
+
+ protected String getNamespace(String packageName, String defaultNS)
+ {
+ String retNS = defaultNS;
+ //Get it from global config if it is overriden
+ if (packageNamespaceMap != null)
+ {
+ String ns = packageNamespaceMap.get(packageName);
+ if (ns != null)
+ {
+ retNS = ns;
+ }
+ }
+ return retNS;
+ }
+
+ protected String getNamespace(String packageName)
+ {
+ return getNamespace(packageName, wsdl.getTargetNamespace());
+ }
+
+ protected String getNamespace(Class type, String defaultNS)
+ {
+ while (type.isArray())
+ {
+ type = type.getComponentType();
+ }
+ Package pkg = type.getPackage();
+ String pkgName = null;
+ if (pkg != null)
+ {
+ pkgName = pkg.getName();
+ }
+ return getNamespace(pkgName, defaultNS);
+ }
+
+ protected String getJustPackageName(String classname)
+ {
+ int index = classname.lastIndexOf(".");
+ if (index < 0)
+ index = classname.length();
+ return classname.substring(0,index);
+ }
}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jbws2018.base;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class BaseException extends Exception
+{
+ public BaseException()
+ {
+ }
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws2018;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * JBWS-2018 - Test the support of multiple namespace to multiple
+ * package generation of tools JavaToWSDL.
+ *
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class JBWS2018TestCase extends WSToolsTest
+{
+ public final void testMultiplePackageNameSpace() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws2018";
+ String toolsDir = "tools/jbws2018";
+ String[] args = new String[] { "-dest", toolsDir, "-config",
resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ semanticallyValidateWSDL(resourceDir + "/TestService.wsdl", toolsDir +
"/wsdl/TestService.wsdl");
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir +
"/jaxrpc-mapping.xml");
+ }
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jbws2018;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import org.jboss.test.ws.jbws2018.base.BaseException;
+import org.jboss.test.ws.jbws2018.exception.TestException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public interface Test extends Remote
+{
+
+ public void testException() throws TestException, RemoteException;
+ public BaseException getException() throws TestException, RemoteException;
+ public void setException(BaseException error) throws TestException, RemoteException;
+ public BaseException[] getExceptions() throws TestException, RemoteException;
+ public void setExceptions(BaseException[] errors) throws TestException,
RemoteException;
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jbws2018.exception;
+
+import org.jboss.test.ws.jbws2018.base.BaseException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class TestException extends BaseException
+{
+ public TestException()
+ {
+ }
+}
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2009-08-11
14:01:52 UTC (rev 10519)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2009-08-11
17:56:42 UTC (rev 10520)
@@ -29,6 +29,10 @@
<java-type>org.jboss.test.ws.tools.jbws1231.CustomException</java-type>
<root-type-qname
xmlns:typeNS='http://org.jboss.test.ws/jbws1231/type'>typeNS:CustomException</root-type-qname>
<qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>wrappedException</java-variable-name>
+ <xml-element-name>wrappedException</xml-element-name>
+ </variable-mapping>
</java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.tools.jbws1231.TestEndpoint_echoDataObject_ResponseStruct</java-type>
@@ -42,6 +46,9 @@
<exception-mapping>
<exception-type>org.jboss.test.ws.tools.jbws1231.CustomException</exception-type>
<wsdl-message
xmlns:exMsgNS='http://org.jboss.test.ws/jbws1231'>exMsgNS:CustomException</wsdl-message>
+ <constructor-parameter-order>
+ <element-name>wrappedException</element-name>
+ </constructor-parameter-order>
</exception-mapping>
<service-interface-mapping>
<service-interface>org.jboss.test.ws.tools.jbws1231.TestService</service-interface>
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService'
targetNamespace='http://org.jboss.test.ws.jbws2018'
xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://com.other.base'
xmlns:ns2='http://com.other.exception'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws.jbws2018'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://com.other.exception'
xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://com.other.base'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://com.other.exception'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.base'/>
+ <complexType name='TestException'>
+ <complexContent>
+ <extension base='ns2:BaseException'>
+ <sequence/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name='TestException' type='tns:TestException'/>
+ </schema>
+ <schema targetNamespace='http://com.other.base'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:ns1='http://com.other.exception'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://com.other.base'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.exception'/>
+ <complexType name='BaseException'>
+ <sequence/>
+ </complexType>
+ <complexType name='BaseException.Array'>
+ <sequence>
+ <element maxOccurs='unbounded' minOccurs='0' name='value'
nillable='true' type='tns:BaseException'/>
+ </sequence>
+ </complexType>
+ <element name='BaseException' type='tns:BaseException'/>
+ </schema>
+ </types>
+ <message name='Test_getException'
xmlns='http://schemas.xmlsoap.org/wsdl/'/>
+ <message name='Test_getExceptionResponse'>
+ <part name='result' type='ns1:BaseException'/>
+ </message>
+ <message name='TestException'>
+ <part element='ns2:TestException' name='TestException'/>
+ </message>
+ <message name='Test_getExceptions'/>
+ <message name='Test_getExceptionsResponse'>
+ <part name='result' type='ns1:BaseException.Array'/>
+ </message>
+ <message name='Test_setException'>
+ <part name='BaseException_1' type='ns1:BaseException'/>
+ </message>
+ <message name='Test_setExceptionResponse'/>
+ <message name='Test_setExceptions'>
+ <part name='arrayOfBaseException_1'
type='ns1:BaseException.Array'/>
+ </message>
+ <message name='Test_setExceptionsResponse'/>
+ <message name='Test_testException'/>
+ <message name='Test_testExceptionResponse'/>
+ <portType name='Test'>
+ <operation name='getException'>
+ <input message='tns:Test_getException'/>
+ <output message='tns:Test_getExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='getExceptions'>
+ <input message='tns:Test_getExceptions'/>
+ <output message='tns:Test_getExceptionsResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='setException' parameterOrder='BaseException_1'>
+ <input message='tns:Test_setException'/>
+ <output message='tns:Test_setExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='setExceptions'
parameterOrder='arrayOfBaseException_1'>
+ <input message='tns:Test_setExceptions'/>
+ <output message='tns:Test_setExceptionsResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='testException'>
+ <input message='tns:Test_testException'/>
+ <output message='tns:Test_testExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ </portType>
+ <binding name='TestBinding' type='tns:Test'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='getExceptions'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='setException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='setExceptions'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='testException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestBinding' name='TestPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping
version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.exception</package-type>
+ <namespaceURI>http://com.other.exception</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.base</package-type>
+ <namespaceURI>http://com.other.base</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018</package-type>
+ <namespaceURI>http://org.jboss.test.ws.jbws2018</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.exception.TestException</java-type>
+ <root-type-qname
xmlns:typeNS='http://com.other.exception'>typeNS:TestException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.base.BaseException</java-type>
+ <root-type-qname
xmlns:typeNS='http://com.other.base'>typeNS:BaseException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <exception-mapping>
+
<exception-type>org.jboss.test.ws.jbws2018.exception.TestException</exception-type>
+ <wsdl-message
xmlns:exMsgNS='http://org.jboss.test.ws.jbws2018'>exMsgNS:TestException</wsdl-message>
+ </exception-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.test.ws.jbws2018.TestService</service-interface>
+ <wsdl-service-name
xmlns:serviceNS='http://org.jboss.test.ws.jbws2018'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestPort</port-name>
+ <java-port-name>TestPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.test.ws.jbws2018.Test</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS='http://org.jboss.test.ws.jbws2018'>portTypeNS:Test</wsdl-port-type>
+ <wsdl-binding
xmlns:bindingNS='http://org.jboss.test.ws.jbws2018'>bindingNS:TestBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>getException</java-method-name>
+ <wsdl-operation>getException</wsdl-operation>
+ <wsdl-return-value-mapping>
+
<method-return-value>org.jboss.test.ws.jbws2018.base.BaseException</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_getExceptionResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>testException</java-method-name>
+ <wsdl-operation>testException</wsdl-operation>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>setException</java-method-name>
+ <wsdl-operation>setException</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws2018.base.BaseException</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_setException</wsdl-message>
+ <wsdl-message-part-name>BaseException_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>getExceptions</java-method-name>
+ <wsdl-operation>getExceptions</wsdl-operation>
+ <wsdl-return-value-mapping>
+
<method-return-value>org.jboss.test.ws.jbws2018.base.BaseException[]</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_getExceptionsResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>setExceptions</java-method-name>
+ <wsdl-operation>setExceptions</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws2018.base.BaseException[]</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_setExceptions</wsdl-message>
+ <wsdl-message-part-name>arrayOfBaseException_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml 2009-08-11
17:56:42 UTC (rev 10520)
@@ -0,0 +1,16 @@
+<configuration
xmlns="http://www.jboss.org/jbossws-tools"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+ <global>
+ <package-namespace package="org.jboss.test.ws.jbws2018.base"
namespace="http://com.other.base"/>
+ <package-namespace package="org.jboss.test.ws.jbws2018.exception"
namespace="http://com.other.exception"/>
+ </global>
+
+ <java-wsdl>
+ <service name="TestService" style="rpc"
endpoint="org.jboss.test.ws.jbws2018.Test"/>
+ <namespaces target-namespace="http://org.jboss.test.ws.jbws2018"
type-namespace="http://org.jboss.test.ws.jbws2018"/>
+ <mapping file="jaxrpc-mapping.xml" />
+ <webservices ejb-link="TestEJB"/>
+ </java-wsdl>
+
+</configuration>
\ No newline at end of file