JBossWS SVN: r1619 - in branches/dlofthouse/JBWS-1260/src: main/java/org/jboss/ws/tools main/java/org/jboss/ws/tools/helpers main/java/org/jboss/ws/tools/mapping test/java/org/jboss/test/ws/tools test/java/org/jboss/test/ws/tools/jbws1260 test/java/org/jboss/test/ws/tools/validation test/resources/tools/jbws1260/scenario_A test/resources/tools/jbws1260/scenario_B test/resources/tools/jbws1260/scenario_C test/resources/tools/jbws1260/scenario_D test/resources/tools/jbws1260/scenario_E
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-10 12:58:14 -0500 (Sun, 10 Dec 2006)
New Revision: 1619
Added:
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wrapped-mapping.xml
Modified:
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wstools-config.xml
Log:
JBWS-1260 - Mapping file generation for first four scenarios.
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -60,6 +60,7 @@
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.tools.helpers.ReturnTypeUnwrapper;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
@@ -218,95 +219,6 @@
}
}
- private class WrappedType
- {
-
- public XSTypeDefinition xt;
- public XSAttributeDeclaration unwrappedAttribute;
- public XSElementDeclaration unwrappedElement;
- public String suffix = "";
-
- public WrappedType(XSTypeDefinition xt)
- {
- this.xt = xt;
- }
-
- public boolean unwrap()
- {
- if (isWrapped() == false)
- return false;
-
- if (xt instanceof XSComplexTypeDefinition == false)
- throw new WSException("Tried to unwrap a non-complex type.");
-
- XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
-
- boolean unwrappedAttribute = false;
- boolean unwrappedElement = false;
-
- unwrappedAttribute = unwrapAttributeUses(wrapper.getAttributeUses());
-
- XSParticle particle = wrapper.getParticle();
- if (particle != null)
- {
- XSTerm term = particle.getTerm();
-
- if (term instanceof XSModelGroup == false)
- throw new WSException("Expected model group, could not unwrap");
-
- XSModelGroup group = (XSModelGroup)term;
-
- unwrappedElement = unwrapModelGroup(group);
- }
-
- // We can only say we unwrapped if we only unwrapped one.
- return unwrappedAttribute ^ unwrappedElement;
- }
-
- private boolean unwrapModelGroup(XSModelGroup group)
- {
- XSObjectList particles = group.getParticles();
- if (particles.getLength() == 1)
- {
- XSParticle particle = (XSParticle)particles.item(0);
- boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
- XSTerm term = particle.getTerm();
-
- if (term instanceof XSModelGroup)
- {
- return unwrapModelGroup((XSModelGroup)term);
- }
- else if (term instanceof XSElementDeclaration)
- {
- unwrappedElement = (XSElementDeclaration)term;
- if (array)
- {
- suffix = "[]";
- }
- }
-
- }
-
- return unwrappedElement != null;
- }
-
- private boolean unwrapAttributeUses(XSObjectList attributeUses)
- {
- if (attributeUses.getLength() == 1)
- {
- XSObject object = attributeUses.item(0);
- if (object instanceof XSAttributeUse)
- {
- XSAttributeUse attributeUse = (XSAttributeUse)object;
- unwrappedAttribute = attributeUse.getAttrDeclaration();
- }
- }
-
- return unwrappedAttribute != null;
- }
-
- }
-
//***************************************************************************
// PRIVATE METHODS
//***************************************************************************
@@ -675,18 +587,19 @@
JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
- WrappedType wt = new WrappedType(xt);
- if (wt.unwrap())
+ ReturnTypeUnwrapper unwrapper = new ReturnTypeUnwrapper(xt, isWrapped());
+ if (unwrapper.unwrap())
{
- if (wt.unwrappedElement != null)
+ if (unwrapper.unwrappedElement != null)
{
- xt = wt.unwrappedElement.getTypeDefinition();
- containingElement = containingElement + wt.unwrappedElement.getName();
- arraySuffix = wt.suffix;
+ xt = unwrapper.unwrappedElement.getTypeDefinition();
+ containingElement = containingElement + unwrapper.unwrappedElement.getName();
+ if (unwrapper.array)
+ arraySuffix = "[]";
}
- else if (wt.unwrappedAttribute != null)
+ else if (unwrapper.unwrappedAttribute != null)
{
- xt = wt.unwrappedAttribute.getTypeDefinition();
+ xt = unwrapper.unwrappedAttribute.getTypeDefinition();
}
}
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -22,7 +22,9 @@
package org.jboss.ws.tools.helpers;
import java.beans.Introspector;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.xml.namespace.QName;
@@ -87,9 +89,10 @@
// provide logging
private static final Logger log = Logger.getLogger(MappingFileGeneratorHelper.class);
private WSDLDefinitions wsdlDefinitions = null;
+ private String typeNamespace;
private String serviceName = null;
private String packageName = null;
-
+
private Set<String> registeredTypes = new HashSet<String>();
private LiteralTypeMapping typeMapping = null;
@@ -99,11 +102,11 @@
private String parameterStyle;
- public MappingFileGeneratorHelper(WSDLDefinitions wsdl, String sname, String pname, Class seiClass, String tns, LiteralTypeMapping ltm, String paramStyle)
+ public MappingFileGeneratorHelper(WSDLDefinitions wsdl, String sname, String pname, Class seiClass, LiteralTypeMapping ltm, String paramStyle)
{
this.wsdlDefinitions = wsdl;
this.serviceName = sname;
- this.packageName = pname;
+ this.packageName = pname;
this.typeMapping = ltm;
this.wsdlStyle = utils.getWSDLStyle(wsdl);
@@ -111,6 +114,14 @@
checkEssentials();
}
+ /**
+ * Returns the type namespace that was discovered during generation.
+ */
+ public String getTypeNamespace()
+ {
+ return typeNamespace;
+ }
+
public PackageMapping constructPackageMapping(JavaWsdlMapping jwm, String packageType, String ns)
{
PackageMapping pk = new PackageMapping(jwm);
@@ -228,29 +239,46 @@
WSDLProperty wprop = wiout.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME);
QName messageName = new QName(targetNS, wprop.getValue(), WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_WSDL_MESSAGE_NS);
- if (isWrapped())
+ wprop = wiout.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
+ String partName = wprop.getValue();
+ String containingElement = xmlName.getLocalPart();
+ boolean array = false;
+ JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
+
+ ReturnTypeUnwrapper unwrapper = new ReturnTypeUnwrapper(xt, isWrapped());
+ if (unwrapper.unwrap())
{
- JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
- unwrapResponse(semm, messageName, xt);
-
- continue;
+ if (unwrapper.unwrappedElement != null)
+ {
+ XSElementDeclaration element = unwrapper.unwrappedElement;
+ xt = element.getTypeDefinition();
+ partName = element.getName();
+ containingElement = containingElement + unwrapper.unwrappedElement.getName();
+ array = unwrapper.array;
+ }
+ else if (unwrapper.unwrappedAttribute != null)
+ {
+ xt = unwrapper.unwrappedAttribute.getTypeDefinition();
+ }
}
//Check it is a holder. If it is, return
if (wiop.getInputByPartName(xmlName.getLocalPart()) != null)
continue;
- String javaType = getJavaTypeAsString(xmlName, xmlType, false, true);
+ if (xt instanceof XSSimpleTypeDefinition)
+ xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
+ String javaType = getJavaTypeAsString(xmlName, xmlType, array, true);
+
if (isDocStyle() == false && "void".equals(javaType))
continue;
WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
wrvm.setMethodReturnValue(javaType);
wrvm.setWsdlMessage(messageName);
- wprop = wiout.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
- wrvm.setWsdlMessagePartName(wprop.getValue());
+ wrvm.setWsdlMessagePartName(partName);
semm.setWsdlReturnValueMapping(wrvm);
}
}
@@ -276,16 +304,20 @@
paramMode = WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_IN_OUT_HOLDER_PARAM_MODE;
else paramMode = WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_IN_PARAM_MODE;
- if (isWrapped())
+ boolean wrapped = isWrapped();
+
+ if (wrapped)
{
JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
- unwrapRequest(semm, wsdlMessageName, xt);
- break;
+ wrapped = unwrapRequest(semm, wsdlMessageName, xt);
}
- MethodParamPartsMapping mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, k, wsdlMessageName, paramMode, partName, false, true);
- semm.addMethodParamPartsMapping(mpin);
+ if (wrapped == false)
+ {
+ MethodParamPartsMapping mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, k, wsdlMessageName, paramMode, partName, false, true);
+ semm.addMethodParamPartsMapping(mpin);
+ }
}
//Take care of out holders
WSDLInterfaceOperationOutput[] outs = wiop.getOutputs();
@@ -353,67 +385,64 @@
}
}
- private void unwrapRequest(ServiceEndpointMethodMapping methodMapping, String messageName, XSTypeDefinition xt)
+ private boolean unwrapRequest(ServiceEndpointMethodMapping methodMapping, String messageName, XSTypeDefinition xt)
{
if (xt instanceof XSComplexTypeDefinition == false)
throw new WSException("Tried to unwrap a non-complex type.");
+ List<MethodParamPartsMapping> partsMappings = new ArrayList<MethodParamPartsMapping>();
+
XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
- XSParticle particle = wrapper.getParticle();
- XSTerm term = particle.getTerm();
- if (term instanceof XSModelGroup == false)
- throw new WSException("Expected model group, could not unwrap");
- unwrapRequestParticles(methodMapping, messageName, (XSModelGroup)term);
- }
- private int unwrapRequestParticles(ServiceEndpointMethodMapping methodMapping, String messageName, XSModelGroup group)
- {
- if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE)
- throw new WSException("Only a sequence type can be unwrapped.");
+ boolean appendedAttribute = unwrapAttributes(partsMappings, methodMapping, wrapper.getAttributeUses());
+ boolean unwrappedElement = false;
- int elementCount = 0;
- XSObjectList particles = group.getParticles();
- for (int i = 0; i < particles.getLength(); i++)
+ XSParticle particle = wrapper.getParticle();
+ if (particle == null)
{
- XSParticle particle = (XSParticle)particles.item(i);
+ if (appendedAttribute)
+ {
+ addMethodParamPartsMappings(partsMappings, methodMapping);
+ }
+
+ return true;
+ }
+ else
+ {
XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup)
{
- elementCount += unwrapRequestParticles(methodMapping, messageName, (XSModelGroup)term);
+ unwrappedElement = unwrapGroup(partsMappings, methodMapping, messageName, (XSModelGroup)term);
}
- else if (term instanceof XSElementDeclaration)
- {
- XSElementDeclaration element = (XSElementDeclaration)term;
- QName xmlName = new QName(element.getNamespace(), element.getName());
- QName xmlType = new QName(element.getTypeDefinition().getNamespace(), element.getTypeDefinition().getName());
- boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
- MethodParamPartsMapping parts = getMethodParamPartsMapping(methodMapping, xmlName, xmlType, elementCount, messageName, "IN", xmlName.getLocalPart(), array,
- !element.getNillable());
- methodMapping.addMethodParamPartsMapping(parts);
- elementCount++;
- }
}
- return elementCount;
+ if ((appendedAttribute && unwrappedElement) || unwrappedElement)
+ {
+ addMethodParamPartsMappings(partsMappings, methodMapping);
+
+ return true;
+ }
+
+ return false;
}
- private void unwrapResponse(ServiceEndpointMethodMapping methodMapping, QName messageName, XSTypeDefinition xt)
+ private void addMethodParamPartsMappings(List<MethodParamPartsMapping> partsMappings, ServiceEndpointMethodMapping methodMapping)
{
- if (xt instanceof XSComplexTypeDefinition == false)
- throw new WSException("Tried to unwrap a non-complex type.");
+ for (MethodParamPartsMapping current : partsMappings)
+ {
+ methodMapping.addMethodParamPartsMapping(current);
+ }
+ }
- XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
- XSParticle particle = wrapper.getParticle();
- XSTerm term = particle.getTerm();
- if (term instanceof XSModelGroup == false)
- throw new WSException("Expected model group, could not unwrap");
- unwrapResponseParticles(methodMapping, messageName, (XSModelGroup)term);
+ private boolean unwrapAttributes(List<MethodParamPartsMapping> partsMappings, ServiceEndpointMethodMapping methodMapping, XSObjectList attributes)
+ {
+ return false;
}
- private boolean unwrapResponseParticles(ServiceEndpointMethodMapping methodMapping, QName messageName, XSModelGroup group)
+ private boolean unwrapGroup(List<MethodParamPartsMapping> partsMappings, ServiceEndpointMethodMapping methodMapping, String messageName, XSModelGroup group)
{
if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE)
- throw new WSException("Only a sequence type can be unwrapped.");
+ return false;
XSObjectList particles = group.getParticles();
for (int i = 0; i < particles.getLength(); i++)
@@ -422,28 +451,35 @@
XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup)
{
- if (unwrapResponseParticles(methodMapping, messageName, (XSModelGroup)term))
- return true;
+ if (unwrapGroup(partsMappings, methodMapping, messageName, (XSModelGroup)term) == false)
+ return false;
}
else if (term instanceof XSElementDeclaration)
{
XSElementDeclaration element = (XSElementDeclaration)term;
+ XSTypeDefinition type = element.getTypeDefinition();
+
QName xmlName = new QName(element.getNamespace(), element.getName());
- QName xmlType = new QName(element.getTypeDefinition().getNamespace(), element.getTypeDefinition().getName());
+ QName xmlType;
+ if (type.getAnonymous())
+ {
+ xmlType = new QName(type.getNamespace(), messageName);
+ }
+ else
+ {
+ xmlType = new QName(type.getNamespace(), type.getName());
+ }
+
boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
- String javaType = getJavaTypeAsString(xmlName, xmlType, array, !element.getNillable());
- WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(methodMapping);
- wrvm.setMethodReturnValue(javaType);
- wrvm.setWsdlMessage(messageName);
- wrvm.setWsdlMessagePartName(xmlName.getLocalPart());
- methodMapping.setWsdlReturnValueMapping(wrvm);
-
- return true;
+ MethodParamPartsMapping part = getMethodParamPartsMapping(methodMapping, xmlName, xmlType, partsMappings.size(), messageName, "IN", xmlName.getLocalPart(),
+ array, !element.getNillable());
+ partsMappings.add(part);
}
}
- return false;
+ // If we reach here we must have successfully unwrapped the parameters.
+ return true;
}
private void checkEssentials()
@@ -473,7 +509,7 @@
return xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
}
- private void addJavaXMLTypeMap(XSTypeDefinition xt,String name, String containingElement, JavaWsdlMapping jwm, boolean skipWrapperArray)
+ private void addJavaXMLTypeMap(XSTypeDefinition xt, String name, String containingElement, JavaWsdlMapping jwm, boolean skipWrapperArray)
{
JavaXmlTypeMapping jxtm = null;
@@ -512,6 +548,11 @@
jxtm.setRootTypeQName(new QName(xt.getNamespace(), xt.getName(), "typeNS"));
}
+ if (typeNamespace == null)
+ {
+ typeNamespace = xt.getNamespace();
+ }
+
if (registeredTypes.contains(javaType))
return;
Added: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.tools.helpers;
+
+import org.apache.xerces.xs.XSAttributeDeclaration;
+import org.apache.xerces.xs.XSAttributeUse;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSObject;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.WSException;
+
+/**
+ * A helper class to unwrap a return type is possible.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 10 Dec 2006
+ */
+public class ReturnTypeUnwrapper
+{
+
+ public XSTypeDefinition xt;
+ public XSAttributeDeclaration unwrappedAttribute;
+ public XSElementDeclaration unwrappedElement;
+ public boolean array = false;
+ private boolean wrapped;
+
+ public ReturnTypeUnwrapper(XSTypeDefinition xt, boolean wrapped)
+ {
+ this.xt = xt;
+ this.wrapped = wrapped;
+ }
+
+ public boolean unwrap()
+ {
+ if (wrapped == false)
+ return false;
+
+ if (xt instanceof XSComplexTypeDefinition == false)
+ throw new WSException("Tried to unwrap a non-complex type.");
+
+ XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
+
+ boolean unwrappedAttribute = false;
+ boolean unwrappedElement = false;
+
+ unwrappedAttribute = unwrapAttributeUses(wrapper.getAttributeUses());
+
+ XSParticle particle = wrapper.getParticle();
+ if (particle != null)
+ {
+ XSTerm term = particle.getTerm();
+
+ if (term instanceof XSModelGroup == false)
+ throw new WSException("Expected model group, could not unwrap");
+
+ XSModelGroup group = (XSModelGroup)term;
+
+ unwrappedElement = unwrapModelGroup(group);
+ }
+
+ // We can only say we unwrapped if we only unwrapped one.
+ return unwrappedAttribute ^ unwrappedElement;
+ }
+
+ private boolean unwrapModelGroup(XSModelGroup group)
+ {
+ XSObjectList particles = group.getParticles();
+ if (particles.getLength() == 1)
+ {
+ XSParticle particle = (XSParticle)particles.item(0);
+ boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
+ XSTerm term = particle.getTerm();
+
+ if (term instanceof XSModelGroup)
+ {
+ return unwrapModelGroup((XSModelGroup)term);
+ }
+ else if (term instanceof XSElementDeclaration)
+ {
+ unwrappedElement = (XSElementDeclaration)term;
+ this.array = array;
+ }
+
+ }
+
+ return unwrappedElement != null;
+ }
+
+ private boolean unwrapAttributeUses(XSObjectList attributeUses)
+ {
+ if (attributeUses.getLength() == 1)
+ {
+ XSObject object = attributeUses.item(0);
+ if (object instanceof XSAttributeUse)
+ {
+ XSAttributeUse attributeUse = (XSAttributeUse)object;
+ unwrappedAttribute = attributeUse.getAttrDeclaration();
+ }
+ }
+
+ return unwrappedAttribute != null;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -308,7 +308,7 @@
//Generate the Mapping File
if (w2jc.mappingFileNeeded)
{
- MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
+ MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
mgf.setPackageName(getPackageName(wsdl, glc));
mgf.setServiceName(wsdl.getServices()[0].getName().toString());
mgf.setParameterStyle(w2jc.parameterStyle);
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -84,11 +84,6 @@
protected Class serviceEndpointInterface = null;
/**
- * Server side generation - user can provide a type Namespace
- */
- protected String typeNamespace;
-
- /**
* Type Mapping that is input from outside
*/
protected LiteralTypeMapping typeMapping = null;
@@ -145,17 +140,6 @@
this.serviceName = serviceName;
}
- /**
- * The user may have generated the types in a different namespace
- * aka typeNamespace in comparison to the wsdl targetNamespace
- *
- * @param typeNamespace
- */
- public void setTypeNamespace(String typeNamespace)
- {
- this.typeNamespace = typeNamespace;
- }
-
public void setParameterStyle(String paramStyle)
{
this.parameterStyle = paramStyle;
@@ -173,16 +157,8 @@
public JavaWsdlMapping generate() throws IOException
{
MappingFileGeneratorHelper helper = new MappingFileGeneratorHelper(this.wsdlDefinitions, this.serviceName, this.packageName, this.serviceEndpointInterface,
- this.typeNamespace, this.typeMapping, this.parameterStyle);
- String targetNS = wsdlDefinitions.getTargetNamespace();
- if (typeNamespace == null)
- typeNamespace = targetNS;
+ this.typeMapping, this.parameterStyle);
JavaWsdlMapping jwm = new JavaWsdlMapping();
- //Construct package mapping
- //Check if the user has provided a typeNamespace
- if (typeNamespace != null && typeNamespace.equals(targetNS) == false || isServerSideGeneration())
- jwm.addPackageMapping(helper.constructPackageMapping(jwm, packageName, typeNamespace));
- jwm.addPackageMapping(helper.constructPackageMapping(jwm, packageName, targetNS));
//If the schema has types, we will need to generate the java/xml type mapping
helper.constructJavaXmlTypeMapping(jwm);
@@ -196,6 +172,19 @@
jwm.addServiceInterfaceMappings(helper.constructServiceInterfaceMapping(jwm, wsdlService));
helper.constructServiceEndpointInterfaceMapping(jwm, wsdlService);
}
+
+ // Add package to namespace mapping after helper has generated the rest of the file.
+ String targetNS = wsdlDefinitions.getTargetNamespace();
+ String typeNamespace = helper.getTypeNamespace();
+ if (typeNamespace == null)
+ typeNamespace = targetNS;
+
+ //Construct package mapping
+ //Check if the user has provided a typeNamespace
+ if (typeNamespace != null && typeNamespace.equals(targetNS) == false || isServerSideGeneration())
+ jwm.addPackageMapping(helper.constructPackageMapping(jwm, packageName, typeNamespace));
+ jwm.addPackageMapping(helper.constructPackageMapping(jwm, packageName, targetNS));
+
return jwm;
}
@@ -219,7 +208,7 @@
MethodParamPartsMapping[] mppmarr = mm.getMethodParamPartsMappings();
int lenmppmarr = mppmarr != null ? mppmarr.length : 0;
for (int j = 0; j < lenmppmarr; j++)
- {
+ {
listInputs.addAll(xst.getVARList((XSComplexTypeDefinition)xsmodel.getTypeDefinition(opname, typeNamespace), xsmodel, false));
}
JavaWriter jw = new JavaWriter();
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -192,21 +192,21 @@
return typeMapping;
}
- protected void generateMappingFile(String packageName, WSDLDefinitions wsdl, TypeMapping typeMapping, String serviceName, String fileLoc, Class seiClass,
- String typeNamespace) throws IOException
- {
- MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
- mgf.setPackageName(packageName);
- mgf.setServiceName(serviceName);
- if (seiClass != null)
- mgf.setServiceEndpointInterface(seiClass);
- if (typeNamespace != null && typeNamespace.length() > 0)
- mgf.setTypeNamespace(typeNamespace);
- JavaWsdlMapping jwm = mgf.generate();
- FileWriter fw = new FileWriter(fileLoc);
- fw.write(DOMWriter.printNode(DOMUtils.parse(jwm.serialize()), true));
- fw.close();
- }
+ // protected void generateMappingFile(String packageName, WSDLDefinitions wsdl, TypeMapping typeMapping, String serviceName, String fileLoc, Class seiClass,
+ // String typeNamespace) throws IOException
+ // {
+ // MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
+ // mgf.setPackageName(packageName);
+ // mgf.setServiceName(serviceName);
+ // if (seiClass != null)
+ // mgf.setServiceEndpointInterface(seiClass);
+ // if (typeNamespace != null && typeNamespace.length() > 0)
+ // mgf.setTypeNamespace(typeNamespace);
+ // JavaWsdlMapping jwm = mgf.generate();
+ // FileWriter fw = new FileWriter(fileLoc);
+ // fw.write(DOMWriter.printNode(DOMUtils.parse(jwm.serialize()), true));
+ // fw.close();
+ // }
protected void generateServiceFile(String packageName, WSDLDefinitions wsdl, String location) throws IOException
{
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -27,6 +27,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
import org.jboss.ws.tools.WSTools;
/**
@@ -47,26 +48,26 @@
tests.add('B');
tests.add('C');
tests.add('D');
- tests.add('E');
- tests.add('F');
- tests.add('G');
- tests.add('H');
- tests.add('I');
- tests.add('J');
- tests.add('K');
- tests.add('L');
- tests.add('M');
- tests.add('N');
- tests.add('O');
- tests.add('P');
- tests.add('Q');
- tests.add('R');
- tests.add('S');
- tests.add('T');
- tests.add('U');
- tests.add('V');
- tests.add('W');
- tests.add('X');
+ //tests.add('E');
+ // tests.add('F');
+ // tests.add('G');
+ // tests.add('H');
+ // tests.add('I');
+ // tests.add('J');
+ // tests.add('K');
+ // tests.add('L');
+ // tests.add('M');
+ // tests.add('N');
+ // tests.add('O');
+ // tests.add('P');
+ // tests.add('Q');
+ // tests.add('R');
+ // tests.add('S');
+ // tests.add('T');
+ // tests.add('U');
+ // tests.add('V');
+ // tests.add('W');
+ // tests.add('X');
}
/**
@@ -587,6 +588,9 @@
new WSTools().generate(args);
compareSource(resourceDir + "/PhoneBook_PortType.java", toolsDir + "/org/jboss/test/ws/jbws1260/PhoneBook_PortType.java");
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/wrapped-mapping.xml", toolsDir + "/wrapped-mapping.xml");
}
private static void compareSource(final String expectedName, final String generatedName) throws Exception
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,27 +1,28 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.validation;
import java.io.File;
+import java.util.HashMap;
import javax.xml.namespace.QName;
@@ -48,419 +49,423 @@
public class JaxrpcMappingValidator
{
public static Logger log = Logger.getLogger(JaxrpcMappingValidator.class);
- /**
- * Validates two jaxrpc mapping files given their location as strings
- *
- * @param mappingFile1 location of the first mapping file
- * @param mappingFile2 location of the second mapping file
- * @return true - both are equal, false - Do not match
- * @throws Exception
- */
- public boolean validate(String mappingFile1, String mappingFile2) throws Exception
- {
- JavaWsdlMappingFactory mappingFactory = JavaWsdlMappingFactory.newInstance();
- JavaWsdlMapping javaWsdlMapping1 = mappingFactory.parse(new File(mappingFile1).toURL());
- JavaWsdlMapping javaWsdlMapping2 = mappingFactory.parse(new File(mappingFile2).toURL());
- return validate(javaWsdlMapping1,javaWsdlMapping2);
- }
-
- /**
- * Validates two mapping metadata models
- *
- * @param jw1 metadata model for the first mapping file
- * @param jw2 metadata model for the second mapping file
- * @return
- */
- public boolean validate(JavaWsdlMapping jw1, JavaWsdlMapping jw2)
- {
- boolean bool = true;
- bool = validatePackageMappings(jw1.getPackageMappings(),jw2.getPackageMappings());
- if(bool)
- bool = validateJavaXmlTypeMappings(jw1.getJavaXmlTypeMappings(),
- jw2.getJavaXmlTypeMappings());
- else
- throw new IllegalStateException("Validation of PackageMappings failed");
- if(bool)
- bool = validateServiceInterfaceMappings(jw1.getServiceInterfaceMappings(),
- jw2.getServiceInterfaceMappings());
- else
- throw new IllegalStateException("Validation of JavaXmlTypeMappings failed");
- if(bool)
- bool = validateServiceEndpointInterfaceMappings(jw1.getServiceEndpointInterfaceMappings(),
- jw2.getServiceEndpointInterfaceMappings());
- else
- throw new IllegalStateException("Validation of ServiceInterfaceMappings failed");
-
- if(bool == false)
- throw new IllegalStateException("Validation of ServiceEndpointInterfaceMappings failed");
- return bool;
- }
-
- //PRIVATE METHODS
- private boolean validatePackageMappings(PackageMapping[] pm1, PackageMapping[] pm2)
- {
- boolean bool = true;
- int len1 = pm1 != null ? pm1.length : 0;
- int len2 = pm2 != null ? pm2.length : 0;
- if(len1 != len2) return false;
- for(int i =0; i < len1; i++)
- {
- bool = validatePackageMapping( pm1[i], pm2[i]);
- if( bool == false) break;
- }
- return bool;
- }
-
- private boolean validatePackageMapping(PackageMapping pm1, PackageMapping pm2)
- {
- boolean bool = true;
- bool = checkStringEquality(pm1.getPackageType(),pm2.getPackageType());
- if(bool)
- bool = checkStringEquality(pm1.getNamespaceURI(),pm2.getNamespaceURI());
- else
- throw new IllegalStateException("Validation of PackageMapping/PackageType failed");
-
- if(bool == false)
- throw new IllegalStateException("Validation of PackageMapping/NamespaceURI failed");
- return bool;
- }
-
- private boolean validateJavaXmlTypeMappings(JavaXmlTypeMapping[] jm1,
- JavaXmlTypeMapping[] jm2)
- {
- boolean bool = true;
- int len1 = jm1 != null ? jm1.length : 0;
- int len2 = jm2 != null ? jm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of JavaXmlTypeMapping[] do not match");
- }
+ /**
+ * Validates two jaxrpc mapping files given their location as strings
+ *
+ * @param mappingFile1 location of the first mapping file
+ * @param mappingFile2 location of the second mapping file
+ * @return true - both are equal, false - Do not match
+ * @throws Exception
+ */
+ public boolean validate(String mappingFile1, String mappingFile2) throws Exception
+ {
+ JavaWsdlMappingFactory mappingFactory = JavaWsdlMappingFactory.newInstance();
+ JavaWsdlMapping javaWsdlMapping1 = mappingFactory.parse(new File(mappingFile1).toURL());
+ JavaWsdlMapping javaWsdlMapping2 = mappingFactory.parse(new File(mappingFile2).toURL());
+ return validate(javaWsdlMapping1, javaWsdlMapping2);
+ }
- for(int i =0; i < len1; i++)
- {
- //Now go over the other array to see possible match
- for(int j = 0; j < len1; j++)
- {
- bool = validateJavaXmlTypeMapping( jm1[i], jm2[j]);
- if(bool)
- break;
- }
- //bool = validateJavaXmlTypeMapping( jm1[i], jm2[i]);
- if( bool == false)
- {
- throw new IllegalStateException(jm1[i] + " does not match with other side");
- }
- }
- return bool;
- }
-
- private boolean validateJavaXmlTypeMapping(JavaXmlTypeMapping jm1,
- JavaXmlTypeMapping jm2)
- {
- boolean bool = true;
- bool = checkStringEquality(jm1.getJavaType(),jm2.getJavaType());
- if(bool)
- bool = checkStringEquality(jm1.getQnameScope(),jm2.getQnameScope());
- if(bool)
- bool = checkQNameEquality(jm1.getRootTypeQName(),jm2.getRootTypeQName());
- if(bool)
- bool = checkQNameEquality(jm1.getAnonymousTypeQName(),jm2.getAnonymousTypeQName());
- if(bool)
- bool = validateVariableMappings(jm1.getVariableMappings(),jm2.getVariableMappings());
-
- return bool;
- }
-
- private boolean validateVariableMappings(VariableMapping[] vm1, VariableMapping[] vm2)
- {
- boolean bool = true;
- int len1 = vm1 != null ? vm1.length : 0;
- int len2 = vm2 != null ? vm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of VariableMapping[] do not match");
- }
+ /**
+ * Validates two mapping metadata models
+ *
+ * @param jw1 metadata model for the first mapping file
+ * @param jw2 metadata model for the second mapping file
+ * @return
+ */
+ public boolean validate(JavaWsdlMapping jw1, JavaWsdlMapping jw2)
+ {
+ boolean bool = true;
+ bool = validatePackageMappings(jw1.getPackageMappings(), jw2.getPackageMappings());
+ if (bool)
+ bool = validateJavaXmlTypeMappings(jw1.getJavaXmlTypeMappings(), jw2.getJavaXmlTypeMappings());
+ else throw new IllegalStateException("Validation of PackageMappings failed");
+ if (bool)
+ bool = validateServiceInterfaceMappings(jw1.getServiceInterfaceMappings(), jw2.getServiceInterfaceMappings());
+ else throw new IllegalStateException("Validation of JavaXmlTypeMappings failed");
- for(int i =0; i < len1; i++)
- {
- bool = validateVariableMapping( vm1[i], vm2[i]);
- if( bool == false)
- throw new IllegalStateException("VariableMapping" + vm1[i] + " does not match with "+vm2[i]);
-
- }
- return bool;
- }
-
- private boolean validateVariableMapping(VariableMapping vm1, VariableMapping vm2)
- {
- boolean bool = true;
- bool = checkStringEquality(vm1.getJavaVariableName(),vm2.getJavaVariableName());
- if(bool)
- bool = checkStringEquality(vm1.getXmlAttributeName(),vm2.getXmlAttributeName());
- if(bool)
- bool = checkStringEquality(vm1.getXmlElementName(),vm2.getXmlElementName());
- if(bool)
- bool = vm1.getXmlWildcard() == vm2.getXmlWildcard();
- if(bool)
- bool = vm1.isDataMember() == vm2.isDataMember();
- return bool;
- }
-
- private boolean validateServiceInterfaceMappings(ServiceInterfaceMapping[] sim1,
- ServiceInterfaceMapping[] sim2)
- {
- boolean bool = true;
- int len1 = sim1 != null ? sim1.length : 0;
- int len2 = sim2 != null ? sim2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of ServiceInterfaceMapping[] do not match");
- }
+ if (bool)
+ bool = validateServiceEndpointInterfaceMappings(jw1.getServiceEndpointInterfaceMappings(), jw2.getServiceEndpointInterfaceMappings());
+ else throw new IllegalStateException("Validation of ServiceInterfaceMappings failed");
- for(int i =0; i < len1; i++)
- {
- bool = validateServiceInterfaceMapping( sim1[i], sim2[i]);
- if( bool == false) break;
- }
- return bool;
- }
-
- private boolean validateServiceInterfaceMapping(ServiceInterfaceMapping sim1,
- ServiceInterfaceMapping sim2)
- {
- boolean bool = true;
- bool = checkStringEquality(sim1.getServiceInterface(),sim2.getServiceInterface());
- if(bool)
- bool = checkQNameEquality(sim1.getWsdlServiceName(),sim2.getWsdlServiceName());
- if(bool)
- bool = validatePortMappings(sim1.getPortMappings(),sim2.getPortMappings());
- return bool;
- }
-
- private boolean validatePortMappings(PortMapping[] pm1, PortMapping[] pm2 )
- {
- boolean bool = true;
+ if (bool == false)
+ throw new IllegalStateException("Validation of ServiceEndpointInterfaceMappings failed");
+ return bool;
+ }
- int len1 = pm1 != null ? pm1.length : 0;
- int len2 = pm2 != null ? pm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of PortMapping[] do not match");
- }
+ //PRIVATE METHODS
+ private boolean validatePackageMappings(PackageMapping[] pm1, PackageMapping[] pm2)
+ {
+ boolean bool = true;
+ int len1 = pm1 != null ? pm1.length : 0;
+ int len2 = pm2 != null ? pm2.length : 0;
+ if (len1 != len2)
+ throw new IllegalStateException("Number of package mappings does not match expected=" + len1 + " actual=" + len2);
- for(int i =0; i < len1; i++)
- {
- bool = validatePortMapping( pm1[i], pm2[i]);
- if( bool == false) break;
- }
- return bool;
- }
-
- private boolean validatePortMapping( PortMapping pm1, PortMapping pm2)
- {
- boolean bool = true;
- bool = checkStringEquality(pm1.getPortName(),pm2.getJavaPortName());
- if(bool)
- bool = checkStringEquality(pm1.getJavaPortName(),pm2.getJavaPortName());
- return bool;
- }
-
- private boolean validateServiceEndpointInterfaceMappings(ServiceEndpointInterfaceMapping[] sm1,
- ServiceEndpointInterfaceMapping[] sm2)
- {
- boolean bool = true;
+ for (int i = 0; i < len1; i++)
+ {
+ bool = validatePackageMapping(pm1[i], pm2[i]);
+ if (bool == false)
+ break;
+ }
+ return bool;
+ }
- int len1 = sm1 != null ? sm1.length : 0;
- int len2 = sm2 != null ? sm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of ServiceEndpointInterfaceMapping[] do not match");
- }
+ private boolean validatePackageMapping(PackageMapping pm1, PackageMapping pm2)
+ {
+ String expectedPackage = pm1.getPackageType();
+ String actualPackage = pm2.getPackageType();
- for(int i =0; i < len1; i++)
- {
- for(int j = 0 ; j < len1; j++)
- {
- bool = validateServiceEndpointInterfaceMapping( sm1[i], sm2[j]);
- if (bool)
- break;
- }
- if( bool == false)
- throw new IllegalStateException(sm1[i].getServiceEndpointInterface() + " has no match");
- }
- return bool;
- }
-
- private boolean validateServiceEndpointInterfaceMapping(ServiceEndpointInterfaceMapping sm1,
- ServiceEndpointInterfaceMapping sm2)
- {
- boolean bool = true;
- bool = checkStringEquality(sm1.getServiceEndpointInterface(),sm2.getServiceEndpointInterface());
- if(bool)
- bool = checkQNameEquality(sm1.getWsdlBinding(),sm2.getWsdlBinding());
- if(bool)
- bool = checkQNameEquality(sm1.getWsdlPortType(),sm2.getWsdlPortType());
- if(bool)
- bool = validateServiceEndpointMethodMappings(sm1.getServiceEndpointMethodMappings(),
- sm2.getServiceEndpointMethodMappings());
- return bool;
- }
-
- private boolean validateServiceEndpointMethodMappings(ServiceEndpointMethodMapping[] semm1,
- ServiceEndpointMethodMapping[] semm2)
- {
- boolean bool = true;
+ if (checkStringEquality(expectedPackage, actualPackage) == false)
+ {
+ throw new IllegalStateException("Package type '" + expectedPackage + "' does not equal '" + actualPackage + "'");
+ }
- int len1 = semm1 != null ? semm1.length : 0;
- int len2 = semm2 != null ? semm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of ServiceEndpointMethodMapping[] do not match");
- }
+ String expectedNamespace = pm1.getNamespaceURI();
+ String actualNamespace = pm2.getNamespaceURI();
- for(int i =0; i < len1; i++)
- {
- for(int j = 0 ; j < len1; j++)
- {
- bool = validateServiceEndpointMethodMapping( semm1[i], semm2[j]);
- if(bool)
- break;
- }
- if( bool == false)
- throw new IllegalStateException(semm1[i].getJavaMethodName() + " do not match in"
- + " in ServiceEndpointMethod Mapping");
-
- }
- return bool;
- }
-
- private boolean validateServiceEndpointMethodMapping(ServiceEndpointMethodMapping semm1,
- ServiceEndpointMethodMapping semm2)
- {
- boolean bool = true;
- bool = checkStringEquality(semm1.getJavaMethodName(),semm2.getJavaMethodName());
- if(bool)
- bool = checkStringEquality(semm1.getWsdlOperation(),semm2.getWsdlOperation());
- else
- log.error("getJavaMethodName check failed");
- if(bool)
- bool = semm1.isWrappedElement() == semm2.isWrappedElement();
- else
- log.error("wsdloperation check failed");
- if(bool)
- bool = validateWsdlReturnValueMapping(semm1.getWsdlReturnValueMapping(),
- semm2.getWsdlReturnValueMapping());
- else
- log.error("isWrappedElement check failed");
- if(bool)
- bool = validateMethodParamPartsMappings(semm1.getMethodParamPartsMappings(),
- semm2.getMethodParamPartsMappings());
- else
- log.error("validateWsdlReturnValueMapping check failed");
-
- if(bool == false)
- log.error("validateMethodParamPartsMappings check failed");
- return bool;
- }
-
- private boolean validateWsdlReturnValueMapping(WsdlReturnValueMapping w1, WsdlReturnValueMapping w2)
- {
- checkNullParametersInconsistency(w1,w2,WsdlReturnValueMapping.class);
- boolean bool = true;
- if(w1 != null && w2 != null)
- {
- bool = checkStringEquality(w1.getMethodReturnValue(),w2.getMethodReturnValue());
- if(bool)
- bool = checkStringEquality(w1.getWsdlMessagePartName(),w2.getWsdlMessagePartName());
- if(bool)
- bool = checkQNameEquality(w1.getWsdlMessage(),w2.getWsdlMessage());
- }
-
- return bool;
- }
-
- private boolean validateMethodParamPartsMappings(MethodParamPartsMapping[] mppm1,
- MethodParamPartsMapping[] mppm2)
- {
- boolean bool = true;
+ if (checkStringEquality(expectedPackage, actualPackage) == false)
+ {
+ throw new IllegalStateException("Namespace '" + expectedNamespace + "' does not equal '" + actualNamespace + "'");
+ }
- int len1 = mppm1 != null ? mppm1.length : 0;
- int len2 = mppm2 != null ? mppm2.length : 0;
- if(len1 != len2)
- {
- throw new IllegalStateException("Length of MethodParamPartsMapping[] do not match");
- }
+ return true;
+ }
- for(int i =0; i < len1; i++)
- {
- bool = validateMethodParamPartsMapping( mppm1[i], mppm2[i]);
- if( bool == false) break;
- }
- return bool;
- }
-
- private boolean validateMethodParamPartsMapping(MethodParamPartsMapping mppm1,
- MethodParamPartsMapping mppm2)
- {
- boolean bool = true;
- bool = mppm1.getParamPosition() == mppm2.getParamPosition();
- if(bool)
- bool = checkStringEquality(mppm1.getParamType(), mppm2.getParamType());
- if(bool)
- bool = validateWsdlMessageMapping(mppm1.getWsdlMessageMapping(),mppm2.getWsdlMessageMapping());
- return bool;
- }
-
- private boolean validateWsdlMessageMapping(WsdlMessageMapping wmm1,WsdlMessageMapping wmm2)
- {
- String semmName = wmm1.getMethodParamPartsMapping().getServiceEndpointMethodMapping().getJavaMethodName();
-
- String path = "ServiceEndpointMethodMapping-"+semmName + "/methodparampartsmapping";
- boolean bool = true;
- if(bool)
- bool = checkStringEquality(wmm1.getParameterMode(),wmm2.getParameterMode());
- if(bool)
- bool = checkStringEquality(wmm1.getWsdlMessagePartName(),wmm2.getWsdlMessagePartName());
- else
- throw new IllegalStateException(path + "/parameterMode does not match");
- if(bool)
- bool = checkQNameEquality(wmm1.getWsdlMessage(),wmm2.getWsdlMessage());
- if(bool)
- bool = wmm1.isSoapHeader() == wmm2.isSoapHeader();
- else
- throw new IllegalStateException(path + "/wsdlMessage does not match");
- return bool;
- }
-
- //PRIVATE EQUALITY CHECKS
-
- private boolean checkStringEquality(String str1, String str2)
- {
- if(str1 == null && str2 == null)
- return true;
- if(str1 == null && str2 != null)
- return false;
- if(str1 != null && str2 == null)
- return false;
- return str1.equals(str2);
- }
-
- private boolean checkQNameEquality(QName q1, QName q2)
- {
- if(q1 == null && q2 == null)
- return true;
- if(q1 == null && q2 != null)
- return false;
- if(q1 != null && q2 == null)
- return false;
- return q1.equals(q2);
- }
-
- private void checkNullParametersInconsistency(Object o1, Object o2, Class c)
- {
- WSDLUtils utils = WSDLUtils.getInstance();
- if((o1 == null && o2 != null) || (o1 != null && o2 == null) )
- throw new IllegalStateException(utils.getJustClassName(c) + " does not match");
- }
+ private boolean validateJavaXmlTypeMappings(JavaXmlTypeMapping[] jm1, JavaXmlTypeMapping[] jm2)
+ {
+ boolean bool = true;
+ int len1 = jm1 != null ? jm1.length : 0;
+ int len2 = jm2 != null ? jm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of JavaXmlTypeMapping[] do not match");
+ }
+
+ // Don't need the order to be the same so cope with this.
+ HashMap actualMappings = new HashMap(len1);
+
+ for (int i = 0; i < len1; i++)
+ {
+ JavaXmlTypeMapping current = jm2[i];
+ String name = current.getJavaType();
+ if (actualMappings.containsKey(name))
+ {
+ throw new IllegalStateException("Type '" + name + "' registered more than once.");
+ }
+
+ actualMappings.put(name, current);
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ JavaXmlTypeMapping expected = jm1[i];
+ JavaXmlTypeMapping actual = (JavaXmlTypeMapping)actualMappings.get(expected.getJavaType());
+
+ if (actual == null)
+ {
+ throw new IllegalStateException("Mapping not found for '" + expected.getJavaType() + "'");
+ }
+
+ if (validateJavaXmlTypeMapping(expected, actual) == false)
+ {
+ throw new IllegalStateException(expected + " does not match with other side " + actual);
+ }
+ }
+
+ return true;
+ }
+
+ private boolean validateJavaXmlTypeMapping(JavaXmlTypeMapping jm1, JavaXmlTypeMapping jm2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(jm1.getJavaType(), jm2.getJavaType());
+ if (bool)
+ bool = checkStringEquality(jm1.getQnameScope(), jm2.getQnameScope());
+ if (bool)
+ bool = checkQNameEquality(jm1.getRootTypeQName(), jm2.getRootTypeQName());
+ if (bool)
+ bool = checkQNameEquality(jm1.getAnonymousTypeQName(), jm2.getAnonymousTypeQName());
+ if (bool)
+ bool = validateVariableMappings(jm1.getVariableMappings(), jm2.getVariableMappings());
+
+ return bool;
+ }
+
+ private boolean validateVariableMappings(VariableMapping[] vm1, VariableMapping[] vm2)
+ {
+ boolean bool = true;
+ int len1 = vm1 != null ? vm1.length : 0;
+ int len2 = vm2 != null ? vm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of VariableMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ bool = validateVariableMapping(vm1[i], vm2[i]);
+ if (bool == false)
+ throw new IllegalStateException("VariableMapping" + vm1[i] + " does not match with " + vm2[i]);
+
+ }
+ return bool;
+ }
+
+ private boolean validateVariableMapping(VariableMapping vm1, VariableMapping vm2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(vm1.getJavaVariableName(), vm2.getJavaVariableName());
+ if (bool)
+ bool = checkStringEquality(vm1.getXmlAttributeName(), vm2.getXmlAttributeName());
+ if (bool)
+ bool = checkStringEquality(vm1.getXmlElementName(), vm2.getXmlElementName());
+ if (bool)
+ bool = vm1.getXmlWildcard() == vm2.getXmlWildcard();
+ if (bool)
+ bool = vm1.isDataMember() == vm2.isDataMember();
+ return bool;
+ }
+
+ private boolean validateServiceInterfaceMappings(ServiceInterfaceMapping[] sim1, ServiceInterfaceMapping[] sim2)
+ {
+ boolean bool = true;
+ int len1 = sim1 != null ? sim1.length : 0;
+ int len2 = sim2 != null ? sim2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of ServiceInterfaceMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ bool = validateServiceInterfaceMapping(sim1[i], sim2[i]);
+ if (bool == false)
+ break;
+ }
+ return bool;
+ }
+
+ private boolean validateServiceInterfaceMapping(ServiceInterfaceMapping sim1, ServiceInterfaceMapping sim2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(sim1.getServiceInterface(), sim2.getServiceInterface());
+ if (bool)
+ bool = checkQNameEquality(sim1.getWsdlServiceName(), sim2.getWsdlServiceName());
+ if (bool)
+ bool = validatePortMappings(sim1.getPortMappings(), sim2.getPortMappings());
+ return bool;
+ }
+
+ private boolean validatePortMappings(PortMapping[] pm1, PortMapping[] pm2)
+ {
+ boolean bool = true;
+
+ int len1 = pm1 != null ? pm1.length : 0;
+ int len2 = pm2 != null ? pm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of PortMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ bool = validatePortMapping(pm1[i], pm2[i]);
+ if (bool == false)
+ break;
+ }
+ return bool;
+ }
+
+ private boolean validatePortMapping(PortMapping pm1, PortMapping pm2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(pm1.getPortName(), pm2.getJavaPortName());
+ if (bool)
+ bool = checkStringEquality(pm1.getJavaPortName(), pm2.getJavaPortName());
+ return bool;
+ }
+
+ private boolean validateServiceEndpointInterfaceMappings(ServiceEndpointInterfaceMapping[] sm1, ServiceEndpointInterfaceMapping[] sm2)
+ {
+ boolean bool = true;
+
+ int len1 = sm1 != null ? sm1.length : 0;
+ int len2 = sm2 != null ? sm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of ServiceEndpointInterfaceMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ for (int j = 0; j < len1; j++)
+ {
+ bool = validateServiceEndpointInterfaceMapping(sm1[i], sm2[j]);
+ if (bool)
+ break;
+ }
+ if (bool == false)
+ throw new IllegalStateException(sm1[i].getServiceEndpointInterface() + " has no match");
+ }
+ return bool;
+ }
+
+ private boolean validateServiceEndpointInterfaceMapping(ServiceEndpointInterfaceMapping sm1, ServiceEndpointInterfaceMapping sm2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(sm1.getServiceEndpointInterface(), sm2.getServiceEndpointInterface());
+ if (bool)
+ bool = checkQNameEquality(sm1.getWsdlBinding(), sm2.getWsdlBinding());
+ if (bool)
+ bool = checkQNameEquality(sm1.getWsdlPortType(), sm2.getWsdlPortType());
+ if (bool)
+ bool = validateServiceEndpointMethodMappings(sm1.getServiceEndpointMethodMappings(), sm2.getServiceEndpointMethodMappings());
+ return bool;
+ }
+
+ private boolean validateServiceEndpointMethodMappings(ServiceEndpointMethodMapping[] semm1, ServiceEndpointMethodMapping[] semm2)
+ {
+ boolean bool = true;
+
+ int len1 = semm1 != null ? semm1.length : 0;
+ int len2 = semm2 != null ? semm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of ServiceEndpointMethodMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ for (int j = 0; j < len1; j++)
+ {
+ bool = validateServiceEndpointMethodMapping(semm1[i], semm2[j]);
+ if (bool)
+ break;
+ }
+ if (bool == false)
+ throw new IllegalStateException(semm1[i].getJavaMethodName() + " do not match in" + " in ServiceEndpointMethod Mapping");
+
+ }
+ return bool;
+ }
+
+ private boolean validateServiceEndpointMethodMapping(ServiceEndpointMethodMapping semm1, ServiceEndpointMethodMapping semm2)
+ {
+ boolean bool = true;
+ bool = checkStringEquality(semm1.getJavaMethodName(), semm2.getJavaMethodName());
+ if (bool)
+ bool = checkStringEquality(semm1.getWsdlOperation(), semm2.getWsdlOperation());
+ else log.error("getJavaMethodName check failed");
+ if (bool)
+ bool = semm1.isWrappedElement() == semm2.isWrappedElement();
+ else log.error("wsdloperation check failed");
+ if (bool)
+ bool = validateWsdlReturnValueMapping(semm1.getWsdlReturnValueMapping(), semm2.getWsdlReturnValueMapping());
+ else log.error("isWrappedElement check failed");
+ if (bool)
+ bool = validateMethodParamPartsMappings(semm1.getMethodParamPartsMappings(), semm2.getMethodParamPartsMappings());
+ else log.error("validateWsdlReturnValueMapping check failed");
+
+ if (bool == false)
+ log.error("validateMethodParamPartsMappings check failed");
+ return bool;
+ }
+
+ private boolean validateWsdlReturnValueMapping(WsdlReturnValueMapping w1, WsdlReturnValueMapping w2)
+ {
+ checkNullParametersInconsistency(w1, w2, WsdlReturnValueMapping.class);
+ boolean bool = true;
+ if (w1 != null && w2 != null)
+ {
+ bool = checkStringEquality(w1.getMethodReturnValue(), w2.getMethodReturnValue());
+ if (bool)
+ bool = checkStringEquality(w1.getWsdlMessagePartName(), w2.getWsdlMessagePartName());
+ if (bool)
+ bool = checkQNameEquality(w1.getWsdlMessage(), w2.getWsdlMessage());
+ }
+
+ return bool;
+ }
+
+ private boolean validateMethodParamPartsMappings(MethodParamPartsMapping[] mppm1, MethodParamPartsMapping[] mppm2)
+ {
+ boolean bool = true;
+
+ int len1 = mppm1 != null ? mppm1.length : 0;
+ int len2 = mppm2 != null ? mppm2.length : 0;
+ if (len1 != len2)
+ {
+ throw new IllegalStateException("Length of MethodParamPartsMapping[] do not match");
+ }
+
+ for (int i = 0; i < len1; i++)
+ {
+ bool = validateMethodParamPartsMapping(mppm1[i], mppm2[i]);
+ if (bool == false)
+ break;
+ }
+ return bool;
+ }
+
+ private boolean validateMethodParamPartsMapping(MethodParamPartsMapping mppm1, MethodParamPartsMapping mppm2)
+ {
+ boolean bool = true;
+ bool = mppm1.getParamPosition() == mppm2.getParamPosition();
+ if (bool)
+ bool = checkStringEquality(mppm1.getParamType(), mppm2.getParamType());
+ if (bool)
+ bool = validateWsdlMessageMapping(mppm1.getWsdlMessageMapping(), mppm2.getWsdlMessageMapping());
+ return bool;
+ }
+
+ private boolean validateWsdlMessageMapping(WsdlMessageMapping wmm1, WsdlMessageMapping wmm2)
+ {
+ String semmName = wmm1.getMethodParamPartsMapping().getServiceEndpointMethodMapping().getJavaMethodName();
+
+ String path = "ServiceEndpointMethodMapping-" + semmName + "/methodparampartsmapping";
+ boolean bool = true;
+ if (bool)
+ bool = checkStringEquality(wmm1.getParameterMode(), wmm2.getParameterMode());
+ if (bool)
+ bool = checkStringEquality(wmm1.getWsdlMessagePartName(), wmm2.getWsdlMessagePartName());
+ else throw new IllegalStateException(path + "/parameterMode does not match");
+ if (bool)
+ bool = checkQNameEquality(wmm1.getWsdlMessage(), wmm2.getWsdlMessage());
+ if (bool)
+ bool = wmm1.isSoapHeader() == wmm2.isSoapHeader();
+ else throw new IllegalStateException(path + "/wsdlMessage does not match");
+ return bool;
+ }
+
+ //PRIVATE EQUALITY CHECKS
+
+ private boolean checkStringEquality(String str1, String str2)
+ {
+ if (str1 == null && str2 == null)
+ return true;
+ if (str1 == null && str2 != null)
+ return false;
+ if (str1 != null && str2 == null)
+ return false;
+ return str1.equals(str2);
+ }
+
+ private boolean checkQNameEquality(QName q1, QName q2)
+ {
+ if (q1 == null && q2 == null)
+ return true;
+ if (q1 == null && q2 != null)
+ return false;
+ if (q1 != null && q2 == null)
+ return false;
+ return q1.equals(q2);
+ }
+
+ private void checkNullParametersInconsistency(Object o1, Object o2, Class c)
+ {
+ WSDLUtils utils = WSDLUtils.getInstance();
+ if ((o1 == null && o2 != null) || (o1 != null && o2 == null))
+ throw new IllegalStateException(utils.getJustClassName(c) + " does not match");
+ }
}
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wrapped-mapping.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wrapped-mapping.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.LookupResponse</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookupResponse</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Lookup</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookup</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>surname</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>number</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wstools-config.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_A/wstools-config.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,5 +1,5 @@
<configuration>
<wsdl-java location="resources/tools/jbws1260/scenario_A/Wrapped.wsdl" parameter-style="wrapped">
- <!--mapping file="wrapped-mapping.xml"/-->
+ <mapping file="wrapped-mapping.xml"/>
</wsdl-java>
</configuration>
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wrapped-mapping.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wrapped-mapping.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.LookupResponse</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookupResponse</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>areaCode</java-variable-name>
+ <xml-element-name>areaCode</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Lookup</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookup</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>firstName</java-variable-name>
+ <xml-element-name>firstName</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>firstName</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <method-param-parts-mapping>
+ <param-position>1</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>surname</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws1260.LookupResponse</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wstools-config.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_B/wstools-config.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,5 +1,5 @@
<configuration>
<wsdl-java location="resources/tools/jbws1260/scenario_B/Wrapped.wsdl" parameter-style="wrapped">
- <!--mapping file="wrapped-mapping.xml"/-->
+ <mapping file="wrapped-mapping.xml"/>
</wsdl-java>
</configuration>
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wrapped-mapping.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wrapped-mapping.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.TelephoneNumber</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:TelephoneNumber</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Person</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:Person</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>surname</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>number</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wstools-config.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_C/wstools-config.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,5 +1,5 @@
<configuration>
<wsdl-java location="resources/tools/jbws1260/scenario_C/Wrapped.wsdl" parameter-style="wrapped">
- <!--mapping file="wrapped-mapping.xml"/-->
+ <mapping file="wrapped-mapping.xml"/>
</wsdl-java>
</configuration>
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wrapped-mapping.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wrapped-mapping.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.TelephoneNumber</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:TelephoneNumber</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>areaCode</java-variable-name>
+ <xml-element-name>areaCode</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Person</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:Person</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>firstName</java-variable-name>
+ <xml-element-name>firstName</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>firstName</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <method-param-parts-mapping>
+ <param-position>1</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>surname</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws1260.TelephoneNumber</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wstools-config.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_D/wstools-config.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,5 +1,5 @@
<configuration>
<wsdl-java location="resources/tools/jbws1260/scenario_D/Wrapped.wsdl" parameter-style="wrapped">
- <!--mapping file="wrapped-mapping.xml"/-->
+ <mapping file="wrapped-mapping.xml"/>
</wsdl-java>
</configuration>
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wrapped-mapping.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wrapped-mapping.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" 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.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.TelephoneNumber</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:TelephoneNumber</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>Number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.LookupName</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>Person>Name</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.LookupResponseNumber</java-type>
+ <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>TelephoneNumber>Number</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Person</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeNS:Person</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>name</java-variable-name>
+ <xml-element-name>Name</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws1260.LookupName</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>Name</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws1260.LookupResponseNumber</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>Number</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wstools-config.xml 2006-12-10 13:47:51 UTC (rev 1618)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_E/wstools-config.xml 2006-12-10 17:58:14 UTC (rev 1619)
@@ -1,5 +1,5 @@
<configuration>
<wsdl-java location="resources/tools/jbws1260/scenario_E/Wrapped.wsdl" parameter-style="wrapped">
- <!--mapping file="wrapped-mapping.xml"/-->
+ <mapping file="wrapped-mapping.xml"/>
</wsdl-java>
</configuration>
19 years, 5 months
JBossWS SVN: r1618 - in branches/dlofthouse/JBWS-1260/src: main/java/org/jboss/ws/tools test/java/org/jboss/test/ws/tools/jbws1260
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-10 08:47:51 -0500 (Sun, 10 Dec 2006)
New Revision: 1618
Modified:
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
Log:
JBWS-1260 - Source generation complete, all tests pass
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-08 16:01:30 UTC (rev 1617)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-10 13:47:51 UTC (rev 1618)
@@ -222,7 +222,8 @@
{
public XSTypeDefinition xt;
- public XSElementDeclaration unwrapped;
+ public XSAttributeDeclaration unwrappedAttribute;
+ public XSElementDeclaration unwrappedElement;
public String suffix = "";
public WrappedType(XSTypeDefinition xt)
@@ -240,9 +241,11 @@
XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
- if (wrapper.getAttributeUses().getLength() > 0)
- return false;
+ boolean unwrappedAttribute = false;
+ boolean unwrappedElement = false;
+ unwrappedAttribute = unwrapAttributeUses(wrapper.getAttributeUses());
+
XSParticle particle = wrapper.getParticle();
if (particle != null)
{
@@ -253,10 +256,11 @@
XSModelGroup group = (XSModelGroup)term;
- return unwrapModelGroup(group);
+ unwrappedElement = unwrapModelGroup(group);
}
- return false;
+ // We can only say we unwrapped if we only unwrapped one.
+ return unwrappedAttribute ^ unwrappedElement;
}
private boolean unwrapModelGroup(XSModelGroup group)
@@ -274,7 +278,7 @@
}
else if (term instanceof XSElementDeclaration)
{
- unwrapped = (XSElementDeclaration)term;
+ unwrappedElement = (XSElementDeclaration)term;
if (array)
{
suffix = "[]";
@@ -283,9 +287,24 @@
}
- return unwrapped != null;
+ return unwrappedElement != null;
}
+ private boolean unwrapAttributeUses(XSObjectList attributeUses)
+ {
+ if (attributeUses.getLength() == 1)
+ {
+ XSObject object = attributeUses.item(0);
+ if (object instanceof XSAttributeUse)
+ {
+ XSAttributeUse attributeUse = (XSAttributeUse)object;
+ unwrappedAttribute = attributeUse.getAttrDeclaration();
+ }
+ }
+
+ return unwrappedAttribute != null;
+ }
+
}
//***************************************************************************
@@ -463,30 +482,45 @@
StringBuilder tempBuf = new StringBuilder();
XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
- appendParameters(tempBuf, wrapper.getAttributeUses());
+ boolean appendedAttribute = appendParameters(tempBuf, wrapper.getAttributeUses());
+ boolean unwrappedElement = false;
XSParticle particle = wrapper.getParticle();
if (particle == null)
+ {
+ if (appendedAttribute)
+ {
+ buf.append(tempBuf);
+ }
+
return true;
+ }
+ else
+ {
+ XSTerm term = particle.getTerm();
+ if (term instanceof XSModelGroup)
+ {
+ unwrappedElement = unwrapGroup(tempBuf, containingElement, (XSModelGroup)term);
+ }
+ }
- XSTerm term = particle.getTerm();
- if (term instanceof XSModelGroup == false)
- return false;
+ if ((appendedAttribute && unwrappedElement) || unwrappedElement)
+ {
+ buf.append(tempBuf);
- if (unwrapGroup(tempBuf, containingElement, (XSModelGroup)term) == false)
- return false;
+ // We need a wrapper class generated
+ generateJavaSource(wrapper, WSDLUtils.getSchemaModel(wsdl.getWsdlTypes()), containingElement);
- buf.append(tempBuf);
+ return true;
+ }
- // We need a wrapper class generated
- generateJavaSource(wrapper, WSDLUtils.getSchemaModel(wsdl.getWsdlTypes()), containingElement);
-
- return true;
+ return false;
}
- private void appendParameters(StringBuilder buf, XSObjectList attributes) throws IOException
+ private boolean appendParameters(StringBuilder buf, XSObjectList attributes) throws IOException
{
JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
+ boolean appendedParameter = false;
for (int i = 0; i < attributes.getLength(); i++)
{
@@ -502,8 +536,12 @@
QName xmlType = new QName(type.getNamespace(), type.getName());
generateParameter(buf, null, "", xmlType, xsmodel, type, false, true);
buf.append(" ").append(getMethodParam(declaration.getName()));
+
+ appendedParameter = true;
}
}
+
+ return appendedParameter;
}
private void appendParameters(StringBuilder buf, WSDLInterfaceOperationInput in, String containingElement, QName xmlType, XSTypeDefinition xt) throws IOException
@@ -632,6 +670,7 @@
QName xmlType = out.getXMLType();
QName xmlName = out.getElement();
String containingElement = xmlName.getLocalPart();
+ String arraySuffix = "";
JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
@@ -639,15 +678,20 @@
WrappedType wt = new WrappedType(xt);
if (wt.unwrap())
{
- XSElementDeclaration element = wt.unwrapped;
-
- xt = element.getTypeDefinition();
- containingElement = containingElement + element.getName();
+ if (wt.unwrappedElement != null)
+ {
+ xt = wt.unwrappedElement.getTypeDefinition();
+ containingElement = containingElement + wt.unwrappedElement.getName();
+ arraySuffix = wt.suffix;
+ }
+ else if (wt.unwrappedAttribute != null)
+ {
+ xt = wt.unwrappedAttribute.getTypeDefinition();
+ }
}
boolean primitive = true;
WrappedArray wrappedArray = new WrappedArray(xt);
- String arraySuffix = wt.suffix;
if (wrappedArray.unwrap())
{
xt = wrappedArray.xt;
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-08 16:01:30 UTC (rev 1617)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-10 13:47:51 UTC (rev 1618)
@@ -549,7 +549,7 @@
{
generateScenario('W');
}
-
+
/**
* Test scenario where the element referenced as the message
* parts references a complex type which contains an anonymous
@@ -572,7 +572,7 @@
{
generateScenario('X');
}
-
+
protected void generateScenario(final char scenario) throws Exception
{
if (tests.contains(scenario) == false)
19 years, 5 months
JBossWS SVN: r1617 - trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-08 11:01:30 -0500 (Fri, 08 Dec 2006)
New Revision: 1617
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
Log:
Optimize imports
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -1,7 +1,6 @@
package org.jboss.test.ws.jaxws.xop.doclit;
import javax.ejb.Remote;
-import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.ws.BindingType;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -21,14 +21,13 @@
*/
package org.jboss.test.ws.jaxws.xop.doclit;
-import java.io.IOException;
+import org.jboss.ws.WSException;
import javax.activation.DataHandler;
import javax.ejb.Stateless;
import javax.jws.WebService;
+import java.io.IOException;
-import org.jboss.ws.WSException;
-
@Stateless
@WebService(name="MTOMEndpoint", serviceName = "MTOMService", endpointInterface = "org.jboss.test.ws.jaxws.xop.doclit.MTOMEndpoint")
public class MTOMEndpointBean implements MTOMEndpoint {
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -1,11 +1,11 @@
package org.jboss.test.ws.jaxws.xop.doclit;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.logging.Logger;
+import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
-import javax.xml.soap.SOAPMessage;
import java.io.ByteArrayOutputStream;
class MTOMProtocolHandler extends GenericSOAPHandler
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -6,10 +6,10 @@
import javax.activation.DataHandler;
import javax.xml.transform.Source;
import javax.xml.ws.soap.SOAPBinding;
-import java.net.URL;
+import java.awt.*;
import java.awt.image.BufferedImage;
-import java.awt.*;
import java.io.InputStream;
+import java.net.URL;
/**
* Created by IntelliJ IDEA.
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -21,9 +21,9 @@
*/
package org.jboss.test.ws.jaxws.xop.doclit;
+import junit.framework.Test;
+import org.jboss.logging.Logger;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.logging.Logger;
-import junit.framework.Test;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 16:00:45 UTC (rev 1616)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 16:01:30 UTC (rev 1617)
@@ -21,21 +21,13 @@
*/
package org.jboss.test.ws.jaxws.xop.doclit;
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTestSetup;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.transform.Source;
-import javax.activation.DataHandler;
import java.net.URL;
-import java.awt.image.BufferedImage;
-import java.awt.*;
-import java.util.Map;
-import java.io.InputStream;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
19 years, 5 months
JBossWS SVN: r1616 - trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-08 11:00:45 -0500 (Fri, 08 Dec 2006)
New Revision: 1616
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
Log:
Added JAX-WS MTOM handler test case
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java 2006-12-08 15:00:40 UTC (rev 1615)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMProtocolHandler.java 2006-12-08 16:00:45 UTC (rev 1616)
@@ -0,0 +1,36 @@
+package org.jboss.test.ws.jaxws.xop.doclit;
+
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.logging.Logger;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.soap.SOAPMessage;
+import java.io.ByteArrayOutputStream;
+
+class MTOMProtocolHandler extends GenericSOAPHandler
+{
+ private Logger log = Logger.getLogger(MTOMProtocolHandler.class);
+
+ protected boolean handleOutbound(MessageContext msgContext) {
+ return dumpMessage(msgContext);
+ }
+
+ protected boolean handleInbound(MessageContext msgContext) {
+ return dumpMessage(msgContext);
+ }
+
+ private boolean dumpMessage(MessageContext context) {
+ try
+ {
+ SOAPMessage msg = ((CommonMessageContext)context).getSOAPMessage();
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ msg.writeTo(bout);
+ log.info(bout.toString());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java 2006-12-08 15:00:40 UTC (rev 1615)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPBase.java 2006-12-08 16:00:45 UTC (rev 1616)
@@ -0,0 +1,108 @@
+package org.jboss.test.ws.jaxws.xop.doclit;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.Source;
+import javax.xml.ws.soap.SOAPBinding;
+import java.net.URL;
+import java.awt.image.BufferedImage;
+import java.awt.*;
+import java.io.InputStream;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: hbraun
+ * Date: 08.12.2006
+ * Time: 16:02:37
+ * To change this template use File | Settings | File Templates.
+ */
+public abstract class XOPBase extends JBossWSTest {
+
+ protected MTOMEndpoint port;
+ protected SOAPBinding binding;
+
+ protected abstract MTOMEndpoint getPort();
+ protected abstract SOAPBinding getBinding();
+
+ public void testDHRoundtrip() throws Exception
+ {
+ getBinding().setMTOMEnabled(true);
+
+ URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
+ DataHandler dh = new DataHandler(url);
+ DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+ assertEquals(response.getDataHandler().getContentType(), "image/jpeg");
+ assertTrue(response.getDataHandler().getContent() instanceof BufferedImage);
+ }
+
+ public void testDHResponseOptimzed() throws Exception
+ {
+ getBinding().setMTOMEnabled(false);
+
+ URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
+ DataHandler dh = new DataHandler(url);
+ DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+ assertEquals(response.getDataHandler().getContentType(), "application/octet-stream");
+ assertTrue("Wrong java type returned", response.getDataHandler().getContent() instanceof InputStream);
+ }
+
+ public void testImgRoundtrip() throws Exception
+ {
+ getBinding().setMTOMEnabled(true);
+
+ Image img = XOPTestSupport.createTestImage();
+ ImageRequest request = new ImageRequest();
+ request.setData(img);
+
+ ImageResponse response = getPort().echoImage(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Image);
+ }
+
+ public void testImgResponseOptimized() throws Exception
+ {
+ getBinding().setMTOMEnabled(false);
+
+ Image img = XOPTestSupport.createTestImage();
+ ImageRequest request = new ImageRequest();
+ request.setData(img);
+
+ ImageResponse response = getPort().echoImage(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Image);
+ }
+
+ public void testSrcRoundtrip() throws Exception
+ {
+ getBinding().setMTOMEnabled(true);
+
+ Source src = XOPTestSupport.createTestSource();
+ SourceRequest request = new SourceRequest();
+ request.setData(src);
+
+ SourceResponse response = getPort().echoSource(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Source);
+ }
+
+ public void testSrcResponseOptimized() throws Exception
+ {
+ getBinding().setMTOMEnabled(false);
+
+ Source src = XOPTestSupport.createTestSource();
+ SourceRequest request = new SourceRequest();
+ request.setData(src);
+
+ SourceResponse response = getPort().echoSource(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Source);
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java 2006-12-08 15:00:40 UTC (rev 1615)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPHandlerTestCase.java 2006-12-08 16:00:45 UTC (rev 1616)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.jaxws.xop.doclit;
+
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.logging.Logger;
+import junit.framework.Test;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
+import java.net.URL;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since 05.12.2006
+ */
+public class XOPHandlerTestCase extends XOPBase {
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-xop-doclit/MTOMEndpointBean";
+
+ private Logger log = Logger.getLogger(XOPHandlerTestCase.class);
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPHandlerTestCase.class, "jaxws-xop-doclit.jar, jaxws-xop-doclit-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+
+ QName serviceName = new QName("http://org.jboss.ws/xop/doclit", "MTOMService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS+"?wsdl");
+
+ javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
+ port = service.getPort(MTOMEndpoint.class);
+
+ // enable MTOM
+ binding = (SOAPBinding)((BindingProvider) port).getBinding();
+ binding.getHandlerChain().add(new MTOMProtocolHandler());
+
+ // debug request/reponse
+
+ /*BindingProvider bp = (BindingProvider)port;
+ Map<String,Object> context = bp.getRequestContext();
+ context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8081/jaxws-xop-doclit/MTOMEndpointBean");
+ */
+ }
+
+ protected MTOMEndpoint getPort() {
+ return port;
+ }
+
+ protected SOAPBinding getBinding() {
+ return binding;
+ }
+
+}
\ No newline at end of file
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 15:00:40 UTC (rev 1615)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 16:00:45 UTC (rev 1616)
@@ -42,13 +42,10 @@
* @version $Id$
* @since 05.12.2006
*/
-public class XOPTestCase extends JBossWSTest {
+public class XOPTestCase extends XOPBase {
public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-xop-doclit/MTOMEndpointBean";
- private MTOMEndpoint port;
- private SOAPBinding binding;
-
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(XOPTestCase.class, "jaxws-xop-doclit.jar, jaxws-xop-doclit-client.jar");
@@ -68,89 +65,18 @@
// debug request/reponse
- BindingProvider bp = (BindingProvider)port;
+ /*BindingProvider bp = (BindingProvider)port;
Map<String,Object> context = bp.getRequestContext();
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8081/jaxws-xop-doclit/MTOMEndpointBean");
-
+ */
}
- public void testDHRoundtrip() throws Exception
- {
- binding.setMTOMEnabled(true);
-
- URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
- DataHandler dh = new DataHandler(url);
- DHResponse response = port.echoDataHandler(new DHRequest(dh));
- assertNotNull(response);
- assertEquals(response.getDataHandler().getContentType(), "image/jpeg");
- assertTrue(response.getDataHandler().getContent() instanceof BufferedImage);
+ protected MTOMEndpoint getPort() {
+ return port;
}
- public void testDHResponseOptimzed() throws Exception
- {
- binding.setMTOMEnabled(false);
-
- URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
- DataHandler dh = new DataHandler(url);
- DHResponse response = port.echoDataHandler(new DHRequest(dh));
- assertNotNull(response);
- assertEquals(response.getDataHandler().getContentType(), "application/octet-stream");
- assertTrue("Wrong java type returned", response.getDataHandler().getContent() instanceof InputStream);
+ protected SOAPBinding getBinding() {
+ return binding;
}
- public void testImgRoundtrip() throws Exception
- {
- binding.setMTOMEnabled(true);
-
- Image img = XOPTestSupport.createTestImage();
- ImageRequest request = new ImageRequest();
- request.setData(img);
-
- ImageResponse response = port.echoImage(request);
-
- assertNotNull(response);
- assertTrue(response.getData() instanceof Image);
- }
-
- public void testImgResponseOptimized() throws Exception
- {
- binding.setMTOMEnabled(false);
-
- Image img = XOPTestSupport.createTestImage();
- ImageRequest request = new ImageRequest();
- request.setData(img);
-
- ImageResponse response = port.echoImage(request);
-
- assertNotNull(response);
- assertTrue(response.getData() instanceof Image);
- }
-
- public void testSrcRoundtrip() throws Exception
- {
- binding.setMTOMEnabled(true);
-
- Source src = XOPTestSupport.createTestSource();
- SourceRequest request = new SourceRequest();
- request.setData(src);
-
- SourceResponse response = port.echoSource(request);
-
- assertNotNull(response);
- assertTrue(response.getData() instanceof Source);
- }
-
- public void testSrcResponseOptimized() throws Exception
- {
- binding.setMTOMEnabled(false);
-
- Source src = XOPTestSupport.createTestSource();
- SourceRequest request = new SourceRequest();
- request.setData(src);
-
- SourceResponse response = port.echoSource(request);
-
- assertNotNull(response);
- assertTrue(response.getData() instanceof Source);
- }
}
\ No newline at end of file
19 years, 5 months
JBossWS SVN: r1615 - in trunk: . src/main/java/javax/xml/ws/soap src/main/java/org/jboss/ws/core src/main/java/org/jboss/ws/core/jaxrpc src/main/java/org/jboss/ws/core/jaxws/binding src/main/java/org/jboss/ws/core/jaxws/spi src/main/java/org/jboss/ws/core/server src/main/java/org/jboss/ws/extensions/xop src/main/java/org/jboss/ws/metadata/builder/jaxws src/main/java/org/jboss/ws/metadata/umdm src/test/java/org/jboss/test/ws/jaxws/xop/doclit
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-08 10:00:40 -0500 (Fri, 08 Dec 2006)
New Revision: 1615
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceResponse.java
Modified:
trunk/build.xml
trunk/src/main/java/javax/xml/ws/soap/SOAPBinding.java
trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
Log:
Handling of SOAPBinding.setMTOMEnabled()
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/build.xml 2006-12-08 15:00:40 UTC (rev 1615)
@@ -34,6 +34,7 @@
<property name="build.samples.dir" value="${build.dir}/samples"/>
<property name="build.bin.dist" value="${build.dir}/bin-dist"/>
<property name="build.src.dist" value="${build.dir}/src-dist"/>
+ <property name="build.api" value="${build.dir}/api"/>
<property name="docs.userguide.dir" value="${basedir}/docs/user-guide/project"/>
<property name="src.dir" value="${basedir}/src/main"/>
<property name="src.etc.dir" value="${src.dir}/etc"/>
@@ -358,19 +359,29 @@
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
+
+ <!-- Generate the JavaDoc -->
+ <target name="javadoc" depends="init" description="Generate the Javadoc">
+
+ <mkdir dir="${build.api}"/>
+ <javadoc destdir="${build.api}" author="true" version="true" use="true" windowtitle="JBossWS API">
+ <packageset dir="${src.java.dir}" defaultexcludes="yes">
+ <include name="org/jboss/ws/**"/>
+ </packageset>
+ <packageset dir="${jboss.server.root}/../src/main" defaultexcludes="yes">
+ <include name="org/jboss/webservice/metadata/**"/>
+ </packageset>
+
+ <doctitle><![CDATA[<h1>JBossWS</h1>]]></doctitle>
+ <tag name="todo" scope="all" description="To do:"/>
+ <group title="Core" packages="org.jboss.ws.core*"/>
+ <group title="Metadata" packages="org.jboss.ws.metadata*"/>
+ <group title="Integration" packages="org.jboss.ws.integration*"/>
+ <group title="Extensions" packages="org.jboss.ws.extensions*"/>
+ <group title="Tools" packages="org.jboss.ws.tools*"/>
+ </javadoc>
+ </target>
- <!-- Generate the JavaDoc -->
- <target name="javadoc" depends="init" description="Generate the Javadoc">
- <javadoc destdir="${build.api}" author="true" version="true" use="true" windowtitle="JBossWS API">
- <packageset dir="${src.java.dir}" defaultexcludes="yes">
- <include name="org/jboss/ws/**"/>
- </packageset>
- <packageset dir="${jboss.server.root}/../src/main" defaultexcludes="yes">
- <include name="org/jboss/webservice/metadata/**"/>
- </packageset>
- </javadoc>
- </target>
-
<!-- ================================================================== -->
<!-- Deployment -->
<!-- ================================================================== -->
Modified: trunk/src/main/java/javax/xml/ws/soap/SOAPBinding.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/soap/SOAPBinding.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/javax/xml/ws/soap/SOAPBinding.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -36,12 +36,29 @@
*/
public interface SOAPBinding extends Binding
{
- /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
- public static String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding.
+ */
+ public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
- /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
- public static String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding.
+ */
+ public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP11HTTP_MTOM_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true";
+
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
+
+
public abstract Set<URI> getRoles();
public abstract void setRoles(Set<URI> set);
Modified: trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -89,11 +89,28 @@
private boolean mtomEnabled;
- /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding.
+ */
+ public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding.
+ */
public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
- /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
- public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP11HTTP_MTOM_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true";
+
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
+
private static final Name SOAP_ARRAY_NAME = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
public CommonSOAPBinding()
@@ -136,8 +153,10 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
- msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
-
+ XOPContext.setMTOMEnabled(false);
+ else
+ XOPContext.setMTOMEnabled( isMTOMEnabled() );
+
// Associate current message with message context
SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
msgContext.setSOAPMessage(reqMessage);
@@ -269,7 +288,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
-
+
// Get the namespace registry
NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
@@ -384,8 +403,10 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
- msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
-
+ XOPContext.setMTOMEnabled(false);
+ else
+ XOPContext.setMTOMEnabled( isMTOMEnabled() );
+
// Associate current message with message context
SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
msgContext.setSOAPMessage(resMessage);
@@ -509,7 +530,7 @@
/** On the client side, extract the OUT parameters from the payload and return them to the client. */
public void unbindResponseMessage(OperationMetaData opMetaData, Object payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
+ throws BindingException
{
log.debug("unbindResponseMessage: " + opMetaData.getQName());
@@ -541,7 +562,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
-
+
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPBody soapBody = soapEnvelope.getBody();
Iterator bodyChildren = soapBody.getChildElements();
@@ -656,7 +677,7 @@
handleException(e);
}
}
-
+
public abstract SOAPMessage exceptionToFaultMessage(Exception ex);
private void verifySOAPVersion(OperationMetaData opMetaData, SOAPEnvelope soapEnvelope)
@@ -785,7 +806,7 @@
// When a potential xop parameter is detected and MTOM is enabled
// we flag the SOAP message as a XOP package
- if (paramMetaData.isXOP() && XOPContext.isMTOMEnabled())
+ if (paramMetaData.isXOP() && XOPContext.isMTOMEnabled())
{
log.trace("Add parameter as XOP");
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -40,6 +40,11 @@
// Delegate to JAXWS SOAP binding
private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
+ public SOAP11BindingJAXRPC() {
+ super();
+ setMTOMEnabled(true);
+ }
+
public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
{
delegate.setSOAPActionHeader(opMetaData, reqMessage);
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -40,6 +40,11 @@
// Delegate to JAXWS SOAP binding
private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
+ public SOAP12BindingJAXRPC() {
+ super();
+ setMTOMEnabled(true);
+ }
+
public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
{
delegate.setSOAPActionHeader(opMetaData, reqMessage);
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -74,10 +74,18 @@
{
binding = new SOAP11BindingJAXWS();
}
+ else if (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId))
+ {
+ binding = new SOAP11BindingJAXWS(true);
+ }
else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
{
binding = new SOAP12BindingJAXWS();
}
+ else if (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
+ {
+ binding = new SOAP12BindingJAXWS(true);
+ }
else if (HTTPBinding.HTTP_BINDING.equals(bindingId))
{
binding = new HTTPBindingJAXWS();
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -52,8 +52,15 @@
public SOAP11BindingJAXWS()
{
+ super();
+ setMTOMEnabled(false);
}
+ public SOAP11BindingJAXWS(boolean mtomEnabled) {
+ super();
+ setMTOMEnabled(mtomEnabled);
+ }
+
public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
{
delegate.setSOAPActionHeader(opMetaData, reqMessage);
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -53,8 +53,14 @@
public SOAP12BindingJAXWS()
{
+ super();
+ setMTOMEnabled(false);
}
+ public SOAP12BindingJAXWS(boolean mtomEnabled) {
+ setMTOMEnabled(mtomEnabled);
+ }
+
public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
{
delegate.setSOAPActionHeader(opMetaData, reqMessage);
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -91,7 +91,7 @@
* implementation using some default configuration. In order to get more control over the server configuration,
* please use the javax.xml.ws.Endpoint#publish(Object) method instead.
*
- * @param A URI specifying the address to use. The address must be compatible with the binding specified at the time the endpoint was created.
+ * @param URI specifying the address to use. The address must be compatible with the binding specified at the time the endpoint was created.
*/
@Override
public void publish(String address)
Modified: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -23,30 +23,10 @@
// $Id$
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.UndeclaredThrowableException;
-
-import javax.management.MBeanException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.handler.MessageContext;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.core.*;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
@@ -55,10 +35,21 @@
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import javax.management.MBeanException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.*;
+import javax.xml.ws.Binding;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.handler.MessageContext;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.UndeclaredThrowableException;
+
/** An implementation handles invocations on the endpoint
*
* @author Thomas.Diesler(a)jboss.org
@@ -183,6 +174,9 @@
if (epMetaData.getType() == EndpointMetaData.Type.JAXWS)
msgContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(true));
+ if(binding instanceof CommonSOAPBinding)
+ XOPContext.setMTOMEnabled( ((CommonSOAPBinding)binding).isMTOMEnabled());
+
// Bind the response message
SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
msgContext.setSOAPMessage(resMessage);
Modified: trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -21,18 +21,6 @@
*/
package org.jboss.ws.extensions.xop;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -47,11 +35,17 @@
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.extensions.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Iterator;
+
/**
* XOP context associated with a message context.
* Acts as a facade to the current soap message and supports the various XOP transitions.<p>
@@ -125,18 +119,9 @@
*/
public static boolean isMTOMEnabled()
{
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- boolean isJAXWS = msgContext.getEndpointMetaData().getType() == EndpointMetaData.Type.JAXWS;
-
- if (isJAXWS)
- {
- return msgContext.getEndpointMetaData().isMtomEnabled();
- }
- else
- {
- Boolean mtomEnabled = (Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
- return Boolean.TRUE.equals(mtomEnabled) || mtomEnabled == null;
- }
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ Boolean mtomEnabled = (Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
+ return Boolean.TRUE.equals(mtomEnabled) || mtomEnabled == null;
}
public static void setMTOMEnabled(boolean b)
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -50,18 +50,7 @@
String uri = anBindingType.value();
if (uri.length() > 0)
{
- // TODO: switch to JAX-WS 2.1
- // This allows us to use constants here and reuse the orig. URI straigt away
- if(uri.equals("http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"))
- {
- log.debug("MTOM enabled endpoint found");
- epMetaData.setMtomEnabled(true);
- epMetaData.setBindingId(uri.substring(0, uri.indexOf("?")));
- }
- else
- {
- epMetaData.setBindingId(uri);
- }
+ epMetaData.setBindingId(uri);
}
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -23,19 +23,6 @@
// $Id$
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.Service.Mode;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -49,9 +36,17 @@
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.Service.Mode;
+import java.lang.reflect.Method;
+import java.util.*;
+
/**
* A Service component describes a set of endpoints.
*
@@ -113,9 +108,6 @@
// Maps the java method to the operation meta data
private Map<Method, OperationMetaData> opMetaDataCache = new HashMap<Method, OperationMetaData>();
- // JAX-WS default is false
- private boolean mtomEnabled = false;
-
public EndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
{
this.serviceMetaData = service;
@@ -183,8 +175,14 @@
public void setBindingId(String bindingId)
{
- if (!Constants.SOAP11HTTP_BINDING.equals(bindingId) && !Constants.SOAP12HTTP_BINDING.equals(bindingId))
+ if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId)
+ && !CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId)
+ && !CommonSOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
+ && !CommonSOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
+ {
throw new WSException("Unsupported binding: " + bindingId);
+ }
+
this.bindingId = bindingId;
}
@@ -315,14 +313,6 @@
return type;
}
- public boolean isMtomEnabled() {
- return mtomEnabled;
- }
-
- public void setMtomEnabled(boolean mtomEnabled) {
- this.mtomEnabled = mtomEnabled;
- }
-
public String getAuthMethod()
{
return authMethod;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -25,7 +25,7 @@
import javax.xml.bind.annotation.XmlMimeType;
import javax.xml.bind.annotation.XmlType;
-@XmlType(name="request", namespace = "http://org.jboss.ws/xop/doclit")
+@XmlType(name="dataRequest", namespace = "http://org.jboss.ws/xop/doclit")
public class DHRequest {
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -25,7 +25,7 @@
import javax.xml.bind.annotation.XmlMimeType;
import javax.xml.bind.annotation.XmlType;
-@XmlType(name="response", namespace = "http://org.jboss.ws/xop/doclit")
+@XmlType(name="dataResponse", namespace = "http://org.jboss.ws/xop/doclit")
public class DHResponse {
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageRequest.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageRequest.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.jaxws.xop.doclit;
+
+import javax.xml.bind.annotation.XmlType;
+import java.awt.*;
+
+@XmlType(name="imageRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class ImageRequest {
+
+ private Image data;
+
+
+ public Image getData()
+ {
+ return data;
+ }
+
+ public void setData(Image data)
+ {
+ this.data = data;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageResponse.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/ImageResponse.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.jaxws.xop.doclit;
+
+import javax.xml.bind.annotation.XmlType;
+import java.awt.*;
+
+@XmlType(name="imageResponse", namespace = "http://org.jboss.ws/xop/doclit")
+public class ImageResponse {
+
+ private Image data;
+
+
+ public ImageResponse()
+ {
+ }
+
+ public ImageResponse(Image data)
+ {
+ this.data = data;
+ }
+
+ public Image getData()
+ {
+ return data;
+ }
+
+ public void setData(Image data)
+ {
+ this.data = data;
+ }
+}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -13,4 +13,6 @@
public interface MTOMEndpoint {
public DHResponse echoDataHandler(DHRequest request);
+ public ImageResponse echoImage(ImageRequest request);
+ public SourceResponse echoSource(SourceRequest request);
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -47,8 +47,17 @@
throw new WSException(e);
}
- return new DHResponse(
- request.getDataHandler()
- );
+ return new DHResponse( request.getDataHandler() );
}
+
+
+ public ImageResponse echoImage(ImageRequest request)
+ {
+ return new ImageResponse(request.getData());
+ }
+
+ public SourceResponse echoSource(SourceRequest request)
+ {
+ return new SourceResponse(request.getData());
+ }
}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceRequest.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceRequest.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.jaxws.xop.doclit;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+@XmlType(name="sourceRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class SourceRequest {
+
+ Source data;
+
+ public Source getData()
+ {
+ return data;
+ }
+
+ public void setData(Source data)
+ {
+ this.data = data;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceResponse.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/SourceResponse.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.jaxws.xop.doclit;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+@XmlType(name="sourceResponse", namespace = "http://org.jboss.ws/xop/doclit")
+public class SourceResponse {
+
+ private Source data;
+
+ public SourceResponse()
+ {
+ }
+
+ public SourceResponse(Source data)
+ {
+ this.data = data;
+ }
+
+ public Source getData()
+ {
+ return data;
+ }
+
+ public void setData(Source data)
+ {
+ this.data = data;
+ }
+}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 08:43:18 UTC (rev 1614)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-08 15:00:40 UTC (rev 1615)
@@ -23,16 +23,19 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import junit.framework.Test;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Binding;
import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.transform.Source;
import javax.activation.DataHandler;
import java.net.URL;
+import java.awt.image.BufferedImage;
+import java.awt.*;
import java.util.Map;
-import java.awt.image.BufferedImage;
+import java.io.InputStream;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -40,10 +43,11 @@
* @since 05.12.2006
*/
public class XOPTestCase extends JBossWSTest {
-
+
public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-xop-doclit/MTOMEndpointBean";
- private MTOMEndpoint mtomWS;
+ private MTOMEndpoint port;
+ private SOAPBinding binding;
public static Test suite()
{
@@ -57,27 +61,96 @@
URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS+"?wsdl");
javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
- mtomWS = service.getPort(MTOMEndpoint.class);
+ port = service.getPort(MTOMEndpoint.class);
// enable MTOM
- SOAPBinding binding = (SOAPBinding)((BindingProvider)mtomWS).getBinding();
- binding.setMTOMEnabled(true);
+ binding = (SOAPBinding)((BindingProvider) port).getBinding();
// debug request/reponse
- /*
- BindingProvider bp = (BindingProvider)mtomWS;
- Map<String,Object> context = bp.getRequestContext();
+
+ BindingProvider bp = (BindingProvider)port;
+ Map<String,Object> context = bp.getRequestContext();
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8081/jaxws-xop-doclit/MTOMEndpointBean");
- */
+
}
- public void testRequestResponseOptimized() throws Exception
+ public void testDHRoundtrip() throws Exception
{
+ binding.setMTOMEnabled(true);
+
URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
- DataHandler dh = new DataHandler(url);
- DHResponse response = mtomWS.echoDataHandler(new DHRequest(dh));
+ DataHandler dh = new DataHandler(url);
+ DHResponse response = port.echoDataHandler(new DHRequest(dh));
assertNotNull(response);
assertEquals(response.getDataHandler().getContentType(), "image/jpeg");
assertTrue(response.getDataHandler().getContent() instanceof BufferedImage);
}
+
+ public void testDHResponseOptimzed() throws Exception
+ {
+ binding.setMTOMEnabled(false);
+
+ URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
+ DataHandler dh = new DataHandler(url);
+ DHResponse response = port.echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+ assertEquals(response.getDataHandler().getContentType(), "application/octet-stream");
+ assertTrue("Wrong java type returned", response.getDataHandler().getContent() instanceof InputStream);
+ }
+
+ public void testImgRoundtrip() throws Exception
+ {
+ binding.setMTOMEnabled(true);
+
+ Image img = XOPTestSupport.createTestImage();
+ ImageRequest request = new ImageRequest();
+ request.setData(img);
+
+ ImageResponse response = port.echoImage(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Image);
+ }
+
+ public void testImgResponseOptimized() throws Exception
+ {
+ binding.setMTOMEnabled(false);
+
+ Image img = XOPTestSupport.createTestImage();
+ ImageRequest request = new ImageRequest();
+ request.setData(img);
+
+ ImageResponse response = port.echoImage(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Image);
+ }
+
+ public void testSrcRoundtrip() throws Exception
+ {
+ binding.setMTOMEnabled(true);
+
+ Source src = XOPTestSupport.createTestSource();
+ SourceRequest request = new SourceRequest();
+ request.setData(src);
+
+ SourceResponse response = port.echoSource(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Source);
+ }
+
+ public void testSrcResponseOptimized() throws Exception
+ {
+ binding.setMTOMEnabled(false);
+
+ Source src = XOPTestSupport.createTestSource();
+ SourceRequest request = new SourceRequest();
+ request.setData(src);
+
+ SourceResponse response = port.echoSource(request);
+
+ assertNotNull(response);
+ assertTrue(response.getData() instanceof Source);
+ }
}
\ No newline at end of file
19 years, 5 months
JBossWS SVN: r1614 - in branches/dlofthouse/JBWS-1260/src/test: java/org/jboss/test/ws/tools/jbws1260 resources/tools/jbws1260 resources/tools/jbws1260/scenario_T resources/tools/jbws1260/scenario_U resources/tools/jbws1260/scenario_V resources/tools/jbws1260/scenario_W resources/tools/jbws1260/scenario_X
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-08 03:43:18 -0500 (Fri, 08 Dec 2006)
New Revision: 1614
Added:
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/Wrapped.wsdl
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/Wrapped.wsdl
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/Wrapped.wsdl
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/Wrapped.wsdl
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/wstools-config.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/Wrapped.wsdl
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/wstools-config.xml
Modified:
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
Log:
JBWS-1260 - Additional test cases for testing handling of attributes.
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -62,6 +62,11 @@
tests.add('Q');
tests.add('R');
tests.add('S');
+ tests.add('T');
+ tests.add('U');
+ tests.add('V');
+ tests.add('W');
+ tests.add('X');
}
/**
@@ -465,7 +470,109 @@
{
generateScenario('S');
}
+
+ /**
+ * Test scenario where the element referenced as the message
+ * parts references a complex type which contains
+ * an empty sequence and a single attribute.
+ *
+ * <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ *
+ * <complexType name='TelephoneNumber'>
+ * <sequence>
+ * </sequence>
+ * <attribute name='postcode' type='string'/>
+ * </complexType>
+ *
+ */
+ public void testScenario_T() throws Exception
+ {
+ generateScenario('T');
+ }
+
+ /**
+ * Test scenario where the element referenced as the message
+ * parts references a complex type which contains an anonymous
+ * complex type which contains an empty sequence and a single
+ * attribute.
+ *
+ * <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ *
+ * <complexType name='TelephoneNumber'>
+ * <sequence>
+ * <element name='Number'>
+ * <complexType>
+ * <sequence>
+ * </sequence>
+ * <attribute name='postcode' type='string'/>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </complexType>
+ *
+ */
+ public void testScenario_U() throws Exception
+ {
+ generateScenario('U');
+ }
+
+ /**
+ * Test scenario where the element referenced as the message
+ * parts contains an anonymous complex type which contains
+ * a single attribute.
+ *
+ * <element name='lookupResponse'>
+ * <complexType>
+ * <attribute name='postcode' type='string'/>
+ * </complexType>
+ * </element>
+ *
+ */
+ public void testScenario_V() throws Exception
+ {
+ generateScenario('V');
+ }
+
+ /**
+ * Test scenario where the element referenced as the message
+ * parts references a complex type which contains
+ * a single attribute.
+ *
+ * <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ *
+ * <complexType name='TelephoneNumber'>
+ * <attribute name='postcode' type='string'/>
+ * </complexType>
+ *
+ */
+ public void testScenario_W() throws Exception
+ {
+ generateScenario('W');
+ }
+ /**
+ * Test scenario where the element referenced as the message
+ * parts references a complex type which contains an anonymous
+ * complex type which contains a single attribute.
+ *
+ * <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ *
+ * <complexType name='TelephoneNumber'>
+ * <sequence>
+ * <element name='Number'>
+ * <complexType>
+ * <attribute name='postcode' type='string'/>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </complexType>
+ *
+ */
+ public void testScenario_X() throws Exception
+ {
+ generateScenario('X');
+ }
+
protected void generateScenario(final char scenario) throws Exception
{
if (tests.contains(scenario) == false)
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/PhoneBook_PortType.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/PhoneBook_PortType.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public java.lang.String lookup(java.lang.String postcode) throws
+ java.rmi.RemoteException;
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/Wrapped.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/Wrapped.wsdl 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/Wrapped.wsdl 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1260' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1260/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1260' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1260/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1260/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ </sequence>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ </sequence>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/wstools-config.xml 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/wstools-config.xml 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_T/Wrapped.wsdl" parameter-style="wrapped">
+ <!--mapping file="wrapped-mapping.xml"/-->
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_T/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/PhoneBook_PortType.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/PhoneBook_PortType.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public org.jboss.test.ws.jbws1260.LookupResponseNumber lookup(org.jboss.test.ws.jbws1260.LookupName name) throws
+ java.rmi.RemoteException;
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/Wrapped.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/Wrapped.wsdl 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/Wrapped.wsdl 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1260' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1260/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1260' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1260/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1260/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='Name'>
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='Number'>
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/wstools-config.xml 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/wstools-config.xml 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_U/Wrapped.wsdl" parameter-style="wrapped">
+ <!--mapping file="wrapped-mapping.xml"/-->
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_U/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/PhoneBook_PortType.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/PhoneBook_PortType.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public java.lang.String lookup(java.lang.String postcode) throws
+ java.rmi.RemoteException;
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/Wrapped.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/Wrapped.wsdl 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/Wrapped.wsdl 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1260' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1260/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1260' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1260/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1260/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <element name='lookup'>
+ <complexType>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+
+ <element name='lookupResponse'>
+ <complexType>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/wstools-config.xml 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/wstools-config.xml 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_V/Wrapped.wsdl" parameter-style="wrapped">
+ <!--mapping file="wrapped-mapping.xml"/-->
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_V/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/PhoneBook_PortType.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/PhoneBook_PortType.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public java.lang.String lookup(java.lang.String postcode) throws
+ java.rmi.RemoteException;
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/Wrapped.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/Wrapped.wsdl 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/Wrapped.wsdl 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1260' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1260/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1260' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1260/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1260/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/wstools-config.xml 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/wstools-config.xml 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_W/Wrapped.wsdl" parameter-style="wrapped">
+ <!--mapping file="wrapped-mapping.xml"/-->
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_W/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/PhoneBook_PortType.java 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/PhoneBook_PortType.java 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public org.jboss.test.ws.jbws1260.LookupResponseNumber lookup(org.jboss.test.ws.jbws1260.LookupName name) throws
+ java.rmi.RemoteException;
+}
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/Wrapped.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/Wrapped.wsdl 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/Wrapped.wsdl 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1260' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1260/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1260' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1260/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1260/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='Name'>
+ <complexType>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='Number'>
+ <complexType>
+ <attribute name='postcode' type='string'/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/wstools-config.xml 2006-12-08 05:56:53 UTC (rev 1613)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/wstools-config.xml 2006-12-08 08:43:18 UTC (rev 1614)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_X/Wrapped.wsdl" parameter-style="wrapped">
+ <!--mapping file="wrapped-mapping.xml"/-->
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_X/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years, 5 months
JBossWS SVN: r1613 - trunk/src/main/java/org/jboss/ws/metadata/umdm
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-12-08 00:56:53 -0500 (Fri, 08 Dec 2006)
New Revision: 1613
Modified:
trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
Log:
Fix parameter matching on wrapped OUT parameters
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2006-12-07 19:12:56 UTC (rev 1612)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2006-12-08 05:56:53 UTC (rev 1613)
@@ -231,21 +231,16 @@
for (ParameterMetaData param : getParameters())
{
- if (param.matchParameter(method, matches, exact) == false)
+ if (!param.matchParameter(method, matches, exact))
return false;
}
- // We should have an entry for every parameter index if we match
- if (matches.size() != paramTypes.length)
- return false;
-
ParameterMetaData returnMetaData = getReturnParameter();
- if (returnMetaData != null)
- {
- return returnMetaData.matchParameter(method, matches, exact);
- }
+ if (returnMetaData != null && !returnMetaData.matchParameter(method, matches, exact))
+return false;
- return true;
+ // We should have an entry for every parameter index if we match
+ return matches.size() == paramTypes.length;
}
/** Return true if this is a generic message style destination that takes a org.w3c.dom.Element
19 years, 5 months
JBossWS SVN: r1612 - trunk
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-07 14:12:56 -0500 (Thu, 07 Dec 2006)
New Revision: 1612
Modified:
trunk/build.xml
Log:
include jaxrpc, saaj in jbossws-client.jar
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-07 17:10:48 UTC (rev 1611)
+++ trunk/build.xml 2006-12-07 19:12:56 UTC (rev 1612)
@@ -261,8 +261,13 @@
<!-- Build jbossws-client.jar -->
<jar jarfile="${build.lib.dir}/jbossws-client.jar" manifest="${build.etc.dir}/default.mf">
+ <fileset dir="${build.classes14.dir}">
+ <include name="javax/xml/rpc/**"/>
+ <include name="javax/xml/soap/**"/>
+ </fileset>
<fileset dir="${build.classes.dir}">
- <include name="javax/**"/>
+ <include name="javax/xml/ws/**"/>
+ <include name="javax/jws/**"/>
<include name="org/jboss/ws/**"/>
<exclude name="org/jboss/ws/integration/jboss50/**"/>
<exclude name="org/jboss/ws/integration/tomcat/**"/>
19 years, 5 months
JBossWS SVN: r1611 - in trunk/src: main/java/javax/xml/soap main/java/org/jboss/ws/extensions/xop/jaxws main/java/org/jboss/ws/metadata/builder/jaxws test/java/org/jboss/test/ws/jaxws/xop
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-07 12:10:48 -0500 (Thu, 07 Dec 2006)
New Revision: 1611
Modified:
trunk/src/main/java/javax/xml/soap/MessageFactory.java
trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
Fixed recursive loop in ReflectiveXOPScanner
Modified: trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-07 15:51:30 UTC (rev 1610)
+++ trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-07 17:10:48 UTC (rev 1611)
@@ -61,7 +61,7 @@
{
// provide logging
private static Logger log = Logger.getLogger(MessageFactory.class);
-
+
private static final String DEFAULT_MESSAGE_FACTORY = "org.jboss.ws.core.soap.MessageFactoryImpl";
private static final String[] alternativeFactories = new String[] { "org.jboss.axis.soap.MessageFactoryImpl" };
Modified: trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07 15:51:30 UTC (rev 1610)
+++ trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveXOPScanner.java 2006-12-07 17:10:48 UTC (rev 1611)
@@ -1,90 +1,149 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.ws.extensions.xop.jaxws;
+import org.jboss.ws.core.utils.JavaUtils;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.transform.Source;
+import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
-import javax.xml.bind.annotation.XmlMimeType;
-
-import org.jboss.ws.core.utils.JavaUtils;
-
/**
+ * Scans data types for MTOM declarations.
+ * In order to re-use an instance of this class you need to invoke <code>reset()</code>
+ * in between scans.
+ *
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
* @since 04.12.2006
+ *
*/
-public class ReflectiveXOPScanner
-{
+public class ReflectiveXOPScanner {
+ private static List<Class> SUPPORTED_TYPES = new ArrayList<Class>(5);
+
+ static {
+ SUPPORTED_TYPES.add(String.class);
+ SUPPORTED_TYPES.add(byte[].class);
+ SUPPORTED_TYPES.add(Image.class);
+ SUPPORTED_TYPES.add(Source.class);
+ SUPPORTED_TYPES.add(DataHandler.class);
+ }
+
+ private List<Field> scannedFields = new ArrayList<Field>();
+
/**
* Scan java types for MTOM declarations
*
* @param xmlRoot
- * @return the first matching XmlMimeType#value()
+ * @return the first matching XmlMimeType#value() or <code>null</code> if none found
*/
public String scan(Class xmlRoot)
{
- for (Field field : xmlRoot.getDeclaredFields())
+
+ if( isJDKType(xmlRoot) )
+ return null;
+
+ String mimeType = null;
+
+ for(Field field : xmlRoot.getDeclaredFields())
{
Class<?> type = field.getType();
- String mimeType = null;
-
- // prevent endless recursion
- if (type == xmlRoot)
- continue;
- if (field.isAnnotationPresent(XmlMimeType.class))
- {
- XmlMimeType mimeTypeDecl = field.getAnnotation(XmlMimeType.class);
- mimeType = mimeTypeDecl.value();
- }
+ boolean exceptionToTheRule = isMTOMDataType(type);
- if (null == mimeType) // try getter methods
+ // only non JDK types are inspected except for byte[] and java.lang.String
+ if( !alreadyScanned(field) && (exceptionToTheRule || !isJDKType(type)) )
{
- mimeType = scanGetterAnnotation(xmlRoot, field);
- }
+ if(field.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = field.getAnnotation(XmlMimeType.class);
+ mimeType = mimeTypeDecl.value();
+ }
- if (null == mimeType) // recursive search
- {
- if (!JavaUtils.isPrimitive(type) && !type.isArray() && !type.getName().startsWith("java"))
- scan(type);
+ if(null == mimeType) // try getter methods
+ {
+ mimeType = scanGetterAnnotation(xmlRoot, field);
+ }
+
+ // avoid recursive loops
+ if(!isMTOMDataType(type))
+ scannedFields.add(field);
+
+ // drill down if none found so far
+ if(null == mimeType)
+ mimeType = scan(type);
+
}
- else
- {
- return mimeType;
- }
}
- return null;
+ return mimeType;
}
+ private boolean alreadyScanned(Field field)
+ {
+
+ for(Field f : scannedFields)
+ {
+ if(f.equals(field))
+ return true;
+ }
+
+ return false;
+ }
+
+ public void reset()
+ {
+ scannedFields.clear();
+ }
+
+ private static boolean isMTOMDataType(Class clazz) {
+ for(Class cl : SUPPORTED_TYPES)
+ {
+ if(JavaUtils.isAssignableFrom(cl, clazz))
+ return true;
+ }
+
+ return false;
+ }
+
+ private static boolean isJDKType(Class clazz)
+ {
+ return clazz.getPackage()!= null ? clazz.getPackage().getName().startsWith("java") : true;
+ }
+
private static String scanGetterAnnotation(Class owner, Field field)
{
- String getterMethodName = "get" + field.getName();
- for (Method method : owner.getDeclaredMethods())
+ String getterMethodName = "get"+field.getName();
+ for(Method method : owner.getDeclaredMethods())
{
- if (method.getName().equalsIgnoreCase(getterMethodName) && method.isAnnotationPresent(XmlMimeType.class))
+ if(method.getName().equalsIgnoreCase(getterMethodName)
+ && method.isAnnotationPresent(XmlMimeType.class))
{
XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
return mimeTypeDecl.value();
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-07 15:51:30 UTC (rev 1610)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-07 17:10:48 UTC (rev 1611)
@@ -657,6 +657,17 @@
if (anWebService == null)
throw new WSException("Interface does not have a @WebService annotation: " + seiName);
+ else
+ {
+ if(anWebService.portName().length()>0
+ || anWebService.serviceName().length()>0
+ || anWebService.endpointInterface().length()>0
+ )
+ {
+ throw new WSException(seiName + ": The service endpoint interface MUST NOT include the JSR-181 annotation " +
+ "elements portName, serviceName and endpointInterface of the annotation @WebService.");
+ }
+ }
name = anWebService.name();
if (name.length() == 0)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-07 15:51:30 UTC (rev 1610)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-07 17:10:48 UTC (rev 1611)
@@ -40,6 +40,12 @@
static ReflectiveXOPScanner SCANNER = new ReflectiveXOPScanner();
+
+ protected void setUp() throws Exception
+ {
+ SCANNER.reset();
+ }
+
public void testFieldAnnotation() throws Exception
{
String mimeType = SCANNER.scan(FieldAnnotation.class);
@@ -75,8 +81,22 @@
String mimeType = SCANNER.scan( m.getParameterTypes()[0]);
assertNotNull("Unable to find xop declaration", mimeType);
+ assertEquals("text/xml", mimeType);
}
+ public void testSimpleRecursion() throws Exception
+ {
+ String mimeType = SCANNER.scan(SimpleRecursion.class);
+ assertNull(mimeType);
+ }
+
+ public void testComplexRecursion() throws Exception
+ {
+ String mimeType = SCANNER.scan(ComplexRecursion.class);
+ assertNotNull("Unable to find xop declaration", mimeType);
+ assertEquals("text/plain", mimeType);
+ }
+
class FieldAnnotation
{
@XmlMimeType("text/xml")
@@ -111,4 +131,20 @@
interface AnnotatedSEI {
void foo(@XmlMimeType("text/xml")byte[] bar);
}
+
+ class SimpleRecursion {
+ private SimpleRecursion data;
+ }
+
+ class ComplexRecursion
+ {
+ String data;
+ Nested nested;
+ }
+
+ class Nested
+ {
+ @XmlMimeType("text/plain")
+ String data;
+ }
}
19 years, 5 months
JBossWS SVN: r1610 - trunk
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-07 10:51:30 -0500 (Thu, 07 Dec 2006)
New Revision: 1610
Modified:
trunk/build.xml
Log:
format
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-07 14:36:56 UTC (rev 1609)
+++ trunk/build.xml 2006-12-07 15:51:30 UTC (rev 1610)
@@ -12,18 +12,18 @@
<!-- $Id$ -->
<project default="main" name="JBossWS">
-
+
<import file="${basedir}/src/ant/build-thirdparty.xml"/>
<import file="${basedir}/src/ant/build-samples.xml"/>
<import file="${basedir}/src/ant/build-release.xml"/>
-
+
<!-- ================================================================== -->
<!-- Setup -->
<!-- ================================================================== -->
-
+
<property file="ant.properties"/>
<property file="version.properties"/>
-
+
<property environment="env"/>
<property name="build.dir" value="${basedir}/output"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
@@ -45,9 +45,9 @@
<property name="test.etc.dir" value="${test.dir}/etc"/>
<property name="test.java.dir" value="${test.dir}/java"/>
<property name="test.resources.dir" value="${test.dir}/resources"/>
-
+
<property name="thirdparty.dir" value="${basedir}/thirdparty"/>
-
+
<property name="jboss.home" value="${jboss.jdk15.home}"/>
<property name="jboss.lib" value="${jboss.home}/lib"/>
<property name="jboss.client" value="${jboss.home}/client"/>
@@ -56,20 +56,20 @@
<property name="jboss.server.deploy" value="${jboss.server}/deploy"/>
<property name="jboss.server.deployers" value="${jboss.server}/deployers"/>
<property name="jboss.thirdparty" value="${jboss.home}/../../../thirdparty"/>
-
+
<property name="tomcat.webapps.dir" value="${tomcat.home}/webapps"/>
<property name="tomcat.common.dir" value="${tomcat.home}/common"/>
-
+
<!-- ================================================================== -->
<!-- Initialization -->
<!-- ================================================================== -->
-
+
<target name="prepare">
-
+
<echo message="jboss.jdk15.home = ${jboss.jdk15.home}"/>
<echo message="tomcat.home = ${tomcat.home}"/>
<echo/>
-
+
<available property="jbossws.portal.content.available" file="${jbossws.portal.content}" type="dir"/>
<available property="jboss.ejb3.available" file="${jboss.client}/jboss-ejb3-client.jar"/>
<available property="jbossws.thirdparty.available" file="${build.lib.dir}/jbossws-thirdparty.jar"/>
@@ -88,36 +88,36 @@
<isfalse value="${checksum.ok}"/>
</or>
</condition>
-
+
<fail message="Not available: ${jboss.client}/jboss-ejb3-client.jar" unless="jboss.ejb3.available"/>
-
+
<tstamp>
<format property="build.id" pattern="yyyyMMddHHmm"/>
</tstamp>
-
+
</target>
-
+
<target name="init" depends="prepare, thirdparty">
-
+
<!-- The combined compile classpath -->
<path id="core.classpath">
<path refid="library.classpath"/>
<path refid="jboss.core.classpath"/>
</path>
-
+
<!-- The combined integration classpath -->
<path id="integration.classpath">
<path refid="library.classpath"/>
<path refid="jboss.core.classpath"/>
<path refid="jboss.integration.classpath"/>
</path>
-
+
</target>
-
+
<!-- ================================================================== -->
<!-- Compile -->
<!-- ================================================================== -->
-
+
<!--
| Compile everything.
|
@@ -125,28 +125,28 @@
| different type of compile that needs to be performed, short of
| documentation compiles.
-->
-
+
<target name="compile" depends="init,compile-classes,compile-etc,compile-resources" description="Compile all source files."/>
-
+
<!-- Compile java sources -->
<target name="compile-classes" depends="compile-interfaces,compile-core,compile-integration"/>
-
+
<!-- Compile core java sources -->
<target name="compile-interfaces" depends="init">
<mkdir dir="${build.classes14.dir}"/>
- <javac srcdir="${src.java.dir}" destdir="${build.classes14.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
- deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}" source="1.4" target="1.4">
+ <javac srcdir="${src.java.dir}" destdir="${build.classes14.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}" deprecation="${javac.deprecation}"
+ failonerror="${javac.fail.onerror}" source="1.4" target="1.4">
<include name="javax/xml/rpc/**"/>
<include name="javax/xml/soap/**"/>
<classpath refid="core.classpath"/>
</javac>
</target>
-
+
<!-- Compile core java sources -->
<target name="compile-core" depends="compile-interfaces">
<mkdir dir="${build.classes.dir}"/>
- <javac srcdir="${src.java.dir}" sourcepath="" destdir="${build.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
- deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
+ <javac srcdir="${src.java.dir}" sourcepath="" destdir="${build.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<include name="javax/xml/ws/**"/>
<include name="javax/jws/**"/>
<include name="org/jboss/ws/**"/>
@@ -155,7 +155,7 @@
<classpath refid="core.classpath"/>
</javac>
</target>
-
+
<!-- Compile interation java sources -->
<target name="compile-integration" depends="compile-core">
<mkdir dir="${build.classes.dir}"/>
@@ -166,7 +166,7 @@
<classpath refid="integration.classpath"/>
</javac>
</target>
-
+
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
<mkdir dir="${build.etc.dir}"/>
@@ -181,7 +181,7 @@
</filterset>
</copy>
</target>
-
+
<!-- Compile resource files -->
<target name="compile-resources" depends="init">
<mkdir dir="${build.resources.dir}"/>
@@ -189,22 +189,22 @@
<fileset dir="${src.resources.dir}"/>
</copy>
</target>
-
+
<!-- ================================================================== -->
<!-- Archives -->
<!-- ================================================================== -->
-
+
<!--
| Build all jar files.
-->
<target name="jars" description="Builds all jar files." depends="compile,module-jars">
</target>
-
+
<!--
| Build all jar files.
-->
<target name="module-jars">
-
+
<!-- Build jboss-jaxrpc.jar -->
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${build.lib.dir}/jboss-jaxrpc.jar" manifest="${build.etc.dir}/default.mf">
@@ -212,7 +212,7 @@
<include name="javax/xml/rpc/**"/>
</fileset>
</jar>
-
+
<!-- Build jboss-saaj.jar -->
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${build.lib.dir}/jboss-saaj.jar" manifest="${build.etc.dir}/default.mf">
@@ -220,7 +220,7 @@
<include name="javax/xml/soap/**"/>
</fileset>
</jar>
-
+
<!-- Build jboss-jaxws.jar -->
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${build.lib.dir}/jboss-jaxws.jar" manifest="${build.etc.dir}/default.mf">
@@ -230,7 +230,7 @@
<include name="org/jboss/ws/jaxws/injection/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws-core.jar -->
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${build.lib.dir}/jbossws-core.jar" manifest="${build.etc.dir}/default.mf">
@@ -243,7 +243,7 @@
<include name="dtd/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws-jboss-integration.jar -->
<jar jarfile="${build.lib.dir}/jbossws-jboss-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
@@ -251,14 +251,14 @@
<include name="org/jboss/ws/integration/jboss50/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws-tomcat-integration.jar -->
<jar jarfile="${build.lib.dir}/jbossws-tomcat-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
<include name="org/jboss/ws/integration/tomcat/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws-client.jar -->
<jar jarfile="${build.lib.dir}/jbossws-client.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
@@ -281,7 +281,7 @@
<include name="wstools-log4j.xml"/>
</fileset>
</jar>
-
+
<!-- Build jbossws-context.war -->
<war warfile="${build.lib.dir}/jbossws-context.war" webxml="${build.resources.dir}/jbossws.war/JBoss/WEB-INF/web.xml">
<fileset dir="${build.resources.dir}/jbossws.war">
@@ -292,7 +292,7 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
-
+
<!-- Build jbossws.war -->
<war warfile="${build.lib.dir}/jbossws.war" webxml="${build.resources.dir}/jbossws.war/Tomcat/WEB-INF/web.xml">
<fileset dir="${build.resources.dir}/jbossws.war">
@@ -312,7 +312,7 @@
<include name="log4j.xml"/>
</classes>
</war>
-
+
<!-- Build jbossws.sar -->
<jar jarfile="${build.lib.dir}/jbossws.sar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.lib.dir}">
@@ -344,16 +344,16 @@
<include name="jbossws.deployer/META-INF/deployer-beans.xml"/>
</fileset>
</jar>
-
+
<zip destfile="${build.lib.dir}/jbossws-src.zip">
- <fileset dir="${src.java.dir}" />
+ <fileset dir="${src.java.dir}"/>
</zip>
</target>
-
+
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
-
+
<!-- Generate the JavaDoc -->
<target name="javadoc" depends="init" description="Generate the Javadoc">
<javadoc destdir="${build.api}" author="true" version="true" use="true" windowtitle="JBossWS API">
@@ -365,11 +365,11 @@
</packageset>
</javadoc>
</target>
-
+
<!-- ================================================================== -->
<!-- Deployment -->
<!-- ================================================================== -->
-
+
<!-- Deploy jbossws to the server -->
<target name="deploy-jbossws" depends="main" description="Deploy jbossws">
<antcall target="deploy-to-server">
@@ -381,29 +381,29 @@
<param name="jbossws" value="jbossws"/>
</antcall>
</target>
-
+
<!-- Deploy to jboss -->
<target name="deploy-to-server">
<copy todir="${jboss.deploy.home}/client" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/client" overwrite="true">
- <fileset dir="${build.lib.dir}">
- <include name="jboss-jaxrpc.jar"/>
- <include name="jboss-saaj.jar"/>
- <include name="${jbossws}-client.jar"/>
- </fileset>
+ <fileset dir="${build.lib.dir}">
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-saaj.jar"/>
+ <include name="${jbossws}-client.jar"/>
+ </fileset>
</copy>
<copy todir="${jboss.deploy.home}/server/${jboss.server.instance}/lib" overwrite="true">
- <fileset dir="${build.lib.dir}">
- <include name="jboss-jaxrpc.jar"/>
- <include name="jboss-saaj.jar"/>
- </fileset>
+ <fileset dir="${build.lib.dir}">
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-saaj.jar"/>
+ </fileset>
</copy>
<delete dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<mkdir dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<unjar dest="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar" src="${build.lib.dir}/${jbossws}.sar"/>
</target>
-
+
<!-- Deploy to jboss/thirdparty -->
<target name="deploy-to-thirdparty" if="jboss.source.dist.available">
<!-- Only needed for the JBossAS webservice testsuite
@@ -412,7 +412,7 @@
<copy todir="${jboss.deploy.home}/../../../thirdparty/jboss/${jbossws}/lib" file="${build.lib.dir}/${jbossws}.sar" overwrite="true"/>
-->
</target>
-
+
<!-- Deploy to Tomcat -->
<target name="deploy-tomcat" depends="main,jbossws-thirdparty-jar" description="Deploy JBossWS to Tomcat">
<copy todir="${tomcat.common.dir}/endorsed" file="${thirdparty.dir}/serializer.jar"/>
@@ -424,13 +424,13 @@
<copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jbossws-core.jar" overwrite="true"/>
<copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jbossws-tomcat-integration.jar" overwrite="true"/>
<copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jbossws-thirdparty.jar" overwrite="true"/>
- <copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jboss-jaxws.jar" overwrite="true"/>
+ <copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jboss-jaxws.jar" overwrite="true"/>
<copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jboss-jaxrpc.jar" overwrite="true"/>
<copy todir="${tomcat.common.dir}/lib" file="${build.lib.dir}/jboss-saaj.jar" overwrite="true"/>
<copy todir="${tomcat.webapps.dir}" file="${build.lib.dir}/jbossws.war" overwrite="true"/>
<delete dir="${tomcat.webapps.dir}/jbossws"/>
</target>
-
+
<target name="jbossws-thirdparty-jar" unless="jbossws.thirdparty.available">
<!-- Build jbossws-thirdparty.jar -->
<mkdir dir="${build.lib.dir}/build"/>
@@ -452,21 +452,20 @@
</jar>
<delete dir="${build.lib.dir}/build"/>
</target>
-
+
<target name="clean" depends="prepare" description="Cleans up most generated files.">
<delete dir="${build.dir}"/>
</target>
-
+
<target name="build-docs" description="Build the documentation">
<ant antfile="${docs.userguide.dir}/build.xml" dir="${docs.userguide.dir}" target="all.doc"/>
</target>
-
+
<target name="main" description="Executes the default target (most)." depends="most"/>
-
+
<target name="most" description="Builds almost everything." depends="jars"/>
-
- <target name="all" description="Create a distribution zip file"
- depends="build-bin-dist,build-src-dist">
+
+ <target name="all" description="Create a distribution zip file" depends="build-bin-dist,build-src-dist">
</target>
-
-</project>
+
+</project>
\ No newline at end of file
19 years, 5 months