JBossWS SVN: r2797 - in branches/dlofthouse/JBWS-429/jbossws-tests/src: java/org/jboss/test/ws/tools/jbws429 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 10:11:16 -0400 (Wed, 11 Apr 2007)
New Revision: 2797
Added:
branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/
branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java
branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/
branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/INOUT/
branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/
branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl
branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/wstools-config.xml
Log:
Initial test case.
Added: branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java (rev 0)
+++ branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java 2007-04-11 14:11:16 UTC (rev 2797)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.jbws429;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-429
+ *
+ * WSDL to Java, generation of custom holders.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 11 Apr 2007
+ */
+public class JBWS429TestCase extends WSToolsTest
+{
+
+ /**
+ * Test WSDL to Java with the output message containing 2
+ * parts, the parts are not listed in the paramaterOrder
+ * attribute so both should be parameters to the method on the
+ * SEI using holders and the return type should be void.
+ */
+ public void testGenerateOutUnlisted() throws Exception
+ {
+ generateScenario("OUT_unlisted");
+ }
+
+ protected void generateScenario(final String scenario) throws Exception
+ {
+ String resourceDir = "resources/tools/jbws429/" + scenario;
+ String toolsDir = "tools/jbws429/" + scenario;
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+ }
+}
Property changes on: branches/dlofthouse/JBWS-429/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl
===================================================================
--- branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl (rev 0)
+++ branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl 2007-04-11 14:11:16 UTC (rev 2797)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws429' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws429/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws429' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws429/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws429/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='firstName' nillable='true' type='string'/>
+ <element name='surname' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='areaCode' nillable='true' type='string'/>
+ <element name='number' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='Account'>
+ <sequence>
+ <element name='accountNo' nillable='false' type='string'/>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:Person' />
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ <element name='account' type='tns:Account'/>
+ </schema>
+ </types>
+
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ <part element='ns1:account' name='account'/>
+ </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>
Property changes on: branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/wstools-config.xml (rev 0)
+++ branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/wstools-config.xml 2007-04-11 14:11:16 UTC (rev 2797)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws429/OUT_unlisted/PhoneBook.wsdl" parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-429/jbossws-tests/src/resources/tools/jbws429/OUT_unlisted/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 1 month
JBossWS SVN: r2796 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 10:10:33 -0400 (Wed, 11 Apr 2007)
New Revision: 2796
Added:
branches/dlofthouse/JBWS-429/
Log:
Branch for JBWS-429
Copied: branches/dlofthouse/JBWS-429 (from rev 2795, trunk)
17 years, 1 month
JBossWS SVN: r2795 - trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 09:05:24 -0400 (Wed, 11 Apr 2007)
New Revision: 2795
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
Log:
Fix reference to GENERIC_PARAM_NAME
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-04-11 13:00:35 UTC (rev 2794)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-04-11 13:05:24 UTC (rev 2795)
@@ -29,7 +29,6 @@
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.ws.Provider;
import javax.xml.ws.ServiceMode;
@@ -38,10 +37,9 @@
import javax.xml.ws.Service.Mode;
import org.jboss.ws.Constants;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -128,7 +126,7 @@
// process binding type
processBindingType(sepMetaData, sepClass);
-
+
// process handler chain
processHandlerChain(sepMetaData, sepClass);
@@ -161,13 +159,13 @@
// Setup invoke param
Class paramType = Source.class;
- QName xmlName = SOAPContentElement.PROVIDER_PARAM_NAME;
+ QName xmlName = SOAPContentElement.GENERIC_PARAM_NAME;
QName xmlType = Constants.TYPE_LITERAL_ANYTYPE;
ParameterMetaData pmd = new ParameterMetaData(opMetaData, xmlName, xmlType, paramType.getName());
opMetaData.addParameter(pmd);
// Setup invoke return
- xmlName = SOAPContentElement.PROVIDER_RETURN_VALUE_NAME;
+ xmlName = SOAPContentElement.GENERIC_RETURN_NAME;
ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, paramType.getName());
opMetaData.setReturnParameter(retMetaData);
}
17 years, 1 month
JBossWS SVN: r2794 - in trunk/jbossws-core/src/java/org/jboss/ws/core: soap and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 09:00:35 -0400 (Wed, 11 Apr 2007)
New Revision: 2794
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DocumentBuilderFactoryImpl.java
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
Log:
Reuse generic soap content element name
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2007-04-11 12:39:55 UTC (rev 2793)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2007-04-11 13:00:35 UTC (rev 2794)
@@ -23,27 +23,35 @@
// $Id$
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.soap.*;
-import org.jboss.ws.core.utils.DOMWriter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.StringReader;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.soap.*;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.Service.Mode;
-import javax.xml.ws.WebServiceException;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.StringReader;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.soap.SOAPBodyElementDoc;
+import org.jboss.ws.core.soap.SOAPBodyImpl;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.utils.DOMWriter;
+
/**
* A helper that
*
@@ -57,14 +65,14 @@
private JAXBContext jaxbContext;
private Class type;
- private Mode mode;
-
+ private Mode mode;
+
public DispatchSOAPBinding(Mode mode, Class type, JAXBContext jaxbContext)
{
this.mode = mode;
this.type = type;
this.jaxbContext = jaxbContext;
- }
+ }
public MessageAbstraction getRequestMessage(Object obj)
{
@@ -83,18 +91,18 @@
{
reqMsg = (SOAPMessageImpl)factory.createMessage();
SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
- SOAPContentElement bodyElement = new SOAPBodyElementDoc(new QName("DispatchSOAPBodyElement"));
+ SOAPContentElement bodyElement = new SOAPBodyElementDoc(SOAPBodyElementDoc.GENERIC_PARAM_NAME);
bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);
XMLFragment xmlFragment = new XMLFragment(source);
bodyElement.setXMLFragment(xmlFragment);
// validate payload if necessary
- if(validateDispatch)
+ if (validateDispatch)
{
// expand to DOM will validate the contents
- xmlFragment.toElement();
+ xmlFragment.toElement();
}
-
+
}
if (mode == Mode.MESSAGE)
{
@@ -113,7 +121,7 @@
reqMsg = (SOAPMessageImpl)factory.createMessage();
SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
- SOAPContentElement bodyElement = new SOAPBodyElementDoc(new QName("DispatchSOAPBodyElement"));
+ SOAPContentElement bodyElement = new SOAPBodyElementDoc(SOAPBodyElementDoc.GENERIC_PARAM_NAME);
bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);
StreamSource source = new StreamSource(new ByteArrayInputStream(baos.toByteArray()));
bodyElement.setXMLFragment(new XMLFragment(source));
@@ -137,7 +145,7 @@
public Object getReturnObject(MessageAbstraction message)
{
SOAPMessage resMsg = (SOAPMessage)message;
-
+
Object retObj = null;
try
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-04-11 12:39:55 UTC (rev 2793)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-04-11 13:00:35 UTC (rev 2794)
@@ -74,6 +74,9 @@
// provide logging
private static Logger log = Logger.getLogger(SOAPContentElement.class);
+ public static final QName GENERIC_PARAM_NAME = new QName("genericParam");
+ public static final QName GENERIC_RETURN_NAME = new QName("genericReturn");
+
// The associated parameter
private ParameterMetaData paramMetaData;
@@ -83,9 +86,6 @@
// while transitioning DOM expansion needs to be locked
private boolean lockDOMExpansion = false;
- public static final QName PROVIDER_RETURN_VALUE_NAME = new QName("invokeReturn");
- public static final QName PROVIDER_PARAM_NAME = new QName("invokeParam");
-
/** Construct a SOAPContentElement
*/
public SOAPContentElement(Name name)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-11 12:39:55 UTC (rev 2793)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-11 13:00:35 UTC (rev 2794)
@@ -23,6 +23,21 @@
// $Id: $
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.transform.Source;
+
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -43,20 +58,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.transform.Source;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.List;
-
/**
* Represents the XML_VALID state of an {@link SOAPContentElement}.<br>
* Aggregates a {@link XMLFragment}.
@@ -98,7 +99,14 @@
}
else if (nextState == State.DOM_VALID)
{
- expandContainerChildren();
+ try
+ {
+ expandContainerChildren();
+ }
+ catch (SOAPException ex)
+ {
+ throw new WSException("Cannot expand container children", ex);
+ }
next = new DOMContent(container);
}
else
@@ -138,7 +146,7 @@
{
throw new IllegalStateException("Object value not available");
}
-
+
private Object unmarshallObjectContents()
{
@@ -282,7 +290,7 @@
* Turn the xml fragment into a DOM repersentation and append
* all children to the container.
*/
- private void expandContainerChildren()
+ private void expandContainerChildren() throws SOAPException
{
// Do nothing if the source of the XMLFragment is the container itself
Element domElement = xmlFragment.toElement();
@@ -292,78 +300,58 @@
String rootLocalName = domElement.getLocalName();
String rootPrefix = domElement.getPrefix();
String rootNS = domElement.getNamespaceURI();
- Name contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
+ NameImpl contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
// Make sure the content root element name matches this element name
Name name = container.getElementName();
QName qname = container.getElementQName();
- boolean artificalElement = (SOAPContentElement.PROVIDER_PARAM_NAME.equals(qname) || SOAPContentElement.PROVIDER_RETURN_VALUE_NAME.equals(qname));
-
- if ( !artificalElement && !contentRootName.equals(name) )
+ boolean artificalElement = (SOAPContentElement.GENERIC_PARAM_NAME.equals(qname) || SOAPContentElement.GENERIC_RETURN_NAME.equals(qname));
+
+ if (!artificalElement && !contentRootName.equals(name))
throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
// Remove all child nodes
container.removeContents();
-
- try
+ // In case of dispatch and provider we use artifical element names
+ // These need to be replaced (costly!)
+ if (artificalElement)
{
- // In some cases we are using artifical element names
- // These need to be replaced (costly!)
- if(artificalElement)
- {
- QName tmp = null;
- if (rootPrefix != null)
- tmp = new QName(rootNS, rootLocalName, rootPrefix);
- else
- tmp = new QName(rootNS, rootLocalName);
- container.setElementQNameInternal(tmp);
- }
+ QName xmlName = contentRootName.toQName();
+ container.setElementQNameInternal(xmlName);
}
- catch (SOAPException e)
- {
- WSException.rethrow(e);
- }
-
// Copy attributes
DOMUtils.copyAttributes(container, domElement);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
-
- try
+
+ NodeList nlist = domElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
{
- NodeList nlist = domElement.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == Node.ELEMENT_NODE)
- {
- SOAPElement soapElement = soapFactory.createElement((Element)child);
- container.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
- XOPContext.inlineXOPData(soapElement);
- }
- else if (childType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- container.addTextNode(nodeValue);
- }
- else if (childType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- container.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + childType);
- }
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
+ container.addChildElement(soapElement);
+ if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
+ XOPContext.inlineXOPData(soapElement);
}
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ container.addTextNode(nodeValue);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ container.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + childType);
+ }
}
- catch (SOAPException e)
- {
- throw new WSException("Failed to transition to DOM", e);
- }
}
}
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DocumentBuilderFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DocumentBuilderFactoryImpl.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DocumentBuilderFactoryImpl.java 2007-04-11 13:00:35 UTC (rev 2794)
@@ -0,0 +1,88 @@
+/*
+ * 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.core.utils;
+
+// $Id$
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A DocumentBuilderFactory that delegates to Xerces and is namespace aware by default.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 11-Apr-2007
+ */
+public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory
+{
+ private static Logger log = Logger.getLogger(DocumentBuilderFactoryImpl.class);
+
+ public static final String XERCES_DOCUMENT_BUILDER_FACTORY = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
+
+ private DocumentBuilderFactory delegate;
+
+ public DocumentBuilderFactoryImpl()
+ {
+ try
+ {
+ ClassLoader classLoader = getClass().getClassLoader();
+ Class clazz = classLoader.loadClass(XERCES_DOCUMENT_BUILDER_FACTORY);
+ delegate = (DocumentBuilderFactory)clazz.newInstance();
+
+ // namespace aware by default
+ delegate.setNamespaceAware(true);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot create delegate document builder factory: " + XERCES_DOCUMENT_BUILDER_FACTORY, ex);
+ }
+ }
+
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return delegate.getAttribute(name);
+ }
+
+ public boolean getFeature(String name) throws ParserConfigurationException
+ {
+ return delegate.getFeature(name);
+ }
+
+ public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
+ {
+ DocumentBuilder builder = delegate.newDocumentBuilder();
+ return builder;
+ }
+
+ public void setAttribute(String name, Object value) throws IllegalArgumentException
+ {
+ delegate.setAttribute(name, value);
+ }
+
+ public void setFeature(String name, boolean value) throws ParserConfigurationException
+ {
+ delegate.setFeature(name, value);
+ }
+}
Property changes on: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DocumentBuilderFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 1 month
JBossWS SVN: r2793 - trunk/jbossws-core/src/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 08:39:55 -0400 (Wed, 11 Apr 2007)
New Revision: 2793
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
Log:
Fix typo
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:35:47 UTC (rev 2792)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:39:55 UTC (rev 2793)
@@ -332,7 +332,7 @@
// The SAX ContentHandler will by default not add the namespace declaration
// <Hello xmlns='http://somens'>World</Hello>
- if (elPrefix == null && elNamespaceURI != null && !elNamespaceURI.equals(element.getAttribute("xmlns")))
+ if (elPrefix == null && elNamespaceURI != null && element.getAttribute("xmlns").length() == 0)
out.print(" xmlns='" + elNamespaceURI + "'");
if (hasChildNodes)
17 years, 1 month
JBossWS SVN: r2792 - trunk/jbossws-core/src/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 08:35:47 -0400 (Wed, 11 Apr 2007)
New Revision: 2792
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
Log:
Add javadoc
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:24:20 UTC (rev 2791)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:35:47 UTC (rev 2792)
@@ -328,13 +328,13 @@
out.print(" xmlns:" + prefix + "='" + nsURI + "'");
}
}
-
- if (elPrefix == null && elNamespaceURI != null && !elNamespaceURI.equals(element.getAttribute("xmlns")))
- {
- out.print(" xmlns='" + elNamespaceURI + "'");
- }
}
+ // The SAX ContentHandler will by default not add the namespace declaration
+ // <Hello xmlns='http://somens'>World</Hello>
+ if (elPrefix == null && elNamespaceURI != null && !elNamespaceURI.equals(element.getAttribute("xmlns")))
+ out.print(" xmlns='" + elNamespaceURI + "'");
+
if (hasChildNodes)
{
out.print('>');
17 years, 1 month
JBossWS SVN: r2791 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 08:24:20 -0400 (Wed, 11 Apr 2007)
New Revision: 2791
Modified:
trunk/integration-jboss40/.classpath
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamResult.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamSource.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
Log:
[JBWS-1605] DOMResult looses namespaces on transform
Modified: trunk/integration-jboss40/.classpath
===================================================================
--- trunk/integration-jboss40/.classpath 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/integration-jboss40/.classpath 2007-04-11 12:24:20 UTC (rev 2791)
@@ -26,7 +26,7 @@
<classpathentry kind="lib" path="/build/thirdparty/jboss-microcontainer.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/servlet-api.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/stax-api.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/xalan.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/xalan.jar" sourcepath="/usr/java/xalan-j_2_7_0/src"/>
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamResult.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamResult.java 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamResult.java 2007-04-11 12:24:20 UTC (rev 2791)
@@ -41,7 +41,7 @@
*/
public class BufferedStreamResult extends StreamResult
{
- ByteArrayOutputStream bout = new ByteArrayOutputStream(1024);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
public BufferedStreamResult()
{
@@ -68,7 +68,7 @@
@Override
public OutputStream getOutputStream()
{
- return bout;
+ return baos;
}
@Override
@@ -82,4 +82,9 @@
{
throw new UnsupportedOperationException();
}
+
+ public String toString()
+ {
+ return baos.toString();
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamSource.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamSource.java 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/BufferedStreamSource.java 2007-04-11 12:24:20 UTC (rev 2791)
@@ -107,4 +107,14 @@
{
throw new UnsupportedOperationException();
}
+
+ public String toString()
+ {
+ String retStr = null;
+ if (bytes != null)
+ retStr = new String(bytes);
+ else if (chars != null)
+ retStr = new String(chars);
+ return "" + retStr;
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-04-11 12:24:20 UTC (rev 2791)
@@ -176,46 +176,37 @@
Reader reader = streamSource.getReader();
{
- if (reader == null)
- reader = new InputStreamReader(streamSource.getInputStream());
+ if (reader == null)
+ reader = new InputStreamReader(streamSource.getInputStream());
}
- char[] cbuf = new char[5];
- int r = reader.read(cbuf);
- int xmlProc = -1;
+ char[] cbuf = new char[1024];
+ int len = reader.read(cbuf);
+ int off = 0;
- if (r == -1)
+ if (len == -1)
throw new IOException("StreamSource already exhausted");
- while (r > 0)
+ // Remove XML processing instruction
+ String xmlProc = new String(cbuf, 0, XML_PROC.length());
+ if (XML_PROC.equals(xmlProc))
{
- if(xmlProc<0 && new String(cbuf).equals(XML_PROC)) // new fragment
- {
- xmlProc = 0;
- }
- else if(xmlProc<0) // no processing instruction
- {
- xmlProc = 1;
- }
- else if(xmlProc==0) // within processing instruction
- {
- String tmp = new String(cbuf);
- int i = tmp.indexOf(">");
- if(i!=-1)
- {
- if(i<tmp.length()) writer.write(tmp.substring(i+1));
- xmlProc=1;
- r = reader.read(cbuf);
- continue;
- }
+ off = XML_PROC.length();
+ while (cbuf[off] != '>' && off < len)
+ off++;
- }
+ if (cbuf[off] != '>')
+ throw new IllegalStateException("Cannot find end of XML processing instruction");
- // regular contents
- if(xmlProc>0)
- writer.write(cbuf, 0, r);
- r = reader.read(cbuf);
+ off++;
}
+
+ while (len > 0)
+ {
+ writer.write(cbuf, off, len);
+ len = reader.read(cbuf);
+ off = 0;
+ }
}
else
{
@@ -232,10 +223,10 @@
private Source beginSourceAccess(Source source)
{
+ // no need to buffer those
+ if (source instanceof BufferedStreamSource || source instanceof DOMSource)
+ return source;
- if(source instanceof BufferedStreamSource)
- return source; // no need to buffer those
-
// Buffer the source content
if (source instanceof StreamSource)
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 12:24:20 UTC (rev 2791)
@@ -235,7 +235,7 @@
out.print("?>");
if (prettyprint)
out.println();
-
+
wroteXMLDeclaration = true;
}
@@ -275,6 +275,7 @@
Map nsMap = new HashMap();
String elPrefix = node.getPrefix();
+ String elNamespaceURI = node.getNamespaceURI();
if (elPrefix != null)
{
String nsURI = getNamespaceURI(elPrefix, element, rootNode);
@@ -294,7 +295,7 @@
String nsURI = getNamespaceURI(atPrefix, element, rootNode);
nsMap.put(atPrefix, nsURI);
// xsi:type='ns1:SubType', xsi:type='xsd:string'
- if (atName.equals(atPrefix + ":type") && atValue.indexOf(":") > 0)
+ if (atName.equals(atPrefix + ":type") && atValue.indexOf(":") > 0)
{
// xsi defined on the envelope
if (nsURI == null)
@@ -312,7 +313,8 @@
out.print(" " + atName + "='" + atValue + "'");
}
- // Add missing namespace declaration
+ // Add namespace declaration for prefixes
+ // that are defined further up the tree
if (completeNamespaces)
{
Iterator itPrefix = nsMap.keySet().iterator();
@@ -326,6 +328,11 @@
out.print(" xmlns:" + prefix + "='" + nsURI + "'");
}
}
+
+ if (elPrefix == null && elNamespaceURI != null && !elNamespaceURI.equals(element.getAttribute("xmlns")))
+ {
+ out.print(" xmlns='" + elNamespaceURI + "'");
+ }
}
if (hasChildNodes)
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-04-11 12:14:11 UTC (rev 2790)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-04-11 12:24:20 UTC (rev 2791)
@@ -25,8 +25,14 @@
import java.io.ByteArrayOutputStream;
import java.io.StringWriter;
+import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.core.utils.DOMUtils;
@@ -213,4 +219,44 @@
assertEquals(expStr, wasStr);
}
+
+ public void testElementNamespaceURIElementNS() throws Exception
+ {
+ String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+
+ Element root = DOMUtils.createElement(new QName("http://somens", "Hello"));
+ assertEquals("http://somens", root.getNamespaceURI());
+ root.setTextContent("World");
+
+ String xmlOut = DOMWriter.printNode(root, true);
+ assertEquals(xmlIn, xmlOut);
+ }
+
+ public void testElementNamespaceURIDocumentParse() throws Exception
+ {
+ String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+
+ Element root = DOMUtils.parse(xmlIn);
+ assertEquals("http://somens", root.getNamespaceURI());
+
+ String xmlOut = DOMWriter.printNode(root, true);
+ assertEquals(xmlIn, xmlOut);
+ }
+
+ public void testElementNamespaceURITransformer() throws Exception
+ {
+ String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+ StreamSource source = new StreamSource(new ByteArrayInputStream(xmlIn.getBytes()));
+
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ DOMResult result = new DOMResult();
+ transformer.transform(source, result);
+
+ Element root = ((Document)result.getNode()).getDocumentElement();
+ assertEquals("http://somens", root.getNamespaceURI());
+
+ String xmlOut = DOMWriter.printNode(root, true);
+ assertEquals(xmlIn, xmlOut);
+ }
}
17 years, 1 month
JBossWS SVN: r2790 - in trunk/jbossws-core/src/java/org/jboss/ws: core/soap and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-04-11 08:14:11 -0400 (Wed, 11 Apr 2007)
New Revision: 2790
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
Fix sloppy implementation
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -179,15 +179,13 @@
return resMessage;
}
- catch(SocketTimeoutException se)
- {
- if(timeout!=null)
- throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
- else
- throw new IOException(se.getMessage());
- }
catch (Throwable th)
- {
+ {
+ if(timeout!=null && (th.getCause() instanceof SocketTimeoutException))
+ {
+ throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
+ }
+
IOException io = new IOException("Could not transmit message");
io.initCause(th);
throw io;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -83,6 +83,9 @@
// while transitioning DOM expansion needs to be locked
private boolean lockDOMExpansion = false;
+ public static final QName PROVIDER_RETURN_VALUE_NAME = new QName("invokeReturn");
+ public static final QName PROVIDER_PARAM_NAME = new QName("invokeParam");
+
/** Construct a SOAPContentElement
*/
public SOAPContentElement(Name name)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -139,6 +139,11 @@
if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()) || Constants.NS_SOAP12_ENV.equals(getNamespaceURI()))
throw new SOAPException("Changing the name of this SOAP Element is not allowed: " + getLocalName());
+ return setElementQNameInternal(qname);
+ }
+
+ public SOAPElement setElementQNameInternal(QName qname) throws SOAPException
+ {
elementName = new NameImpl(qname);
Document owner = domNode.getOwnerDocument();
@@ -148,6 +153,7 @@
return this.completeNamespaceDeclaration();
}
+
/**
* Adds an attribute with the specified name and value to this SOAPElement object.
*
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -23,21 +23,6 @@
// $Id: $
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.transform.Source;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -58,6 +43,20 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.transform.Source;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.List;
+
/**
* Represents the XML_VALID state of an {@link SOAPContentElement}.<br>
* Aggregates a {@link XMLFragment}.
@@ -297,17 +296,41 @@
// Make sure the content root element name matches this element name
Name name = container.getElementName();
- if (!contentRootName.equals(name))
+ QName qname = container.getElementQName();
+ boolean artificalElement = (SOAPContentElement.PROVIDER_PARAM_NAME.equals(qname) || SOAPContentElement.PROVIDER_RETURN_VALUE_NAME.equals(qname));
+
+ if ( !artificalElement && !contentRootName.equals(name) )
throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
// Remove all child nodes
container.removeContents();
+
+ try
+ {
+ // In some cases we are using artifical element names
+ // These need to be replaced (costly!)
+ if(artificalElement)
+ {
+ QName tmp = null;
+ if (rootPrefix != null)
+ tmp = new QName(rootNS, rootLocalName, rootPrefix);
+ else
+ tmp = new QName(rootNS, rootLocalName);
+ container.setElementQNameInternal(tmp);
+ }
+ }
+ catch (SOAPException e)
+ {
+ WSException.rethrow(e);
+ }
+
+
// Copy attributes
DOMUtils.copyAttributes(container, domElement);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
-
+
try
{
NodeList nlist = domElement.getChildNodes();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -39,6 +39,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.utils.JavaUtils;
@@ -160,13 +161,13 @@
// Setup invoke param
Class paramType = Source.class;
- QName xmlName = new QName("invokeParam");
+ QName xmlName = SOAPContentElement.PROVIDER_PARAM_NAME;
QName xmlType = Constants.TYPE_LITERAL_ANYTYPE;
ParameterMetaData pmd = new ParameterMetaData(opMetaData, xmlName, xmlType, paramType.getName());
opMetaData.addParameter(pmd);
// Setup invoke return
- xmlName = new QName("invokeReturn");
+ xmlName = SOAPContentElement.PROVIDER_RETURN_VALUE_NAME;
ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, paramType.getName());
opMetaData.setReturnParameter(retMetaData);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-04-11 12:09:17 UTC (rev 2789)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-04-11 12:14:11 UTC (rev 2790)
@@ -39,7 +39,6 @@
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
import org.jboss.ws.core.jaxws.client.DispatchBinding;
-import org.jboss.ws.core.jaxws.client.DispatchSOAPBinding;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.config.*;
@@ -622,7 +621,7 @@
}
else if (configurable instanceof DispatchBinding)
{
- DispatchSOAPBinding dpb = (DispatchSOAPBinding)configurable;
+ DispatchBinding dpb = (DispatchBinding)configurable;
dpb.setValidateDispatch(config.hasFeature(EndpointFeature.VALIDATE_DISPATCH));
}
}
17 years, 1 month
JBossWS SVN: r2789 - in branches/dlofthouse/JBWS-1597/jbossws-tests/src: java/org/jboss/test/ws/tools/jbws1597 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 08:09:17 -0400 (Wed, 11 Apr 2007)
New Revision: 2789
Added:
branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/
branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/
branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/PhoneBook.wsdl
branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/wstools-config.xml
Log:
Initial test case.
Added: branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java (rev 0)
+++ branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java 2007-04-11 12:09:17 UTC (rev 2789)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.jbws1597;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1597
+ *
+ * WSDL to Java with a bound Soap header.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 11 Apr 2007
+ */
+public class JBWS1597TestCase extends WSToolsTest
+{
+
+ public void testGenerate() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1597";
+ String toolsDir = "tools/jbws1597";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1597/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/PhoneBook.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/PhoneBook.wsdl (rev 0)
+++ branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/PhoneBook.wsdl 2007-04-11 12:09:17 UTC (rev 2789)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1597' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1597/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1597' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1597/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1597/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='firstName' nillable='true' type='string'/>
+ <element name='surname' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='areaCode' nillable='true' type='string'/>
+ <element name='number' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='Account'>
+ <sequence>
+ <element name='accountNo' nillable='false' type='string'/>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:Person' />
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ <element name='account' type='tns:Account'/>
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ <part element='ns1:account' name='header'/>
+ </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'/>
+ <soap:header message='tns:PhoneBook_lookup' part='header' 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>
Property changes on: branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/wstools-config.xml (rev 0)
+++ branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/wstools-config.xml 2007-04-11 12:09:17 UTC (rev 2789)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1597/PhoneBook.wsdl" parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1597/jbossws-tests/src/resources/tools/jbws1597/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 1 month
JBossWS SVN: r2788 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 08:08:20 -0400 (Wed, 11 Apr 2007)
New Revision: 2788
Added:
branches/dlofthouse/JBWS-1597/
Log:
Branch for JBWS-1597
Copied: branches/dlofthouse/JBWS-1597 (from rev 2787, trunk)
17 years, 1 month