Author: mageshbk(a)jboss.com
Date: 2007-09-13 08:02:46 -0400 (Thu, 13 Sep 2007)
New Revision: 4559
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/resources/jboss-saaj.jar/META-INF/services/org.jboss.ws.core.soap.EnvelopeBuilder
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647TestBase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/MessageFactory.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPFactory.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/ant-import/build-jars-jaxrpc.xml
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/tests-jboss42-excludes.txt
Log:
[JBWS-1803] Port JBWS-1647 to 1.2.1 - Text Node Preservation For Messages Sent Across The
Wire
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/MessageFactory.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/MessageFactory.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/MessageFactory.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -81,7 +81,7 @@
if (factory == null)
{
SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
- factory = saajFactory.newMessageFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+ factory = saajFactory.newMessageFactory(SOAPConstants.DEFAULT_SOAP_PROTOCOL);
}
if (factory == null)
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -30,16 +30,16 @@
*/
public interface SOAPConstants
{
+ /** Used to create MessageFactory instances that create SOAPMessages whose behavior
supports the SOAP 1.1 specification */
+ String SOAP_1_1_PROTOCOL = "SOAP 1.1 Protocol";
+ /** The media type of the Content-Type MIME header in SOAP 1.2. */
+ String SOAP_1_2_CONTENT_TYPE = "application/soap+xml";
/** The default protocol: SOAP 1.1 for backwards compatibility. */
- String DEFAULT_SOAP_PROTOCOL = "SOAP 1.1 Protocol";
+ String DEFAULT_SOAP_PROTOCOL = SOAP_1_1_PROTOCOL;
/** Used to create MessageFactory instances that create SOAPMessages whose concrete
type is based on the Content-Type MIME header passed to the createMessage method. */
String DYNAMIC_SOAP_PROTOCOL = "Dynamic Protocol";
/** The media type of the Content-Type MIME header in SOAP 1.1. */
String SOAP_1_1_CONTENT_TYPE = "text/xml";
- /** Used to create MessageFactory instances that create SOAPMessages whose behavior
supports the SOAP 1.1 specification */
- String SOAP_1_1_PROTOCOL = "SOAP 1.1 Protocol";
- /** The media type of the Content-Type MIME header in SOAP 1.2. */
- String SOAP_1_2_CONTENT_TYPE = "application/soap+xml";
/** Used to create MessageFactory instances that create SOAPMessages whose behavior
supports the SOAP 1.2 specification */
String SOAP_1_2_PROTOCOL = "SOAP 1.2 Protocol";
/** The default namespace prefix for
http://www.w3.org/2003/05/soap-envelope */
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPFactory.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPFactory.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/javax/xml/soap/SOAPFactory.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -72,7 +72,7 @@
if (soapFactory == null)
{
SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
- soapFactory =
saajFactory.newSOAPFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+ soapFactory =
saajFactory.newSOAPFactory(SOAPConstants.DEFAULT_SOAP_PROTOCOL);
}
if (soapFactory == null)
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -34,6 +34,7 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
+import javax.xml.soap.Node;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
@@ -60,6 +61,7 @@
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPBodyElementDoc;
import org.jboss.ws.core.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
@@ -69,13 +71,13 @@
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Element;
@@ -133,7 +135,8 @@
protected abstract MessageAbstraction createMessage(OperationMetaData opMetaData)
throws SOAPException;
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
{
if (log.isDebugEnabled())
log.debug("bindRequestMessage: " + opMetaData.getQName());
@@ -224,10 +227,13 @@
xmlName = namespaceRegistry.registerQName(xmlName);
Name soapName = new NameImpl(xmlName.getLocalPart(),
xmlName.getPrefix(), xmlName.getNamespaceURI());
- if (log.isDebugEnabled())
- log.debug("Add unboundHeader element: " + soapName);
+ log.debug("Add unboundHeader element: " + soapName);
SOAPContentElement contentElement = new
SOAPHeaderElementImpl(soapName);
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
+
+ if (soapHeader == null)
+ soapHeader = soapEnvelope.addHeader();
+
soapHeader.addChildElement(contentElement);
contentElement.setObjectValue(value);
}
@@ -283,14 +289,25 @@
if (opMetaData.isMessageEndpoint() == false)
{
Style style = opMetaData.getStyle();
- SOAPElement soapBodyElement = soapBody;
+ SOAPElement payloadParent = soapBody;
if (style == Style.RPC)
{
- soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
- Name elName = soapBodyElement.getElementName();
-
- QName elQName = new QName(elName.getURI(), elName.getLocalName(),
elName.getPrefix());
- elQName = namespaceRegistry.registerQName(elQName);
+ payloadParent = null;
+ Iterator it = soapBody.getChildElements();
+ while (payloadParent == null && it.hasNext())
+ {
+ Object childNode = it.next();
+ if (childNode instanceof SOAPElement)
+ {
+ payloadParent = (SOAPElement)childNode;
+ }
+ }
+
+ if (payloadParent == null)
+ throw new SOAPException("Cannot find RPC element in");
+
+ QName elName = payloadParent.getElementQName();
+ elName = namespaceRegistry.registerQName(elName);
}
int numParameters = 0;
@@ -319,18 +336,27 @@
else
{
boolean isHeader = paramMetaData.isInHeader();
- SOAPElement element = isHeader ? soapHeader : soapBodyElement;
- if(!isHeader) numParameters++;
-
+ SOAPElement element = isHeader ? soapHeader : payloadParent;
+ if (!isHeader)
+ numParameters++;
+
SOAPContentElement value = getParameterFromMessage(paramMetaData,
element, false);
epInv.setRequestParamValue(xmlName, value);
}
}
}
- // TCK: verify the numer of parameters matches the actual message payload
- int numChildren = soapBodyElement.getChildNodes().getLength();
- if(numChildren!=numParameters) throw new WSException("Invalid number of
payload elements: " + numChildren);
+ // Verify the numer of parameters matches the actual message payload
+ int numChildElements = 0;
+ Iterator itElements = payloadParent.getChildElements();
+ while (itElements.hasNext())
+ {
+ Node node = (Node)itElements.next();
+ if (node instanceof SOAPElement)
+ numChildElements++;
+ }
+ if (numChildElements != numParameters)
+ throw new WSException("Invalid number of payload elements: " +
numChildElements);
}
// Generic message endpoint
@@ -519,19 +545,15 @@
msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
SOAPHeader soapHeader = soapEnvelope.getHeader();
- SOAPBody soapBody = soapEnvelope.getBody();
- Iterator bodyChildren = soapBody.getChildElements();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnvelope.getBody();
+ SOAPBodyElement soapBodyElement = soapBody.getBodyElement();
- SOAPBodyElement soapBodyElement = null;
- if (bodyChildren.hasNext() != false)
- soapBodyElement = (SOAPBodyElement)bodyChildren.next();
-
// Translate the SOAPFault to an exception and throw it
if (soapBodyElement instanceof SOAPFaultImpl)
throwFaultException((SOAPFaultImpl)soapBodyElement);
// Extract unbound OUT headers
- if (unboundHeaders != null)
+ if (unboundHeaders != null && soapHeader != null)
{
Map<QName, UnboundHeader> outHeaders = new HashMap<QName,
UnboundHeader>();
Iterator itHeaderElements = soapHeader.getChildElements();
@@ -790,44 +812,47 @@
Iterator childElements = soapElement.getChildElements();
while (childElements.hasNext())
{
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+ Object childNode = childElements.next();
+ if (childNode instanceof SOAPElement)
+ {
+ SOAPElementImpl childElement = (SOAPElementImpl)childNode;
+ // If this message was manipulated by a handler the child may not be a
content element
+ if (!(childElement instanceof SOAPContentElement))
+ childElement = (SOAPContentElement)soapElement.replaceChild(new
SOAPContentElement(childElement), childElement);
- // If this message was manipulated by a handler the child may not be a content
element
- if (!(childElement instanceof SOAPContentElement))
- childElement = (SOAPContentElement)soapElement.replaceChild(new
SOAPContentElement(childElement), childElement);
+ // The parameters are expected to be lazy
+ SOAPContentElement aux = (SOAPContentElement)childElement;
+ Name elName = aux.getElementName();
- // The parameters are expected to be lazy
- SOAPContentElement aux = (SOAPContentElement)childElement;
- Name elName = aux.getElementName();
+ if (xmlName.equals(elName))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
- if (xmlName.equals(elName))
- {
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- break;
- }
-
- if (SOAP_ARRAY_NAME.equals(elName))
- {
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
+ if (SOAP_ARRAY_NAME.equals(elName))
{
- QName compXMLName = paramMetaData.getXmlName();
- Element compElement = DOMUtils.getFirstChildElement(aux);
- // NPE when the soap encoded array size is 0 on the return path
- //
http://jira.jboss.org/jira/browse/JBWS-1285
- if (compElement == null ||
compElement.getNodeName().equals(compXMLName.getLocalPart()))
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ try
{
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- break;
+ QName compXMLName = paramMetaData.getXmlName();
+ Element compElement = DOMUtils.getFirstChildElement(aux);
+ // NPE when the soap encoded array size is 0 on the return path
+ //
http://jira.jboss.org/jira/browse/JBWS-1285
+ if (compElement == null ||
compElement.getNodeName().equals(compXMLName.getLocalPart()))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
}
+ finally
+ {
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ }
}
- finally
- {
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
}
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -239,78 +239,6 @@
}
/**
- * Narrow port selection tries to nail down available endpoints
- * by <port-component-ref> declarations. A selection base upon
- * Service.getPort(SEI) later on needs to be distinct to an endpoint, or in this case
EndpointMetaData.
- *
- * @param serviceRef
- * @param serviceMetaData
- */
- private void narrowPortSelection(UnifiedServiceRefMetaData serviceRef, ServiceMetaData
serviceMetaData)
- {
- Map<String, List<UnifiedPortComponentRefMetaData>> seiGroups = new
HashMap<String, List<UnifiedPortComponentRefMetaData>>();
- for(UnifiedPortComponentRefMetaData pcref : serviceRef.getPortComponentRefs())
- {
- String sei = pcref.getServiceEndpointInterface();
- if(null==seiGroups.get(sei))
- seiGroups.put(sei, new ArrayList<UnifiedPortComponentRefMetaData>());
- List<UnifiedPortComponentRefMetaData> group = seiGroups.get(sei);
- group.add(pcref);
-
- // Constraint#1: within a service-ref it's not allowed to use a SEI across
different pcref's
- if(group.size()>1)
- throw new WSException("Within a <service-ref> it's not allowed
to use a SEI across different <port-component-ref>'s: "+group);
- }
-
- // Constraint#2: A pcref may only match one EndpointMetaData
- for( String sei : seiGroups.keySet())
- {
- // Narrow available endpoints by port-component-ref declaration
- List<QName> narrowedEndpoints = new ArrayList<QName>();
-
- List<UnifiedPortComponentRefMetaData> group = seiGroups.get(sei);
- UnifiedPortComponentRefMetaData pcref = group.get(0); // distinct, see above
Constraint#1
-
- // Constraint#3: Port selection only applies when both SEI and QName are given
- if(pcref.getServiceEndpointInterface()!=null &&
pcref.getPortQName()!=null)
- {
- List<QName> pcRef2EndpointMapping = new ArrayList<QName>();
- for(EndpointMetaData epMeta : serviceMetaData.getEndpoints())
- {
-
if(pcref.getServiceEndpointInterface().equals(epMeta.getServiceEndpointInterfaceName()))
- {
- pcRef2EndpointMapping.add(epMeta.getPortName());
- }
-
- }
-
- for(QName q : pcRef2EndpointMapping)
- {
- EndpointMetaData mappedEndpoint = serviceMetaData.getEndpoint(q);
- if(! pcref.getPortQName().equals( mappedEndpoint.getPortName()) )
- narrowedEndpoints.add(q);
- }
-
- // Constraint: Dont exclude all of them ;)
- if(pcRef2EndpointMapping.size()>0 && (pcRef2EndpointMapping.size()
== narrowedEndpoints.size()))
- throw new WSException("Failed to narrow available endpoints by
<port-component-ref> declaration");
-
- for(QName q : narrowedEndpoints)
- {
- EndpointMetaData removed = serviceMetaData.removeEndpoint(q);
- log.debug("Narrowed endpoint " + q +
"("+removed+")");
- }
- }
- else
- {
- // TODO: In case there is more then one EMPD this should cause an exception
- log.warn("Unable to narrow port selection for "+ pcref);
- }
-
- }
- }
-
- /**
* Setup the handler chain(s) for this service
*/
private void setupHandlerChain(ServiceImpl jaxrpcService) throws Exception
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -23,10 +23,12 @@
// $Id$
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.ws.handler.Handler;
@@ -93,7 +95,8 @@
SOAPMessage reqMessage = (SOAPMessage)payload;
SOAPBodyImpl body = (SOAPBodyImpl)reqMessage.getSOAPBody();
- SOAPContentElement bodyElement = (SOAPContentElement)body.getFirstChild();
+
+ SOAPContentElement bodyElement = (SOAPContentElement)body.getBodyElement();
Source source = bodyElement.getXMLFragment().getSource();
if (source == null)
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -31,7 +31,6 @@
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
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;
@@ -157,8 +156,8 @@
{
if (mode == Mode.PAYLOAD)
{
- SOAPBody soapBody = resMsg.getSOAPBody();
- SOAPElement soapElement =
(SOAPElement)soapBody.getChildElements().next();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
+ SOAPElement soapElement = soapBody.getBodyElement();
retObj = new DOMSource(soapElement);
}
if (mode == Mode.MESSAGE)
@@ -171,7 +170,7 @@
else if (jaxbContext != null)
{
SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
- SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
+ SOAPElement soapElement = soapBody.getBodyElement();
log.debug("JAXB unmarshal: " + DOMWriter.printNode(soapElement,
false));
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -103,16 +103,9 @@
{
if (style == Style.RPC)
{
- try
- {
- EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
- Element domBodyElement = DOMUtils.sourceToElement(source);
- builder.buildBodyElementRpc(soapBody, domBodyElement);
- }
- catch (IOException ex)
- {
- WSException.rethrow(ex);
- }
+ EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
+ Element domBodyElement = DOMUtils.sourceToElement(source);
+ builder.buildBodyElementRpc(soapBody, domBodyElement);
}
else
{
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -27,6 +27,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.HashMap;
+import java.util.Iterator;
import javax.activation.DataHandler;
import javax.management.MBeanException;
@@ -344,9 +345,22 @@
{
String faultString;
SOAPBody soapBody = soapMessage.getSOAPBody();
- if (soapBody.getChildElements().hasNext())
+ Iterator bodyChildren = soapBody.getChildElements();
+ SOAPBodyElement soapBodyElement = null;
+
+ while (bodyChildren.hasNext() && soapBodyElement == null)
+
{
- SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+
+ Object next = bodyChildren.next();
+ if (next instanceof SOAPBodyElement)
+ {
+ soapBodyElement = (SOAPBodyElement)next;
+ }
+ }
+
+ if (soapBodyElement != null)
+ {
Name soapName = soapBodyElement.getElementName();
faultString = "Endpoint " + epMetaData.getPortName() + "
does not contain operation meta data for: " + soapName;
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -29,7 +29,11 @@
import java.util.Iterator;
import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -42,7 +46,10 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@@ -58,10 +65,12 @@
// provide logging
private static Logger log = Logger.getLogger(EnvelopeBuilderDOM.class);
- private Style style = Style.DOCUMENT;
+ private SOAPFactoryImpl soapFactory;
+ private Style style;
public EnvelopeBuilderDOM(Style style)
{
+ this.soapFactory = new SOAPFactoryImpl();
this.style = style;
}
@@ -107,29 +116,58 @@
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws
SOAPException
{
- String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
-
// Construct the envelope
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart,
soapFactory.createElement(domEnv, false));
+ SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart,
soapFactory.createElement(domEnv, false), false);
DOMUtils.copyAttributes(soapEnv, domEnv);
- // Add the header elements
- Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Header"));
- if (domHeader != null)
+ NodeList envChildNodes = domEnv.getChildNodes();
+ for (int i = 0; i < envChildNodes.getLength(); i++)
{
- SOAPHeader soapHeader = soapEnv.getHeader();
+ Node child = envChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ String elName = child.getLocalName();
+ if ("Header".equals(elName))
+ {
+ buildSOAPHeader(soapEnv, (Element)child);
+ }
+ else if ("Body".equals(elName))
+ {
+ buildSOAPBody(soapEnv, (Element)child);
+ }
+ else
+ {
+ log.warn("Ignore envelope chile element: " + elName);
+ }
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- DOMUtils.copyAttributes(soapHeader, domHeader);
+ return soapEnv;
+ }
- Iterator it = DOMUtils.getChildElements(domHeader);
- while (it.hasNext())
+ private SOAPHeader buildSOAPHeader(SOAPEnvelopeImpl soapEnv, Element domHeader) throws
SOAPException
+ {
+ SOAPHeader soapHeader = soapEnv.getHeader();
+ if (soapHeader == null)
+ soapHeader = soapEnv.addHeader();
+
+ DOMUtils.copyAttributes(soapHeader, domHeader);
+
+ NodeList headerChildNodes = domHeader.getChildNodes();
+ for (int i = 0; i < headerChildNodes.getLength(); i++)
+ {
+ Node child = headerChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- Element srcElement = (Element)it.next();
- //registerNamespacesLocally(srcElement);
+ Element srcElement = (Element)child;
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
@@ -139,99 +177,59 @@
DOMUtils.copyAttributes(destElement, srcElement);
destElement.setXMLFragment(xmlFragment);
}
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
- // Add the body elements
- Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Body"));
+ return soapHeader;
+ }
+
+ private SOAPBody buildSOAPBody(SOAPEnvelopeImpl soapEnv, Element domBody) throws
SOAPException
+ {
+ String envNS = soapEnv.getNamespaceURI();
+
SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ if (soapBody == null)
+ soapBody = (SOAPBodyImpl)soapEnv.addBody();
DOMUtils.copyAttributes(soapBody, domBody);
- Iterator itBody = DOMUtils.getChildElements(domBody);
- if (itBody.hasNext())
+ SOAPBodyElement soapBodyElement = null;
+ boolean attachHRefElements =
Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS,
"encodingStyle"));
+
+ NodeList bodyChildNodes = domBody.getChildNodes();
+ for (int i = 0; i < bodyChildNodes.getLength(); i++)
{
- Element domBodyElement = (Element)itBody.next();
-
- String localName = domBodyElement.getLocalName();
- String prefix = domBodyElement.getPrefix();
- String nsURI = domBodyElement.getNamespaceURI();
- Name beName = new NameImpl(localName, prefix, nsURI);
-
- // Process a <env:Fault> message
- if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
+ Node child = bodyChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
- soapBody.addChildElement(soapFault);
-
- DOMUtils.copyAttributes(soapFault, domBodyElement);
-
- // copy everything and let soapFault discover child elements itself
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
- soapFault.setXMLFragment(xmlFragment);
- }
-
- // Process and RPC or DOCUMENT style message
- else
- {
-
- if (style == Style.RPC)
+ if (soapBodyElement == null)
{
- buildBodyElementRpc(soapBody, domBodyElement);
+ soapBodyElement = buildSOAPBodyElement(soapEnv, (Element)child);
+ attachHRefElements = attachHRefElements ||
Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS,
"encodingStyle"));
}
- else if (style == Style.DOCUMENT)
+ else if (attachHRefElements)
{
- buildBodyElementDoc(soapBody, domBodyElement);
+ // Process additional soap encoded body elements
+ soapBody.addChildElement(soapFactory.createElement((Element)child,
true));
}
- else if (style == null)
- {
- SOAPBodyElementMessage soapBodyElement = new
SOAPBodyElementMessage(beName);
- soapBodyElement =
(SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
-
- DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
-
- NodeList nlist = domBodyElement.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- org.w3c.dom.Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == org.w3c.dom.Node.ELEMENT_NODE)
- {
- SOAPElement soapElement =
soapFactory.createElement((Element)child);
- soapBodyElement.addChildElement(soapElement);
- }
- else if (childType == org.w3c.dom.Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else if (childType == org.w3c.dom.Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else
- {
- log.warn("Ignore child type: " + childType);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ appendCommentNode(soapBody, child);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ appendTextNode(soapBody, child);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
-
- // Process additional soap encoded body elements
- boolean attachHRefElements =
Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS,
"encodingStyle"));
- attachHRefElements = attachHRefElements ||
Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS,
"encodingStyle"));
- attachHRefElements = attachHRefElements && itBody.hasNext();
- while (attachHRefElements && itBody.hasNext())
- {
- Element srcElement = (Element)itBody.next();
- soapBody.addChildElement(soapFactory.createElement(srcElement, true));
- }
-
// Inline all attached href elements
if (attachHRefElements)
{
@@ -239,48 +237,166 @@
inlineHandler.processHRefs();
}
- return soapEnv;
+ return soapBody;
}
- public void buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws
SOAPException
+ private SOAPBodyElement buildSOAPBodyElement(SOAPEnvelopeImpl soapEnv, Element
domBodyElement) throws SOAPException
{
- soapBody.removeContents();
+ String envNS = soapEnv.getNamespaceURI();
+ String envPrefix = soapEnv.getPrefix();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+
+ SOAPBodyElement soapBodyElement = null;
+
+ // Process a <env:Fault> message
+ if (beName.equals(new QName(envNS, "Fault")))
+ {
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
+ soapBody.addChildElement(soapFault);
+ soapBodyElement = soapFault;
+
+ DOMUtils.copyAttributes(soapFault, domBodyElement);
+
+ // copy everything and let soapFault discover child elements itself
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
+ soapFault.setXMLFragment(xmlFragment);
+ }
+
+ // Process and RPC or DOCUMENT style message
+ else
+ {
+ if (style == Style.DOCUMENT)
+ {
+ buildBodyElementDoc(soapBody, domBodyElement);
+ }
+ else if (style == Style.RPC)
+ {
+ soapBodyElement = buildBodyElementRpc(soapBody, domBodyElement);
+ }
+ else if (style == null)
+ {
+ buildBodyElementDefault(soapBody, domBodyElement);
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+
+ return soapBodyElement;
+ }
+
+ public SOAPBodyElement buildBodyElementDoc(SOAPBodyImpl soapBody, Element
domBodyElement) throws SOAPException
+ {
Element srcElement = (Element)domBodyElement;
QName beName = DOMUtils.getElementQName(domBodyElement);
- SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
- destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
+ SOAPBodyElementDoc soapBodyElement = new SOAPBodyElementDoc(beName);
+ SOAPContentElement contentElement =
(SOAPContentElement)soapBody.addChildElement(soapBodyElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ DOMUtils.copyAttributes(contentElement, srcElement);
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ contentElement.setXMLFragment(xmlFragment);
+
+ return soapBodyElement;
}
- public void buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws
SOAPException
+ public SOAPBodyElement buildBodyElementRpc(SOAPBodyImpl soapBody, Element
domBodyElement) throws SOAPException
{
- soapBody.removeContents();
-
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
soapBodyElement = (SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
- Iterator itBodyElement = DOMUtils.getChildElements(domBodyElement);
- while (itBodyElement.hasNext())
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
{
- Element srcElement = (Element)itBodyElement.next();
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ Element srcElement = (Element)child;
+ Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
+ SOAPContentElement destElement = new SOAPContentElement(name);
+ destElement =
(SOAPContentElement)soapBodyElement.addChildElement(destElement);
- Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPContentElement(name);
- destElement = (SOAPContentElement)soapBodyElement.addChildElement(destElement);
+ DOMUtils.copyAttributes(destElement, srcElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
+ destElement.setXMLFragment(xmlFragment);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ appendCommentNode(soapBodyElement, child);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ appendTextNode(soapBodyElement, child);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ return soapBodyElement;
+ }
+
+ public SOAPBodyElement buildBodyElementDefault(SOAPBodyImpl soapBody, Element
domBodyElement) throws SOAPException
+ {
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementMessage(beName);
+ soapBodyElement =
(SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
+
+ DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
+
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
+ soapBodyElement.addChildElement(soapElement);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ appendCommentNode(soapBodyElement, child);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ appendTextNode(soapBodyElement, child);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
+
+ return soapBodyElement;
}
+
+ private void appendCommentNode(SOAPElement soapElement, Node child)
+ {
+ String nodeValue = child.getNodeValue();
+ Document ownerDoc = soapElement.getOwnerDocument();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapElement.appendChild(comment);
+ }
+
+ private void appendTextNode(SOAPElement soapElement, Node child) throws SOAPException
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -26,10 +26,12 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.Reader;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
@@ -40,6 +42,8 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.stream.StreamSource;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.jaxrpc.Style;
import org.w3c.dom.Element;
import com.ctc.wstx.stax.WstxInputFactory;
@@ -256,7 +260,7 @@
if (Part.ENVELOPE == currentPart)
{
// setup envelope impl
- soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI());
+ soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI(), false);
destElement = soapEnv; // soapEnv becomes current
}
else if (Part.HEADER == currentPart)
@@ -469,4 +473,34 @@
return builder.toString();
}
+
+ public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean
ignoreParseError) throws IOException, SOAPException
+ {
+ throw new NotImplementedException();
+ }
+
+ public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws
SOAPException
+ {
+ throw new NotImplementedException();
+ }
+
+ public SOAPBodyElement buildBodyElementDoc(SOAPBodyImpl soapBody, Element
domBodyElement) throws SOAPException
+ {
+ throw new NotImplementedException();
+ }
+
+ public SOAPBodyElement buildBodyElementRpc(SOAPBodyImpl soapBody, Element
domBodyElement) throws SOAPException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Style getStyle()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void setStyle(Style style)
+ {
+ throw new NotImplementedException();
+ }
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -26,7 +26,6 @@
import java.util.Iterator;
import javax.xml.soap.Node;
-import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
@@ -51,9 +50,9 @@
private static Logger log = Logger.getLogger(HRefInlineHandler.class);
private SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- private SOAPBody soapBody;
+ private SOAPBodyImpl soapBody;
- public HRefInlineHandler(SOAPBody soapBody)
+ public HRefInlineHandler(SOAPBodyImpl soapBody)
{
this.soapBody = soapBody;
}
@@ -63,16 +62,21 @@
String bodyStr = DOMWriter.printNode(soapBody, true);
log.debug("Begin processHRefs:\n" + bodyStr);
- SOAPBodyElement bodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
- processElement(bodyElement);
+ SOAPBodyElement soapBodyElement = soapBody.getBodyElement();
+ processElement(soapBodyElement);
+ // Process elements after SOAPBodyElement
Iterator it = soapBody.getChildElements();
while (it.hasNext())
{
- // Remove id elements
- SOAPElement soapElement = (SOAPElement)it.next();
- if ((soapElement instanceof SOAPBodyElement) == false)
- soapBody.removeChild(soapElement);
+ Object next = it.next();
+ if (next instanceof SOAPElement)
+ {
+ // Remove id elements
+ SOAPElement soapElement = (SOAPElement)next;
+ if ((soapElement instanceof SOAPBodyElement) == false)
+ soapBody.removeChild(soapElement);
+ }
}
bodyStr = DOMWriter.printNode(soapBody, true);
@@ -105,11 +109,15 @@
Iterator it = soapBody.getChildElements();
while (it.hasNext())
{
- SOAPElement auxElement = (SOAPElement)it.next();
- if (href.equals("#" + auxElement.getAttribute("id")))
+ Object next = it.next();
+ if (next instanceof SOAPElement)
{
- idElement = (SOAPElement)auxElement;
- break;
+ SOAPElement auxElement = (SOAPElement)next;
+ if (href.equals("#" + auxElement.getAttribute("id")))
+ {
+ idElement = (SOAPElement)auxElement;
+ break;
+ }
}
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -154,7 +154,7 @@
SOAPMessageImpl soapMessage = new SOAPMessageImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- new SOAPEnvelopeImpl(soapPart, envNamespace);
+ new SOAPEnvelopeImpl(soapPart, envNamespace, true);
return soapMessage;
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -552,6 +552,21 @@
{
retNode = new TextImpl(node);
}
+ else if (node instanceof org.w3c.dom.Comment)
+ {
+ retNode = new TextImpl(node);
+ }
+ else if (node instanceof org.w3c.dom.Element)
+ {
+ try
+ {
+ retNode = new SOAPFactoryImpl().createElement((Element)node);
+ }
+ catch (SOAPException ex)
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "CAnnot convert
to SOAP element: " + node);
+ }
+ }
else
{
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Operation not
supported on this type of node: " + node);
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -25,6 +25,7 @@
import javax.xml.rpc.JAXRPCException;
import javax.xml.soap.Name;
+import javax.xml.namespace.QName;
import javax.xml.soap.SOAPBodyElement;
import org.jboss.ws.core.utils.DOMWriter;
@@ -39,7 +40,8 @@
*/
public class SOAPBodyElementMessage extends SOAPElementImpl implements SOAPBodyElement
{
- public SOAPBodyElementMessage(Name name)
+
+ public SOAPBodyElementMessage(QName name)
{
super(name);
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -38,6 +38,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -181,6 +182,19 @@
return getChildElements(new QName(getNamespaceURI(), "Fault"));
}
+ public SOAPBodyElement getBodyElement()
+ {
+ SOAPBodyElement bodyElement = null;
+ Iterator it = getChildElements();
+ while (bodyElement == null && it.hasNext())
+ {
+ Object next = it.next();
+ if (next instanceof SOAPBodyElement)
+ bodyElement = (SOAPBodyElement)next;
+ }
+ return bodyElement;
+ }
+
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
@@ -254,10 +268,14 @@
return newDocument;
}
- private static boolean needsConversionToBodyElement(Node node)
+ private static boolean needsConversionToBodyElement(Node newChild)
{
// JBCTS-440 #addTextNodeTest1 appends a Text node to a SOAPBody
- return !(node instanceof SOAPBodyElement || node instanceof DocumentFragment ||
node instanceof Text);
+ boolean validChild = newChild instanceof SOAPBodyElement;
+ validChild = validChild || newChild instanceof DocumentFragment;
+ validChild = validChild || newChild instanceof Text;
+ validChild = validChild || newChild instanceof Comment;
+ return validChild == false;
}
private static SOAPBodyElementDoc convertToBodyElement(Node node)
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -465,9 +465,7 @@
}
else if (node instanceof Text)
{
- String value = node.getNodeValue();
- if (value.trim().length() > 0)
- list.add(node);
+ list.add(node);
}
}
return list.iterator();
@@ -835,7 +833,7 @@
}
else if (node instanceof TextImpl)
{
- out.write(node.getValue());
+ ((TextImpl)node).writeNode(out);
}
else
{
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -54,7 +54,7 @@
/** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
*/
- public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element) throws
SOAPException
+ public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element, boolean
addHeaderAndBody) throws SOAPException
{
super((SOAPElementImpl)element);
@@ -71,16 +71,16 @@
assertEnvelopeNamespace(namespaceURI);
addNamespaceDeclaration(prefix, namespaceURI);
- // the Element source might already contain a Header and Body declaration
- if (null == soapPart.getEnvelope().getHeader())
+ if (addHeaderAndBody)
+ {
addHeader();
- if (null == soapPart.getEnvelope().getBody())
addBody();
+ }
}
/** Construct a SOAP envelope for the given SOAP version URI.
*/
- SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace) throws SOAPException
+ SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace, boolean addHeaderAndBody)
throws SOAPException
{
super("Envelope", Constants.PREFIX_ENV, namespace);
@@ -90,8 +90,11 @@
assertEnvelopeNamespace(namespace);
addNamespaceDeclaration(getPrefix(), namespace);
- addHeader();
- addBody();
+ if (addHeaderAndBody)
+ {
+ addHeader();
+ addBody();
+ }
}
public SOAPMessage getSOAPMessage()
@@ -156,7 +159,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Body"))
+ if ("Body".equals(node.getLocalName()))
return (SOAPBody)node;
}
return null;
@@ -168,7 +171,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Header"))
+ if ("Header".equals(node.getLocalName()))
return (SOAPHeader)node;
}
return null;
@@ -179,7 +182,10 @@
*/
public SOAPElement addTextNode(String value) throws SOAPException
{
- throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+ if (value.trim().length() > 0)
+ throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+
+ return super.addTextNode(value);
}
public Document getOwnerDocument()
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -110,7 +110,8 @@
if (domElement == null)
throw new IllegalArgumentException("Source node cannot be null");
- if (domElement instanceof SOAPElement)
+ // Can only use this optimization if we are doing a deep copy.
+ if (domElement instanceof SOAPElement && deep==true)
return (SOAPElement)domElement;
String localName = domElement.getLocalName();
@@ -159,8 +160,7 @@
@Override
public Detail createDetail() throws SOAPException
{
- if (envNamespace == null)
- throw new UnsupportedOperationException("the specified protocol was
DYNAMIC_SOAP_PROTOCOL");
+ assertEnvNamespace();
return SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(envNamespace) ? new
DetailImpl() :
new DetailImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
@@ -181,8 +181,7 @@
@Override
public SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException
{
- if (envNamespace == null)
- throw new UnsupportedOperationException("the specified protocol was
DYNAMIC_SOAP_PROTOCOL");
+ assertEnvNamespace();
SOAPFaultImpl soapFault = new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX,
envNamespace);
soapFault.setFaultCode(faultCode);
@@ -193,11 +192,16 @@
@Override
public SOAPFault createFault() throws SOAPException
{
- if (envNamespace == null)
- throw new UnsupportedOperationException("the specified protocol was
DYNAMIC_SOAP_PROTOCOL");
+ assertEnvNamespace();
SOAPFaultImpl soapFault = new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX,
envNamespace);
soapFault.setFaultCode(soapFault.getDefaultFaultCode());
return soapFault;
}
+
+ private void assertEnvNamespace()
+ {
+ if (envNamespace == null)
+ throw new UnsupportedOperationException("Envelope namespace not specified,
use one of the SOAP protocols");
+ }
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -68,7 +68,7 @@
if (wsaAction.equals(opAux.getSOAPAction()))
{
opMetaData = opAux;
- if(log.isDebugEnabled()) log.debug("Use wsa:Action dispatch: " +
wsaAction);
+ log.debug("Use wsa:Action dispatch: " + wsaAction);
break;
}
}
@@ -86,9 +86,19 @@
{
SOAPBody soapBody = soapMessage.getSOAPBody();
+ SOAPBodyElement soapBodyElement = null;
Iterator bodyChildren = soapBody.getChildElements();
- if (bodyChildren.hasNext() == false)
+ while (bodyChildren.hasNext() && soapBodyElement == null)
{
+ Object childNode = bodyChildren.next();
+ if (childNode instanceof SOAPBodyElement)
+ {
+ soapBodyElement = (SOAPBodyElement)childNode;
+ }
+ }
+
+ if (soapBodyElement == null)
+ {
if (epMetaData.getStyle() == Style.RPC)
throw new SOAPException("Empty SOAP body with no child element not
supported for RPC");
@@ -97,7 +107,7 @@
{
if (opAux.getParameters().size() == 0)
{
- if(log.isDebugEnabled()) log.debug ("Dispatching empty SOAP
body");
+ log.debug ("Dispatching empty SOAP body");
opMetaData = opAux;
break;
}
@@ -105,7 +115,6 @@
}
else
{
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)bodyChildren.next();
Name soapName = soapBodyElement.getElementName();
QName xmlElementName = new QName(soapName.getURI(),
soapName.getLocalName());
opMetaData = epMetaData.getOperation(xmlElementName);
@@ -119,14 +128,14 @@
{
if (opAux.isMessageEndpoint())
{
- if(log.isDebugEnabled()) log.debug("Use generic message style
dispatch");
+ log.debug("Use generic message style dispatch");
opMetaData = opAux;
break;
}
}
}
- if(log.isDebugEnabled()) log.debug("getDispatchDestination: " +
(opMetaData != null ? opMetaData.getQName() : null));
+ log.debug("getDispatchDestination: " + (opMetaData != null ?
opMetaData.getQName() : null));
return opMetaData;
}
}
\ No newline at end of file
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.core.soap;
+import java.io.IOException;
+import java.io.Writer;
+
import org.w3c.dom.DOMException;
import org.w3c.dom.Text;
@@ -42,8 +45,7 @@
*/
public boolean isComment()
{
- String value = getNodeValue().trim();
- return value.startsWith("<!--") &&
value.endsWith("-->");
+ return domNode.getNodeType() == org.w3c.dom.Node.COMMENT_NODE;
}
public String getValue()
@@ -56,6 +58,15 @@
setNodeValue(value);
}
+ public void writeNode(Writer out) throws IOException
+ {
+ String nodeValue = getNodeValue();
+ if (isComment() && !nodeValue.startsWith("<!--"))
+ out.write("<!--" + nodeValue + "-->");
+ else
+ out.write(nodeValue);
+ }
+
/**
* Breaks this node into two nodes at the specified <code>offset</code>,
keeping both in the tree as siblings.
* <p/>
@@ -323,5 +334,4 @@
{
return null;
}
-
}
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -54,6 +54,8 @@
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -297,18 +299,13 @@
if (domElement == container)
return;
- String rootLocalName = domElement.getLocalName();
- String rootPrefix = domElement.getPrefix();
- String rootNS = domElement.getNamespaceURI();
- 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();
+ QName contentRootName = DOMUtils.getElementQName(domElement);
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);
+ if (!artificalElement && !contentRootName.equals(qname))
+ throw new WSException("Content root name does not match element name:
" + contentRootName + " != " + qname);
// Remove all child nodes
container.removeContents();
@@ -317,11 +314,10 @@
// These need to be replaced (costly!)
if (artificalElement)
{
- QName xmlName = contentRootName.toQName();
- container.setElementQNameInternal(xmlName);
+ container.setElementQNameInternal(contentRootName);
}
- // Copy attributes
+ Document ownerDoc = container.getOwnerDocument();
DOMUtils.copyAttributes(container, domElement);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
@@ -335,7 +331,7 @@
{
SOAPElement soapElement = soapFactory.createElement((Element)child);
container.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
+ if (Constants.NAME_XOP_INCLUDE.equals(qname) || container.isXOPParameter())
XOPContext.inlineXOPData(soapElement);
}
else if (childType == Node.TEXT_NODE)
@@ -343,6 +339,12 @@
String nodeValue = child.getNodeValue();
container.addTextNode(nodeValue);
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ container.appendChild(comment);
+ }
else if (childType == Node.CDATA_SECTION_NODE)
{
String nodeValue = child.getNodeValue();
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -130,16 +130,11 @@
public Element toElement()
{
Element retElement = null;
- try
- {
- source = beginSourceAccess(source);
- retElement = DOMUtils.sourceToElement(source);
- endSourceAccess();
- }
- catch (IOException ex)
- {
- handleSourceAccessException(ex);
- }
+
+ source = beginSourceAccess(source);
+ retElement = DOMUtils.sourceToElement(source);
+ endSourceAccess();
+
return retElement;
}
@@ -235,15 +230,8 @@
}
else
{
- try
- {
- Element element = DOMUtils.sourceToElement(source);
- source = new DOMSource(element);
- }
- catch (IOException ex)
- {
- WSException.rethrow(ex);
- }
+ Element element = DOMUtils.sourceToElement(source);
+ source = new DOMSource(element);
}
return source;
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -37,15 +37,12 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -72,8 +69,7 @@
// All elements created by the same thread are created by the same builder and belong
to the same doc
private static ThreadLocal documentThreadLocal = new ThreadLocal();
private static ThreadLocal builderThreadLocal = new ThreadLocal() {
- protected Object initialValue()
- {
+ protected Object initialValue() {
try
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
@@ -208,7 +204,7 @@
return resolveQName(el, qualifiedName);
}
- /** Transform the given qualified name into a QName
+ /** Transform the giveen qualified name into a QName
*/
public static QName resolveQName(Element el, String qualifiedName)
{
@@ -251,7 +247,7 @@
nsElement = getParentElement(nsElement);
}
}
-
+
qname = new QName(namespaceURI, localPart, prefix);
return qname;
}
@@ -526,12 +522,11 @@
return doc;
}
- public static Element sourceToElement(Source source) throws IOException
+ public static Element sourceToElement(Source source)
{
- Element retElement = null;
+ Element elementResult = null;
- try
- {
+ try {
if (source instanceof StreamSource)
{
StreamSource streamSource = (StreamSource)source;
@@ -539,13 +534,17 @@
InputStream ins = streamSource.getInputStream();
if (ins != null)
{
- retElement = DOMUtils.parse(ins);
+ elementResult = DOMUtils.parse(ins);
}
else
{
Reader reader = streamSource.getReader();
- retElement = DOMUtils.parse(new InputSource(reader));
+ elementResult = DOMUtils.parse(new InputSource(reader));
}
+
+ // reset the excausted input stream
+ String xmlStr = DOMWriter.printNode(elementResult, false);
+ source = new StreamSource(new ByteArrayInputStream(xmlStr.getBytes()));
}
else if (source instanceof DOMSource)
{
@@ -553,11 +552,11 @@
Node node = domSource.getNode();
if (node instanceof Element)
{
- retElement = (Element)node;
+ elementResult = (Element)node;
}
else if (node instanceof Document)
{
- retElement = ((Document)node).getDocumentElement();
+ elementResult = ((Document)node).getDocumentElement();
}
else
{
@@ -572,11 +571,9 @@
TransformerFactory tf = TransformerFactory.newInstance();
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- Transformer transformer = tf.newTransformer();
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
"yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.transform(source, new StreamResult(baos));
- retElement = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
+ tf.newTransformer().transform(source, new StreamResult(baos));
+
+ elementResult = DOMUtils.parse(new
ByteArrayInputStream(baos.toByteArray()));
}
else
{
@@ -584,13 +581,11 @@
}
}
- catch (TransformerException ex)
+ catch (Exception e)
{
- IOException ioex = new IOException();
- ioex.initCause(ex);
- throw ioex;
+ WSException.rethrow(e);
}
- return retElement;
+ return elementResult;
}
}
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/resources/jboss-saaj.jar/META-INF/services/org.jboss.ws.core.soap.EnvelopeBuilder
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/resources/jboss-saaj.jar/META-INF/services/org.jboss.ws.core.soap.EnvelopeBuilder
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-core/src/resources/jboss-saaj.jar/META-INF/services/org.jboss.ws.core.soap.EnvelopeBuilder 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1 @@
+org.jboss.ws.core.soap.EnvelopeBuilderDOM
\ No newline at end of file
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -2452,7 +2452,41 @@
<include name="wsdl/**"/>
</metainf>
</jar>
-
+
+ <!-- jbossws-jbws1647 RPC/Literal -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1647-rpclit.war"
+
webxml="${tests.output.dir}/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/resources/jaxrpc/jbws1647/rpclit/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
+ <!-- jbossws-jbws1647 Document/Literal -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1647-doclit.war"
+
webxml="${tests.output.dir}/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.class"/>
+ <include
name="org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/resources/jaxrpc/jbws1647/doclit/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
<!-- jaxrpc-marshall-doclit.war -->
<war warfile="${tests.output.dir}/libs/jaxrpc-marshall-doclit.war"
webxml="${tests.output.dir}/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -25,18 +25,25 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Iterator;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.Text;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
@@ -77,7 +84,10 @@
assertEquals("env:Envelope", env.getNodeName());
assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
- SOAPBodyElement soapBodyElement =
(SOAPBodyElement)env.getBody().getChildElements().next();
+ Iterator it = env.getBody().getChildElements();
+ Text text = (Text)it.next();
+ assertEquals(" ", text.getValue());
+ SOAPBodyElement soapBodyElement = (SOAPBodyElement)it.next();
assertEquals("urn:uddi-org:api_v2", soapBodyElement.getNamespaceURI());
}
@@ -123,7 +133,7 @@
assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
}
- public void testSetContentOnSOAPPart() throws Exception
+ public void testSetContentOnSOAPPart_StreamSource() throws Exception
{
String expMsg =
"<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
@@ -149,32 +159,79 @@
assertEquals(DOMUtils.parse(expMsg), DOMUtils.parse(wasMsg));
}
+ public void testSetContentOnSOAPPart_DOMSource() throws Exception
+ {
+ String expMsg =
+ "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <soapenv:Header/>" +
+ " <soapenv:Body>" +
+ " <HelloResponse
xmlns='http://helloservice.org/types\'>" +
+ " <argument>responseBean</argument>" +
+ " </HelloResponse>" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ MessageFactory factory = new MessageFactoryImpl();
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+
+ SOAPMessage message = factory.createMessage();
+ message.getSOAPPart().setContent(soapMsg.getSOAPPart().getContent());
+ message.saveChanges();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ message.writeTo(baos);
+ String wasMsg = new String(baos.toByteArray());
+
+ assertEquals(DOMUtils.parse(expMsg), DOMUtils.parse(wasMsg));
+ }
+
// [JBWS-1511] MessageFactory does not preserve comments
public void testPreserveComments() throws Exception
{
String expMsg =
- "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:ns1='http://somens.org'>" +
- " <!-- header -->" +
- " <soapenv:Header>" +
- " <!-- header element -->" +
+ "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:ns1='http://somens.org'>" +
+ " <env:Header>" +
" <ns1:header>kermit</ns1:header>" +
- " </soapenv:Header>" +
- " <!-- body -->" +
- " <soapenv:Body>" +
- " <!-- body element -->" +
+ " </env:Header>" +
+ " <env:Body>" +
+ " <!-- pre body element -->" +
" <Hello>" +
- " <!-- element -->" +
+ " <!-- pre element -->" +
" <argument>kermit</argument>" +
+ " <!-- post element -->" +
" </Hello>" +
- " </soapenv:Body>" +
- "</soapenv:Envelope>";
+ " <!-- post body element -->" +
+ " </env:Body>" +
+ "</env:Envelope>";
- MessageFactory factory = new MessageFactoryImpl();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+ // Verify that DOM parse/write do not modify the message
+ Element expEnv = DOMUtils.parse(expMsg);
+ assertEquals(expMsg, DOMWriter.printNode(expEnv, false));
+
+ doPreserveCommentsPerStyle(expMsg, Style.DOCUMENT);
+ doPreserveCommentsPerStyle(expMsg, Style.RPC);
+ doPreserveCommentsPerStyle(expMsg, null);
+ }
+
+ private void doPreserveCommentsPerStyle(String expXML, Style style) throws
IOException, SOAPException
+ {
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setStyle(style);
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expXML.getBytes());
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
- SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
+ SOAPEnvelope wasEnv = soapMsg.getSOAPPart().getEnvelope();
- System.out.println("FIXME: [JBWS-1511] MessageFactory does not preserve
comments");
- //assertEquals(DOMUtils.parse(expMsg), (Element)env);
+ String wasXML = DOMWriter.printNode(wasEnv, false);
+ String wasBody = wasXML.substring(wasXML.indexOf("<env:Body>"));
+ wasBody = wasBody.substring(0, wasBody.indexOf("</env:Body>") +
11);
+
+ String expBody = expXML.substring(expXML.indexOf("<env:Body>"));
+ expBody = expBody.substring(0, expBody.indexOf("</env:Body>") +
11);
+ //System.out.println(expBody);
+ //System.out.println(wasBody);
+ assertEquals(expBody, wasBody);
}
}
\ No newline at end of file
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -107,9 +107,9 @@
{
String xml =
"<soap:Envelope
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <soap:Body>" +
- " <np:bear name='ted' zoo:species='ursus maritimus'
xmlns:np='http://northpole.net' xmlns:zoo='http://zoofan.net'/>" +
- " </soap:Body>" +
+ "<soap:Body>" +
+ "<np:bear name='ted' zoo:species='ursus maritimus'
xmlns:np='http://northpole.net' xmlns:zoo='http://zoofan.net'/>" +
+ "</soap:Body>" +
"</soap:Envelope>";
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage(null, new
ByteArrayInputStream(xml.getBytes()));
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -23,6 +23,7 @@
import java.io.ByteArrayInputStream;
+import javax.xml.namespace.QName;
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
@@ -49,19 +50,20 @@
*/
public class SOAPFaultTestCase extends JBossWSTest
{
- private String envStr = "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <env:Fault>" +
- " <faultcode>env:Client</faultcode>" +
- " <faultstring>Some fault message</faultstring>" +
- " <faultactor>Some fault actor</faultactor>" +
- " <detail>" +
- " <ns1:name
xmlns:ns1='http://somens'>Kermit</ns1:name>" +
- " </detail>" +
- " </env:Fault>" +
- " </env:Body>" +
- "</env:Envelope>";
+ private String envStr =
+ "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Header/>" +
+ " <env:Body>" +
+ " <env:Fault>" +
+ " <faultcode>env:Client</faultcode>" +
+ " <faultstring>Some fault message</faultstring>" +
+ " <faultactor>Some fault actor</faultactor>" +
+ " <detail>" +
+ " <ns1:name
xmlns:ns1='http://somens'>Kermit</ns1:name>" +
+ " </detail>" +
+ " </env:Fault>" +
+ " </env:Body>" +
+ "</env:Envelope>";
public void testExceptionToFault() throws Exception
{
@@ -76,7 +78,7 @@
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage soapMessage = factory.createMessage(null, new
ByteArrayInputStream(envStr.getBytes()));
SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPFault soapFault = (SOAPFault)soapBody.getChildElements().next();
+ SOAPFault soapFault = (SOAPFault)soapBody.getChildElements(new
QName("http://schemas.xmlsoap.org/soap/envelope/", "Fault")).next();
assertEquals("env:Client", soapFault.getFaultCode());
assertEquals("Some fault message", soapFault.getFaultString());
assertEquals("Some fault actor", soapFault.getFaultActor());
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,76 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.utils.DOMWriter;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public abstract class AbstractHandler extends GenericHandler
+{
+ private static final Logger log = Logger.getLogger(AbstractHandler.class);
+
+ public abstract String getMessageBody();
+
+ public boolean handleRequest(MessageContext msgContext)
+ {
+ log.info("handleRequest");
+
+ SOAPMessageContext messageContext = (SOAPMessageContext)msgContext;
+ SOAPMessage soapMessage = messageContext.getMessage();
+
+ try
+ {
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+ String wasEnv = DOMWriter.printNode(soapEnv, false);
+ String wasBody =
wasEnv.substring(wasEnv.indexOf("<env:Body>"));
+ wasBody = wasBody.substring(0,
wasBody.indexOf("</env:Envelope>"));
+ if (wasBody.equals(getMessageBody()) == false)
+ {
+ log.error("Exp Body: " + getMessageBody());
+ log.error("Was Body: " + wasBody);
+ throw new RuntimeException("Received message does not contain expected
soap body.");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to process SOAPMessage", e);
+ }
+ return true;
+ }
+
+ public QName[] getHeaders()
+ {
+ return null;
+ }
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/AbstractHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,48 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class DocumentHandler extends AbstractHandler
+{
+
+ public static final String MESSAGE_BODY =
+ "<env:Body>" +
+ " <!-- Comment After Body -->" +
+ " <typ:echoMessage
xmlns:typ='http://org.jboss.test.ws/jbws1647/types'>" +
+ " <!-- Comment After Wrapper -->" +
+ " <String_1>My Message</String_1>" +
+ " <!-- Comment After Parameter -->" +
+ " </typ:echoMessage>" +
+ " <!-- Comment Before Close Body -->" +
+ "</env:Body>";
+
+ public String getMessageBody()
+ {
+ return MESSAGE_BODY;
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/DocumentHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,54 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import org.jboss.test.ws.JBossWSTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Text Node Preservation For Messages Sent Across The Wire
+ *
+ *
http://jira.jboss.org/jira/browse/JBWS-1647
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class JBWS1647DocumentTestCase extends JBWS1647TestBase
+{
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1647DocumentTestCase.class,
"jaxrpc-jbws1647-doclit.war");
+ }
+
+ public String getMessage()
+ {
+ return "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
DocumentHandler.MESSAGE_BODY + "</env:Envelope>";
+ }
+
+ public String getEndpointAddress()
+ {
+ return "http://" + getServerHost() +
":8080/jaxrpc-jbws1647-doclit/TestEndpoint";
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647DocumentTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,54 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import org.jboss.test.ws.JBossWSTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Text Node Preservation For Messages Sent Across The Wire
+ *
+ *
http://jira.jboss.org/jira/browse/JBWS-1647
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public class JBWS1647RPCTestCase extends JBWS1647TestBase
+{
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1647RPCTestCase.class,
"jaxrpc-jbws1647-rpclit.war");
+ }
+
+ public String getMessage()
+ {
+ return "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
RpcHandler.MESSAGE_BODY + "</env:Envelope>";
+ }
+
+ public String getEndpointAddress()
+ {
+ return "http://" + getServerHost() +
":8080/jaxrpc-jbws1647-rpclit/TestEndpoint";
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647RPCTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647TestBase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647TestBase.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647TestBase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,58 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.test.ws.JBossWSTest;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public abstract class JBWS1647TestBase extends JBossWSTest
+{
+ public abstract String getMessage();
+
+ public abstract String getEndpointAddress();
+
+ public void testCall() throws Exception
+ {
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage soapMessage = msgFactory.createMessage(null, new
ByteArrayInputStream(getMessage().getBytes()));
+
+ SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection con = conFactory.createConnection();
+ SOAPMessage resMessage = con.call(soapMessage, getEndpointAddress());
+
+ SOAPElement soapElement =
(SOAPElement)resMessage.getSOAPBody().getChildElements().next();
+ assertEquals("echoMessageResponse",
soapElement.getElementName().getLocalName());
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/JBWS1647TestBase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,48 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 May 2007
+ */
+public class RpcHandler extends AbstractHandler
+{
+
+ public static final String MESSAGE_BODY =
+ "<env:Body>" +
+ " <!-- Comment After Body -->" +
+ " <jbw:echoMessage
xmlns:jbw='http://org.jboss.test.ws/jbws1647'>" +
+ " <!-- Comment After Operation -->" +
+ " <String_1>My Message</String_1>" +
+ " <!-- Comment After Parameter -->" +
+ " </jbw:echoMessage>" +
+ " <!-- Comment Before Close Body -->" +
+ "</env:Body>";
+
+ public String getMessageBody()
+ {
+ return MESSAGE_BODY;
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/RpcHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,37 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public interface TestEndpoint extends Remote
+{
+
+ public String echoMessage(final String message) throws RemoteException;
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,41 @@
+/*
+ * 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.jaxrpc.jbws1647;
+
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 May 2007
+ */
+public class TestEndpointImpl implements TestEndpoint
+{
+
+ private static final Logger log = Logger.getLogger(TestEndpointImpl.class);
+
+ public String echoMessage(final String message)
+ {
+ return message;
+ }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Tue May 15 11:14:30 CEST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jaxrpc.jbws1647;
+
+
+public class TestEndpoint_echoMessage_RequestStruct
+{
+
+protected java.lang.String string_1;
+public TestEndpoint_echoMessage_RequestStruct(){}
+
+public TestEndpoint_echoMessage_RequestStruct(java.lang.String string_1){
+this.string_1=string_1;
+}
+public java.lang.String getString_1() { return string_1 ;}
+
+public void setString_1(java.lang.String string_1){ this.string_1=string_1; }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_RequestStruct.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Tue May 15 11:14:30 CEST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jaxrpc.jbws1647;
+
+
+public class TestEndpoint_echoMessage_ResponseStruct
+{
+
+protected java.lang.String result;
+public TestEndpoint_echoMessage_ResponseStruct(){}
+
+public TestEndpoint_echoMessage_ResponseStruct(java.lang.String result){
+this.result=result;
+}
+public java.lang.String getResult() { return result ;}
+
+public void setResult(java.lang.String result){ this.result=result; }
+
+}
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1647/TestEndpoint_echoMessage_ResponseStruct.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -28,13 +28,13 @@
import javax.xml.rpc.Service;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import junit.framework.Test;
+import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.w3c.dom.Node;
@@ -184,8 +184,8 @@
mimeHeaders.addHeader("Content-Type", "text/xml;
charset=UTF-8");
SOAPMessage soapMessage = mf.createMessage(mimeHeaders, new
ByteArrayInputStream(xmlStr.getBytes()));
- SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapMessage.getSOAPBody();
+ SOAPElement soapElement = soapBody.getBodyElement();
StringBuffer builder = new StringBuffer();
NodeList nlist = soapElement.getChildNodes();
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -22,12 +22,14 @@
package org.jboss.test.ws.jaxws.handlerlifecycle;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
@@ -186,8 +188,32 @@
String testMethod;
try
{
- SOAPElement soapElement =
(SOAPElement)((SOAPMessageContext)msgContext).getMessage().getSOAPBody().getChildElements().next();
- soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+ SOAPMessage message = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = null;
+ Iterator it = message.getSOAPBody().getChildElements();
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
+ it = soapElement.getChildElements();
+ soapElement = null;
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
testMethod = soapElement.getValue();
}
catch (SOAPException e)
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -41,7 +41,7 @@
*/
public class ExceptionTestCase extends JBossWSTest
{
- private String targetNS =
"http://exception.samples.jaxws.ws.test.jboss.org/";
+ private String targetNS = "http://exception.jaxws.ws.test.jboss.org/";
private ExceptionEndpoint proxy;
public static Test suite()
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2007-09-13
12:02:46 UTC (rev 4559)
@@ -1,24 +1,24 @@
/*
-* 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.jaxws.samples.provider;
import javax.jws.WebParam;
@@ -27,16 +27,12 @@
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
-@WebService(
- serviceName = "ProviderService",
- portName = "ProviderPort",
- targetNamespace = "http://org.jboss.ws/provider",
- wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
+@WebService(name = "Provider", serviceName = "ProviderService",
portName = "ProviderPort", targetNamespace =
"http://org.jboss.ws/provider", wsdlLocation =
"WEB-INF/wsdl/Provider.wsdl")
@SOAPBinding(parameterStyle = ParameterStyle.BARE)
public class WebServiceEndpoint
{
- @WebResult(name="user")
- public UserType echo(@WebParam(name="user")UserType type)
+ @WebResult(name = "user")
+ public UserType echo(@WebParam(name = "user") UserType type)
{
return type;
}
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping
version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1647</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1647/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint_echoMessage_RequestStruct</java-type>
+ <root-type-qname
xmlns:typeNS='http://org.jboss.test.ws/jbws1647/types'>typeNS:echoMessage</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>string_1</java-variable-name>
+ <xml-element-name>String_1</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint_echoMessage_ResponseStruct</java-type>
+ <root-type-qname
xmlns:typeNS='http://org.jboss.test.ws/jbws1647/types'>typeNS:echoMessageResponse</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>result</java-variable-name>
+ <xml-element-name>result</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestService</service-interface>
+ <wsdl-service-name
xmlns:serviceNS='http://org.jboss.test.ws/jbws1647'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestEndpointPort</port-name>
+ <java-port-name>TestEndpointPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS='http://org.jboss.test.ws/jbws1647'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding
xmlns:bindingNS='http://org.jboss.test.ws/jbws1647'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echoMessage</java-method-name>
+ <wsdl-operation>echoMessage</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://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
+ <wsdl-message-part-name>String_1</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://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessageResponse</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>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,21 @@
+<webservices version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+ <webservice-description-name>TestService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>TestEndpointPort</port-component-name>
+ <wsdl-port
xmlns:portNS='http://org.jboss.test.ws/jbws1647'>portNS:TestEndpointPort</wsdl-port>
+
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxrpc.jbws1647.DocumentHandler</handler-class>
+ </handler>
+
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/webservices.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService'
targetNamespace='http://org.jboss.test.ws/jbws1647'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='http://org.jboss.test.ws/jbws1647/types'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws/jbws1647'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://org.jboss.test.ws/jbws1647/types'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://org.jboss.test.ws/jbws1647/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='echoMessage'>
+ <sequence>
+ <element name='String_1' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoMessageResponse'>
+ <sequence>
+ <element name='result' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+ <element name='echoMessage' type='tns:echoMessage'/>
+ <element name='echoMessageResponse'
type='tns:echoMessageResponse'/>
+ </schema>
+ </types>
+ <message name='TestEndpoint_echoMessage'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
+ <part element='ns1:echoMessage' name='echoMessage'/>
+ </message>
+ <message name='TestEndpoint_echoMessageResponse'>
+ <part element='ns1:echoMessageResponse'
name='echoMessageResponse'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echoMessage' parameterOrder='echoMessage'>
+ <input message='tns:TestEndpoint_echoMessage'/>
+ <output message='tns:TestEndpoint_echoMessageResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoMessage'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools.sh -cp ../../../../../output/classes -config wstools-config.xml
+-->
+
+<!-- Add the following handler to the generated webservices.xml
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxrpc.jbws1647.DocumentHandler</handler-class>
+ </handler>
+
+-->
+
+<configuration
xmlns="http://www.jboss.org/jbossws-tools"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="TestService"
endpoint="org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint"
style="document">
+ </service>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1647"
type-namespace="http://org.jboss.test.ws/jbws1647/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint"/>
+ </java-wsdl>
+
+</configuration>
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/doclit/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping
version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1647</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1647/types</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestService</service-interface>
+ <wsdl-service-name
xmlns:serviceNS='http://org.jboss.test.ws/jbws1647'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestEndpointPort</port-name>
+ <java-port-name>TestEndpointPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS='http://org.jboss.test.ws/jbws1647'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding
xmlns:bindingNS='http://org.jboss.test.ws/jbws1647'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echoMessage</java-method-name>
+ <wsdl-operation>echoMessage</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessage</wsdl-message>
+ <wsdl-message-part-name>String_1</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://org.jboss.test.ws/jbws1647'>wsdlMsgNS:TestEndpoint_echoMessageResponse</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>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,21 @@
+<webservices version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+ <webservice-description-name>TestService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>TestEndpointPort</port-component-name>
+ <wsdl-port
xmlns:portNS='http://org.jboss.test.ws/jbws1647'>portNS:TestEndpointPort</wsdl-port>
+
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxrpc.jbws1647.RpcHandler</handler-class>
+ </handler>
+
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/webservices.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService'
targetNamespace='http://org.jboss.test.ws/jbws1647'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws/jbws1647'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='TestEndpoint_echoMessage'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <message name='TestEndpoint_echoMessageResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echoMessage' parameterOrder='String_1'>
+ <input message='tns:TestEndpoint_echoMessage'/>
+ <output message='tns:TestEndpoint_echoMessageResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoMessage'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1647'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1647'
use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
(rev 0)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml 2007-09-13
12:02:46 UTC (rev 4559)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools.sh -cp ../../../../../output/classes -config wstools-config.xml
+-->
+
+<!-- Add the following handler to the generated webservices.xml
+
+ <handler>
+ <handler-name>TestHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxrpc.jbws1647.RpcHandler</handler-class>
+ </handler>
+
+-->
+
+<configuration
xmlns="http://www.jboss.org/jbossws-tools"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="TestService"
endpoint="org.jboss.test.ws.jaxrpc.jbws1647.TestEndpoint"
style="rpc">
+ </service>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1647"
type-namespace="http://org.jboss.test.ws/jbws1647/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint"/>
+ </java-wsdl>
+
+</configuration>
Property changes on:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/jaxrpc/jbws1647/rpclit/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/tests-jboss42-excludes.txt
===================================================================
---
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/tests-jboss42-excludes.txt 2007-09-13
10:17:46 UTC (rev 4558)
+++
legacy/branches/jbossws-1.2.1.GA_JBWS-1803/jbossws-tests/src/resources/tests-jboss42-excludes.txt 2007-09-13
12:02:46 UTC (rev 4559)
@@ -1,10 +1,15 @@
-# Always excludes
+# Always exclude
org/jboss/test/ws/interop/**
org/jboss/test/ws/benchmark/**
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
-org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.*
+org/jboss/test/ws/jaxws/jbws1581/**
+org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase*
+org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
+org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
-org/jboss/test/ws/jaxws/jbws1581/**
org/jboss/test/ws/jaxws/serviceref/**
+
+org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.*
+org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.*