[jboss-svn-commits] JBossWS SVN: r950 - in trunk/src: main/java/org/jboss/ws/annotation main/java/org/jboss/ws/binding/soap main/java/org/jboss/ws/common main/java/org/jboss/ws/deployment main/java/org/jboss/ws/eventing/mgmt main/java/org/jboss/ws/integration/jboss main/java/org/jboss/ws/jaxrpc main/java/org/jboss/ws/jaxws/client main/java/org/jboss/ws/jaxws/core main/java/org/jboss/ws/metadata main/java/org/jboss/ws/metadata/jsr109 main/java/org/jboss/ws/metadata/wsdl/xmlschema main/java/org/jboss/ws/server main/java/org/jboss/ws/soap main/java/org/jboss/ws/tools main/java/org/jboss/ws/tools/helpers main/java/org/jboss/ws/utils test test/java/org/jboss/test/ws/common/binding test/java/org/jboss/test/ws/common/soap/attachment test/resources/jaxrpc/wsse/webclient/WEB-INF
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 13 11:37:49 EDT 2006
Author: thomas.diesler at jboss.com
Date: 2006-09-13 11:36:49 -0400 (Wed, 13 Sep 2006)
New Revision: 950
Added:
trunk/src/main/java/org/jboss/ws/common/CommonBinding.java
trunk/src/main/java/org/jboss/ws/common/CommonBindingProvider.java
trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java
trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java
trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java
Removed:
trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java
trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java
trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java
Modified:
trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java
trunk/src/main/java/org/jboss/ws/common/CommonClient.java
trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java
trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java
trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java
trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
trunk/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java
trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
trunk/src/main/java/org/jboss/ws/utils/MimeUtils.java
trunk/src/test/build.xml
trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
trunk/src/test/resources/jaxrpc/wsse/webclient/WEB-INF/jboss-web.xml
Log:
Remove dependency on JAXWS from core API
Modified: trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -66,8 +66,8 @@
/**
* The optional config-file element gives the to a URL or resource name for the configuration.
*
- * Server side default: standard-jaxws-endpoint-config.xml
- * Client side default: standard-jaxws-client-config.xml
+ * Server side default: standard-jaxrpc-endpoint-config.xml, standard-jaxws-endpoint-config.xml
+ * Client side default: standard-jaxrpc-client-config.xml, standard-jaxws-client-config.xml
*/
String configFile() default "";
Deleted: trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.binding.soap;
-
-// $Id$
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-
-/** A binding for unprocessed SOAP Messages
- *
- * @author Thomas.Diesler at jboss.org
- * @since 27-Jun-2006
- */
-public class JAXWSBindingProviderMessage extends BindingImpl
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JAXWSBindingProviderMessage.class);
-
- /** On the client side, generate the payload from IN parameters. */
- public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException
- {
- log.debug("unbindRequestMessage: " + opMetaData.getQName());
-
- try
- {
- // Construct the endpoint invocation object
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
-
- SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- QName xmlName = paramMetaData.getXmlName();
- epInv.setRequestParamValue(xmlName, reqMessage);
-
- return epInv;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the server side, generate the payload from OUT parameters. */
- public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
- {
- log.debug("bindResponseMessage: " + opMetaData.getQName());
-
- try
- {
- SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- SOAPMessage resMessage = (SOAPMessage)epInv.getReturnValue();
- msgContext.setMessage(resMessage);
-
- return resMessage;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the client side, extract the OUT parameters from the payload and return them to the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
- {
- throw new NotImplementedException();
- }
-
- private void handleException(Exception ex) throws BindingException
- {
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- if (ex instanceof BindingException)
- throw (BindingException)ex;
-
- throw new BindingException(ex);
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.binding.soap;
-
-// $Id$
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.SOAPBodyImpl;
-import org.jboss.ws.soap.SOAPMessageImpl;
-
-/** A BindingProvider for a JAXWS payload
- *
- * @author Thomas.Diesler at jboss.org
- * @since 27-Jun-2006
- */
-public class JAXWSBindingProviderPayload extends BindingImpl
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JAXWSBindingProviderPayload.class);
-
- /** On the client side, generate the payload from IN parameters. */
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
- {
- log.debug("unbindRequestMessage: " + opMetaData.getQName());
-
- try
- {
- // Construct the endpoint invocation object
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
-
- SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- QName xmlName = paramMetaData.getXmlName();
-
- SOAPMessage reqMessage = (SOAPMessage)payload;
- SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
- Source source = soapBody.getPayload();
- epInv.setRequestParamValue(xmlName, source);
-
- return epInv;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the server side, generate the payload from OUT parameters. */
- public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
- {
- log.debug("bindResponseMessage: " + opMetaData.getQName());
-
- try
- {
- SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage();
- msgContext.setMessage(resMessage);
-
- Source payload = (Source)epInv.getReturnValue();
- SOAPBodyImpl soapBody = (SOAPBodyImpl)resMessage.getSOAPBody();
- soapBody.setPayload(payload);
-
- return resMessage;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the client side, extract the OUT parameters from the payload and return them to the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
- {
- throw new NotImplementedException();
- }
-
- private void handleException(Exception ex) throws BindingException
- {
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- if (ex instanceof BindingException)
- throw (BindingException)ex;
-
- throw new BindingException(ex);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/common/CommonBinding.java (from rev 949, branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java)
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/common/CommonBinding.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+// $Id$
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.metadata.OperationMetaData;
+
+/**
+ * The base interface for protocol bindings.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public interface CommonBinding
+{
+ /** On the client side, generate the Object from IN parameters. */
+ Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+
+ /** On the server side, extract the IN parameters from the Object and populate an Invocation object */
+ EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException;
+
+ /** On the server side, generate the Object from OUT parameters in the Invocation object. */
+ Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException;
+
+ /** On the client side, extract the OUT parameters from the Object and return them to the client. */
+ void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+}
Copied: trunk/src/main/java/org/jboss/ws/common/CommonBindingProvider.java (from rev 949, branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java)
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/common/CommonBindingProvider.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+// $Id$
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.EndpointMetaData;
+
+/**
+ * Provides access to the protocol binding.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class CommonBindingProvider
+{
+ protected EndpointMetaData epMetaData;
+ protected CommonBinding binding;
+
+ public CommonBindingProvider(EndpointMetaData epMetaData)
+ {
+ this.epMetaData = epMetaData;
+ initBinding(epMetaData.getBindingId());
+ }
+
+ public CommonBindingProvider(String bindingId)
+ {
+ initBinding(bindingId);
+ }
+
+ protected void initBinding(String bindingId)
+ {
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
+ {
+ binding = new CommonSOAP11Binding();
+ }
+ else if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ {
+ binding = new CommonSOAP12Binding();
+ }
+ else
+ {
+ throw new WSException("Unsupported binding: " + bindingId);
+ }
+ }
+
+ public CommonBinding getCommonBinding()
+ {
+ return binding;
+ }
+}
Modified: trunk/src/main/java/org/jboss/ws/common/CommonClient.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/common/CommonClient.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/common/CommonClient.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -33,7 +33,6 @@
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
import javax.xml.ws.addressing.AddressingProperties;
import javax.xml.ws.addressing.JAXWSAConstants;
@@ -45,8 +44,6 @@
import org.jboss.ws.binding.UnboundHeader;
import org.jboss.ws.jaxrpc.ParameterWrapping;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.metadata.ClientEndpointMetaData;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
@@ -79,9 +76,8 @@
protected QName operationName;
// Output parameters
protected EndpointInvocation epInv;
-
// The binding provider
- private BindingProvider bindingProvider;
+ protected CommonBindingProvider bindingProvider;
/** Create a call that needs to be configured manually
*/
@@ -238,7 +234,7 @@
try
{
// Get the binding from the provider
- BindingImpl binding = (BindingImpl)getBindingProvider().getBinding();
+ CommonBinding binding = (CommonBinding)getCommonBindingProvider().getCommonBinding();
// Create the invocation and sync the input parameters
epInv = new EndpointInvocation(opMetaData);
@@ -348,11 +344,11 @@
}
}
- public BindingProvider getBindingProvider()
+ protected CommonBindingProvider getCommonBindingProvider()
{
if (bindingProvider == null)
{
- bindingProvider = new BindingProviderImpl(getEndpointMetaData());
+ bindingProvider = new CommonBindingProvider(getEndpointMetaData());
}
return bindingProvider;
}
Copied: trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java (from rev 949, branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java)
Copied: trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java (from rev 949, branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java)
Copied: trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java (from rev 949, branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java)
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,878 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.TypesMetaData;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.MessageFactoryImpl;
+import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.soap.SOAPBodyElementDoc;
+import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.SOAPFactoryImpl;
+import org.jboss.ws.soap.SOAPFaultImpl;
+import org.jboss.ws.soap.SOAPHeaderElementImpl;
+import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.soap.attachment.AttachmentPartImpl;
+import org.jboss.ws.soap.attachment.CIDGenerator;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.utils.MimeUtils;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.Element;
+
+/**
+ * The SOAPBinding interface is an abstraction for the SOAP binding.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public abstract class CommonSOAPBinding implements CommonBinding
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(CommonSOAPBinding.class);
+
+ private boolean mtomEnabled;
+
+ /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
+ public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+
+ /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
+ public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+
+ public MessageFactory getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
+ public SOAPFactory getSOAPFactory()
+ {
+ return new SOAPFactoryImpl();
+ }
+
+ public boolean isMTOMEnabled()
+ {
+ return mtomEnabled;
+ }
+
+ public void setMTOMEnabled(boolean flag)
+ {
+ this.mtomEnabled = flag;
+ }
+
+ /** Create the SOAP-1.1 message */
+ protected abstract SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException;
+
+ /** On the client side, generate the payload from IN parameters. */
+ public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ log.debug("bindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Associate current message with message context
+ SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ msgContext.setSOAPMessage(reqMessage);
+
+ SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
+ SOAPBody soapBody = soapEnvelope.getBody();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ QName opQName = opMetaData.getQName();
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+
+ log.debug("Create RPC body element: " + opName);
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
+
+
+ soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+
+ for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getRequestParamValue(xmlName);
+
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = reqMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
+ reqMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBodyElement;
+ addParameterToMessage(paramMetaData, value, soapElement);
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getRequestParamValue(xmlName);
+
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = reqMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
+ reqMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBody;
+ addParameterToMessage(paramMetaData, value, soapElement);
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+
+ // Add unbound headers
+ if (unboundHeaders != null)
+ {
+ Iterator it = unboundHeaders.values().iterator();
+ while (it.hasNext())
+ {
+ UnboundHeader unboundHeader = (UnboundHeader)it.next();
+ if (unboundHeader.getMode() != ParameterMode.OUT)
+ {
+ QName xmlName = unboundHeader.getXmlName();
+ Object value = unboundHeader.getHeaderValue();
+
+ xmlName = namespaceRegistry.registerQName(xmlName);
+ Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
+
+ log.debug("Add unboundHeader element: " + soapName);
+ SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
+ contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
+ soapHeader.addChildElement(contentElement);
+ contentElement.setObjectValue(value);
+ }
+ }
+ }
+
+ return reqMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
+ {
+ log.debug("unbindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // Read the SOAPEnvelope from the reqMessage
+ SOAPMessage reqMessage = (SOAPMessage)payload;
+ SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+
+ // Verify the SOAP version
+ verifySOAPVersion(opMetaData, soapEnvelope);
+
+ // Construct the endpoint invocation object
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ if (opMetaData.isMessageEndpoint() == false)
+ {
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
+ Name elName = soapBodyElement.getElementName();
+
+ QName elQName = new QName(elName.getURI(), elName.getLocalName(), elName.getPrefix());
+ elQName = namespaceRegistry.registerQName(elQName);
+
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.getMode() == ParameterMode.OUT)
+ {
+ epInv.setRequestParamValue(xmlName, null);
+ }
+ else
+ {
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader() == false)
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapBodyElement, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ }
+
+ // Document style
+ else
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader())
+ {
+ if (paramMetaData.getMode() == ParameterMode.IN)
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapHeader, true);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ else
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapBody, false);
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ }
+
+ // Generic message endpoint
+ else
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = soapBody.getChildElements().next();
+ epInv.setRequestParamValue(xmlName, value);
+ }
+ }
+
+ return epInv;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the server side, generate the payload from OUT parameters. */
+ public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
+ {
+ log.debug("bindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Associate current message with message context
+ SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ msgContext.setSOAPMessage(resMessage);
+
+ // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains a SOAP envelope.
+ // Specifically, the HTTP response entity-body must be empty.
+ if (opMetaData.isOneWayOperation())
+ {
+ resMessage.getSOAPPart().setContent(null);
+ return resMessage;
+ }
+
+ SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+
+ // Get the namespace registry
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ QName opQName = opMetaData.getResponseName();
+
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
+
+ soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+
+ // Add the return to the message
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ Object value = epInv.getReturnValue();
+ if (retMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
+ resMessage.addAttachmentPart(part);
+ epInv.setReturnValue(part);
+ }
+ else
+ {
+ SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBodyElement);
+ epInv.setReturnValue(soapElement);
+ soapElement.setObjectValue(value);
+ }
+ }
+
+ // Add the out parameters to the message
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Object value = epInv.getResponseParamValue(xmlName);
+ if (paramMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
+ resMessage.addAttachmentPart(part);
+ }
+ else
+ {
+ if (paramMetaData.isInHeader())
+ {
+ addParameterToMessage(paramMetaData, value, soapHeader);
+ }
+ else
+ {
+ addParameterToMessage(paramMetaData, value, soapBodyElement);
+ }
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ Object value = epInv.getReturnValue();
+ if (opMetaData.isDocumentWrapped())
+ value = ParameterWrapping.wrapResponseParameter(opMetaData, value);
+
+ if (retMetaData.isSwA())
+ {
+ CIDGenerator cidGenerator = resMessage.getCidGenerator();
+ AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
+ resMessage.addAttachmentPart(part);
+ epInv.setReturnValue(part);
+ }
+ else
+ {
+ SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBody);
+ epInv.setReturnValue(soapElement);
+ }
+ }
+
+ // Add the out header parameters to the message
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isInHeader())
+ {
+ Object value = epInv.getResponseParamValue(xmlName);
+ addParameterToMessage(paramMetaData, value, soapHeader);
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+
+ return resMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the client side, extract the OUT parameters from the payload and return them to the client. */
+ public void unbindResponseMessage(OperationMetaData opMetaData, Object payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
+ {
+ log.debug("unbindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains a SOAP envelope.
+ // Specifically, the HTTP response entity-body must be empty.
+ if (opMetaData.isOneWayOperation() == true)
+ {
+ return;
+ }
+
+ // WS-Addressing might redirect the response, which results in an empty envelope
+ SOAPMessage resMessage = (SOAPMessage)payload;
+ SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
+ if (soapEnvelope == null)
+ {
+ return;
+ }
+
+ // Verify the SOAP version
+ verifySOAPVersion(opMetaData, soapEnvelope);
+
+ // Get the SOAP message context that is associated with the current thread
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ SOAPBody soapBody = soapEnvelope.getBody();
+ Iterator bodyChildren = soapBody.getChildElements();
+
+ SOAPBodyElement soapBodyElement = null;
+ if (bodyChildren.hasNext() != false)
+ soapBodyElement = (SOAPBodyElement)bodyChildren.next();
+
+ // Translate the SOAPFault to an exception and throw it
+ if (soapBodyElement instanceof SOAPFaultImpl)
+ {
+ SOAPFaultImpl soapFault = (SOAPFaultImpl)soapBodyElement;
+ SOAPFaultException faultEx = SOAPFaultExceptionHelper.getSOAPFaultException(soapFault);
+ throw faultEx;
+ }
+
+ // Extract unbound OUT headers
+ if (unboundHeaders != null)
+ {
+ Map<QName, UnboundHeader> outHeaders = new HashMap<QName, UnboundHeader>();
+ Iterator itHeaderElements = soapHeader.getChildElements();
+ while (itHeaderElements.hasNext())
+ {
+ SOAPContentElement soapHeaderElement = (SOAPHeaderElementImpl)itHeaderElements.next();
+ Name elName = soapHeaderElement.getElementName();
+ QName xmlName = new QName(elName.getURI(), elName.getLocalName());
+
+ UnboundHeader unboundHeader = (UnboundHeader)unboundHeaders.get(xmlName);
+ if (unboundHeader != null)
+ {
+ soapHeaderElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
+
+ // Do the unmarshalling
+ Object value = soapHeaderElement.getObjectValue();
+ unboundHeader.setHeaderValue(value);
+ outHeaders.put(xmlName, unboundHeader);
+ }
+ }
+ unboundHeaders.clear();
+ unboundHeaders.putAll(outHeaders);
+ }
+
+ Style style = opMetaData.getStyle();
+ if (style == Style.RPC)
+ {
+ if (soapBodyElement == null)
+ throw new WSException("Cannot unbind response message with empty soap body");
+
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ if (retMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(retMetaData, resMessage);
+ epInv.setReturnValue(value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(retMetaData, soapBodyElement, false);
+ epInv.setReturnValue(value);
+ }
+ }
+
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(paramMetaData, resMessage);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ else
+ {
+ SOAPElement soapElement = paramMetaData.isInHeader() ? soapHeader : (SOAPElement)soapBodyElement;
+ Object value = getParameterFromMessage(paramMetaData, soapElement, false);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+
+ // WS-Eventing has no message part for UnsubscribeResponseMsg
+ if (retMetaData != null)
+ {
+ if (retMetaData.isSwA())
+ {
+ Object value = getAttachmentFromMessage(retMetaData, resMessage);
+ epInv.setReturnValue(value);
+ }
+ else
+ {
+ Object value = getParameterFromMessage(retMetaData, soapBody, false);
+ epInv.setReturnValue(value);
+ }
+
+ for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ if (paramMetaData.isInHeader())
+ {
+ Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
+ epInv.setResponseParamValue(xmlName, value);
+ }
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ }
+ }
+
+ private void verifySOAPVersion(OperationMetaData opMetaData, SOAPEnvelope soapEnvelope)
+ {
+ String envNS = soapEnvelope.getNamespaceURI();
+ String bindingId = opMetaData.getEndpointMetaData().getBindingId();
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && Constants.NS_SOAP11_ENV.equals(envNS) == false)
+ log.warn("Expected SOAP-1.1 envelope, but got: " + envNS);
+
+ if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) && Constants.NS_SOAP12_ENV.equals(envNS) == false)
+ log.warn("Expected SOAP-1.2 envelope, but got: " + envNS);
+ }
+
+ private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
+ {
+ String partName = paramMetaData.getXmlName().getLocalPart();
+ Set mimeTypes = paramMetaData.getMimeTypes();
+
+ AttachmentPart part = new AttachmentPartImpl();
+ if (value instanceof DataHandler)
+ {
+ DataHandler handler = (DataHandler)value;
+ String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
+
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ throw new BindingException("Mime type " + mimeType + " not allowed for parameter " + partName + " allowed types are " + mimeTypes);
+
+ part.setDataHandler((DataHandler)value);
+ }
+ else
+ {
+ String mimeType = null;
+ if (mimeTypes != null && mimeTypes.size() > 0)
+ {
+ mimeType = (String)mimeTypes.iterator().next();
+ }
+ else
+ {
+ mimeType = MimeUtils.resolveMimeType(value);
+ }
+
+ if (mimeType == null)
+ throw new BindingException("Could not determine mime type for attachment parameter: " + partName);
+
+ part.setContent(value, mimeType);
+ }
+
+ if (paramMetaData.isSwA())
+ {
+ String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
+ part.setContentId(swaCID);
+ }
+ if (paramMetaData.isXOP())
+ {
+ String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
+ part.setContentId(xopCID);
+ }
+
+ return part;
+ }
+
+ private Object getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+
+ AttachmentPart part = ((SOAPMessageImpl)message).getAttachmentByPartName(xmlName.getLocalPart());
+ if (part == null)
+ throw new BindingException("Could not locate attachment for parameter: " + paramMetaData.getXmlName());
+
+ return part;
+ }
+
+ /** Marshall the given parameter and add it to the SOAPMessage */
+ private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData, Object value, SOAPElement soapElement) throws SOAPException, BindingException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Class javaType = paramMetaData.getJavaType();
+
+ if (value != null && paramMetaData.isXOP() == false)
+ {
+ Class valueType = value.getClass();
+ if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
+ throw new BindingException("javaType " + javaType.getName() + " is not assignable from: " + valueType.getName());
+ }
+
+ // Make sure we have a prefix on qualified names
+ if (xmlName.getNamespaceURI().length() > 0)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
+ xmlName = namespaceRegistry.registerQName(xmlName);
+ }
+
+ Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
+ if (paramMetaData.isSOAPArrayParam())
+ soapName = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
+
+ SOAPContentElement contentElement;
+ if (soapElement instanceof SOAPHeader)
+ {
+ contentElement = new SOAPHeaderElementImpl(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ else
+ {
+ Style style = paramMetaData.getOperationMetaData().getStyle();
+ if (style == Style.DOCUMENT)
+ {
+ contentElement = new SOAPBodyElementDoc(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ else
+ {
+ contentElement = new SOAPContentElement(soapName);
+ soapElement.addChildElement(contentElement);
+ }
+ }
+
+ contentElement.setParamMetaData(paramMetaData);
+
+ if (paramMetaData.isSOAPArrayParam())
+ {
+ log.trace("Add parameter as SOAP encoded Array");
+ contentElement.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
+ }
+
+ // The object value needs to be set after xmime:contentType
+ if (paramMetaData.isXOP())
+ {
+ log.trace("Add parameter as XOP");
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ soapMessage.setXOPMessage(true);
+ }
+
+ contentElement.setObjectValue(value);
+
+ return contentElement;
+ }
+
+ /** Unmarshall a message element and add it to the parameter list */
+ private Object getParameterFromMessage(ParameterMetaData paramMetaData, SOAPElement soapElement, boolean optional) throws BindingException
+ {
+ Name xmlName = new NameImpl(paramMetaData.getXmlName());
+ Name soapArrayName = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
+
+ SOAPContentElement soapContentElement = null;
+ Iterator childElements = soapElement.getChildElements();
+ while (childElements.hasNext())
+ {
+ SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+
+ // 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();
+
+ if (xmlName.equals(elName))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
+
+ if (soapArrayName.equals(elName))
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ try
+ {
+ QName compXMLName = paramMetaData.getXmlName();
+ Element compElement = DOMUtils.getFirstChildElement(aux);
+ if (compElement.getNodeName().equals(compXMLName.getLocalPart()))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
+ }
+ }
+ finally
+ {
+ msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ }
+ }
+ }
+
+ // If matching by name fails, try to match by xmlType
+ // This maybe necessary when wsa:Action dispatches to the operation
+ if (soapContentElement == null)
+ {
+ childElements = soapElement.getChildElements();
+ OperationMetaData opMetaData = paramMetaData.getOperationMetaData();
+ TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ if (childElements.hasNext() && opMetaData.getStyle() == Style.DOCUMENT)
+ {
+ SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
+
+ // The parameters are expected to be lazy
+ SOAPContentElement aux = (SOAPContentElement)childElement;
+ Name elName = aux.getElementName();
+ QName elType = null;
+
+ XSElementDeclaration xsdElement = typesMetaData.getSchemaModel().getElementDeclaration(elName.getLocalName(), elName.getURI());
+ if (xsdElement != null && xsdElement.getTypeDefinition() != null)
+ {
+ XSTypeDefinition xsdType = xsdElement.getTypeDefinition();
+ elType = new QName(xsdType.getNamespace(), xsdType.getName());
+ }
+
+ if (paramMetaData.getXmlType().equals(elType))
+ {
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ }
+ }
+ }
+
+ if (soapContentElement == null && optional == false)
+ throw new JAXRPCException("Cannot find child element: " + xmlName);
+
+ if (paramMetaData.isXOP())
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
+ soapMessage.setXOPMessage(true);
+ }
+ return soapContentElement;
+ }
+
+ private void handleException(Exception ex) throws BindingException
+ {
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ if (ex instanceof BindingException)
+ throw (BindingException)ex;
+
+ throw new BindingException(ex);
+ }
+}
Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -328,7 +328,7 @@
{
epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
}
-
+
if (opMetaData.isDocumentWrapped())
{
xmlName = opMetaData.getQName();
Modified: trunk/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.deployment;
-// $Id$
+// $Id: $
import java.io.IOException;
import java.net.MalformedURLException;
@@ -43,13 +43,13 @@
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.xml.namespace.QName;
import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.soap.SOAPBinding;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.addressing.AddressingPropertiesImpl;
import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.common.CommonSOAPBinding;
import org.jboss.ws.eventing.EventingConstants;
import org.jboss.ws.eventing.deployment.EventingEndpoint;
import org.jboss.ws.eventing.metadata.EventingEpMetaExt;
@@ -153,9 +153,9 @@
WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
String bindingType = wsdlBinding.getType();
if (Constants.NS_SOAP11.equals(bindingType))
- epMetaData.setBindingId(SOAPBinding.SOAP11HTTP_BINDING);
+ epMetaData.setBindingId(CommonSOAPBinding.SOAP11HTTP_BINDING);
else if (Constants.NS_SOAP12.equals(bindingType))
- epMetaData.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
+ epMetaData.setBindingId(CommonSOAPBinding.SOAP12HTTP_BINDING);
}
/** Initialize the endpoint encoding style from the binding operations
Modified: trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -106,6 +106,7 @@
private ThreadPoolExecutor threadPool;
private boolean isDispatcherBound = false;
+
/**
* subscription watchdog that maintains expirations
*/
@@ -145,7 +146,6 @@
// start the subscription watchdog
watchDog = new WatchDog(subscriptionMapping);
watchDog.startup();
-
}
public void stop()
@@ -192,6 +192,7 @@
{
// workaround for JBWS-1006
lazyBindEventDispatcher();
+
EventSource eventSource = builder.newEventSource(deploymentInfo);
if (eventSourceMapping.containsKey(eventSource.getNameSpace()) == false)
{
@@ -229,6 +230,7 @@
}
}
}
+
/**
* the of deployment info's is unknown therefore we try to
* update the event source manager EPR anytime.
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -24,11 +24,13 @@
//$Id: WebServiceDeployer.java 377 2006-05-18 13:57:29Z thomas.diesler at jboss.com $
import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
import org.jboss.deployment.SubDeployerInterceptorSupport;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.metadata.WebMetaData;
import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
import org.jboss.ws.deployment.ServiceEndpointDeployer;
import org.jboss.ws.deployment.ServiceEndpointPublisher;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
@@ -45,10 +47,14 @@
*/
public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
{
+ // The main deployer
+ private MainDeployerMBean mainDeployer;
+
/** Create the deployer service
*/
protected void createService() throws Exception
{
+ mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
super.attach();
}
@@ -155,4 +161,24 @@
{
return (UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
}
+
+ /** Handle all webservice deployment exceptions.
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleStartupException(DeploymentInfo di, Throwable th)
+ {
+ log.error("Cannot startup webservice for: " + di.shortName, th);
+ mainDeployer.undeploy(di);
+ }
+
+ /** Handle all webservice deployment exceptions.
+ *
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleShutdownException(String moduleName, Throwable th)
+ {
+ log.error("Cannot shutdown webservice for: " + moduleName, th);
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -30,9 +30,9 @@
import org.jboss.invocation.InvocationKey;
import org.jboss.logging.Logger;
import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
@@ -92,8 +92,8 @@
epInv.setReturnValue(resObj);
// Bind the response message
- BindingProviderImpl bindingProvider = new BindingProviderImpl(opMetaData.getEndpointMetaData());
- BindingImpl binding = (BindingImpl)bindingProvider.getBinding();
+ CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
+ CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
msgContext.setSOAPMessage(resMessage);
}
Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -46,6 +46,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonClient;
import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
Modified: trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/client/ClientImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -34,9 +34,11 @@
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.handler.MessageContext;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonClient;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxws.core.BindingImpl;
+import org.jboss.ws.jaxws.core.BindingExt;
+import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.jaxws.handler.HandlerChainExecutor;
import org.jboss.ws.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.jaxws.handler.PortInfoImpl;
@@ -63,7 +65,7 @@
// Init the cilent handler chain in the binding
private void initBindingHandlerChain(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
{
- BindingImpl binding = (BindingImpl)getBindingProvider().getBinding();
+ Binding binding = getBindingProvider().getBinding();
if (handlerResolver != null)
{
PortInfoImpl portInfo = new PortInfoImpl(epMetaData);
@@ -78,7 +80,7 @@
@Override
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
- BindingImpl binding = (BindingImpl)getBindingProvider().getBinding();
+ BindingExt binding = (BindingExt)getBindingProvider().getBinding();
HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
return executor.handleRequest(msgContext);
@@ -87,7 +89,7 @@
@Override
protected boolean callResponseHandlerChain(QName portName, HandlerType type)
{
- BindingImpl binding = (BindingImpl)getBindingProvider().getBinding();
+ BindingExt binding = (BindingExt)getBindingProvider().getBinding();
HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
return executor.handleResponse(msgContext);
@@ -145,6 +147,16 @@
return (String)getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
}
+ @Override
+ protected CommonBindingProvider getCommonBindingProvider()
+ {
+ if (bindingProvider == null)
+ {
+ bindingProvider = new BindingProviderImpl(getEndpointMetaData());
+ }
+ return bindingProvider;
+ }
+
public Map<String, Object> getRequestContext()
{
return getBindingProvider().getRequestContext();
@@ -159,4 +171,9 @@
{
return getBindingProvider().getBinding();
}
+
+ public BindingProvider getBindingProvider()
+ {
+ return (BindingProvider)getCommonBindingProvider();
+ }
}
Added: trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+import java.util.List;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.handler.Handler;
+
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+// $Id$
+
+/**
+ * Extension to JAXWS protocol bindings.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public interface BindingExt extends Binding
+{
+ public List<Handler> getHandlerChain(HandlerType handlerType);
+}
Property changes on: trunk/src/main/java/org/jboss/ws/jaxws/core/BindingExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.jaxws.core;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Binding;
-import javax.xml.ws.handler.Handler;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-
-/**
- * The Binding interface is the base interface for JAX-WS protocol bindings.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 04-Jul-2006
- */
-public abstract class BindingImpl implements Binding
-{
- // provide logging
- private static Logger log = Logger.getLogger(BindingImpl.class);
-
- private List<Handler> preHandlerChain = new ArrayList<Handler>();
- private List<Handler> jaxwsHandlerChain = new ArrayList<Handler>();
- private List<Handler> postHandlerChain = new ArrayList<Handler>();
-
- /** On the client side, generate the Object from IN parameters. */
- public abstract Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
-
- /** On the server side, extract the IN parameters from the Object and populate an Invocation object */
- public abstract EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException;
-
- /** On the server side, generate the Object from OUT parameters in the Invocation object. */
- public abstract Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException;
-
- /** On the client side, extract the OUT parameters from the Object and return them to the client. */
- public abstract void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException;
-
- public List<Handler> getHandlerChain(HandlerType handlerType)
- {
- List<Handler> handlerChain = new ArrayList<Handler>();
-
- if (handlerType == HandlerType.PRE || handlerType == HandlerType.ALL)
- handlerChain.addAll(preHandlerChain);
-
- if (handlerType == HandlerType.ENDPOINT || handlerType == HandlerType.ALL)
- handlerChain.addAll(jaxwsHandlerChain);
-
- if (handlerType == HandlerType.POST || handlerType == HandlerType.ALL)
- handlerChain.addAll(postHandlerChain);
-
- return Collections.unmodifiableList(handlerChain);
- }
-
- public List<Handler> getHandlerChain()
- {
- log.debug("getHandlerChain: " + jaxwsHandlerChain);
- return jaxwsHandlerChain;
- }
-
- public void setHandlerChain(List<Handler> handlerChain)
- {
- log.debug("setHandlerChain: " + handlerChain);
- this.jaxwsHandlerChain = handlerChain;
- }
-}
Added: trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/BindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.ws.handler.Handler;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * The Binding interface is the base interface for JAXWS protocol bindings.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class BindingImpl implements BindingExt
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(BindingImpl.class);
+
+ private List<Handler> preHandlerChain = new ArrayList<Handler>();
+ private List<Handler> jaxwsHandlerChain = new ArrayList<Handler>();
+ private List<Handler> postHandlerChain = new ArrayList<Handler>();
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ List<Handler> handlerChain = new ArrayList<Handler>();
+
+ if (handlerType == HandlerType.PRE || handlerType == HandlerType.ALL)
+ handlerChain.addAll(preHandlerChain);
+
+ if (handlerType == HandlerType.ENDPOINT || handlerType == HandlerType.ALL)
+ handlerChain.addAll(jaxwsHandlerChain);
+
+ if (handlerType == HandlerType.POST || handlerType == HandlerType.ALL)
+ handlerChain.addAll(postHandlerChain);
+
+ return Collections.unmodifiableList(handlerChain);
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ log.debug("getHandlerChain: " + jaxwsHandlerChain);
+ return jaxwsHandlerChain;
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ log.debug("setHandlerChain: " + handlerChain);
+ this.jaxwsHandlerChain = handlerChain;
+ }
+}
Modified: trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/BindingProviderImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -33,9 +33,7 @@
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.binding.soap.JAXWSBindingProviderMessage;
-import org.jboss.ws.binding.soap.JAXWSBindingProviderPayload;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.metadata.EndpointMetaData;
/**
@@ -45,43 +43,43 @@
* @author Thomas.Diesler at jboss.com
* @since 04-Jul-2006
*/
-public class BindingProviderImpl implements BindingProvider
+public class BindingProviderImpl extends CommonBindingProvider implements BindingProvider
{
- private BindingImpl binding;
private Map<String, Object> requestContext = new HashMap<String, Object>();
private Map<String, Object> responseContext = new HashMap<String, Object>();
public BindingProviderImpl(EndpointMetaData epMetaData)
{
- initBinding(epMetaData.getBindingId(), epMetaData.getServiceMode());
+ super(epMetaData);
}
public BindingProviderImpl(String bindingId)
{
- initBinding(bindingId, null);
+ super(bindingId);
}
- private void initBinding(String bindingId, Mode serviceMode)
+ @Override
+ protected void initBinding(String bindingId)
{
- if (serviceMode == Mode.MESSAGE)
+ if (epMetaData != null && epMetaData.getServiceMode() == Mode.MESSAGE)
{
- binding = new JAXWSBindingProviderMessage();
+ binding = new MessageBinding();
}
- else if (serviceMode == Mode.PAYLOAD)
+ else if (epMetaData != null && epMetaData.getServiceMode() == Mode.PAYLOAD)
{
- binding = new JAXWSBindingProviderPayload();
+ binding = new PayloadBinding();
}
else if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
{
- binding = new SOAP11BindingImpl();
+ binding = new SOAP11BindingJAXWS();
}
else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
{
- binding = new SOAP12BindingImpl();
+ binding = new SOAP12BindingJAXWS();
}
else if (HTTPBinding.HTTP_BINDING.equals(bindingId))
{
- binding = new HTTPBindingImpl();
+ binding = new HTTPBindingJAXWS();
}
else
{
@@ -101,6 +99,6 @@
public Binding getBinding()
{
- return binding;
+ return (Binding)binding;
}
}
Deleted: trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.jaxws.core;
-
-// $Id: $
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.http.HTTPBinding;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.metadata.OperationMetaData;
-
-/**
- * The HTTPBinding interface is an abstraction for the XML/HTTP binding.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 04-Jul-2006
- */
-public class HTTPBindingImpl extends BindingImpl implements HTTPBinding
-{
-
- @Override
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- @Override
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException
- {
- throw new NotImplementedException();
- }
-
- @Override
- public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- throw new NotImplementedException();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java (from rev 938, trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingImpl.java 2006-09-11 15:17:07 UTC (rev 938)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/HTTPBindingJAXWS.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id: $
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * The HTTPBinding interface is an abstraction for the XML/HTTP binding.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class HTTPBindingJAXWS implements CommonBinding, BindingExt, HTTPBinding
+{
+ private BindingImpl delegate = new BindingImpl();
+
+ public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ return delegate.getHandlerChain();
+ }
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ return delegate.getHandlerChain(handlerType);
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ delegate.setHandlerChain(handlerChain);
+ }
+}
Added: trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id$
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.Handler;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.soap.MessageContextAssociation;
+
+/** A binding for unprocessed SOAP Messages
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 27-Jun-2006
+ */
+public class MessageBinding implements CommonBinding, BindingExt
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(MessageBinding.class);
+
+ // Delegate to JAXWS binding
+ private BindingImpl delegate = new BindingImpl();
+
+ /** On the client side, generate the payload from IN parameters. */
+ public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object reqMessage) throws BindingException
+ {
+ log.debug("unbindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // Construct the endpoint invocation object
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
+
+ SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
+ QName xmlName = paramMetaData.getXmlName();
+ epInv.setRequestParamValue(xmlName, reqMessage);
+
+ return epInv;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the server side, generate the payload from OUT parameters. */
+ public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
+ {
+ log.debug("bindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Associate current message with message context
+ SOAPMessage resMessage = (SOAPMessage)epInv.getReturnValue();
+ msgContext.setMessage(resMessage);
+
+ return resMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the client side, extract the OUT parameters from the payload and return them to the client. */
+ public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ return delegate.getHandlerChain();
+ }
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ return delegate.getHandlerChain(handlerType);
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ delegate.setHandlerChain(handlerChain);
+ }
+
+ private void handleException(Exception ex) throws BindingException
+ {
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ if (ex instanceof BindingException)
+ throw (BindingException)ex;
+
+ throw new BindingException(ex);
+ }
+
+}
Property changes on: trunk/src/main/java/org/jboss/ws/jaxws/core/MessageBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id$
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.ws.handler.Handler;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.MessageFactoryImpl;
+import org.jboss.ws.soap.SOAPBodyImpl;
+import org.jboss.ws.soap.SOAPMessageImpl;
+
+/** A BindingProvider for a JAXWS payload
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 27-Jun-2006
+ */
+public class PayloadBinding implements CommonBinding, BindingExt
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PayloadBinding.class);
+
+ // Delegate to JAXWS binding
+ private BindingImpl delegate = new BindingImpl();
+
+ /** On the client side, generate the payload from IN parameters. */
+ public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
+ {
+ log.debug("unbindRequestMessage: " + opMetaData.getQName());
+
+ try
+ {
+ // Construct the endpoint invocation object
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
+
+ SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
+ QName xmlName = paramMetaData.getXmlName();
+
+ SOAPMessage reqMessage = (SOAPMessage)payload;
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
+ Source source = soapBody.getPayload();
+ epInv.setRequestParamValue(xmlName, source);
+
+ return epInv;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the server side, generate the payload from OUT parameters. */
+ public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
+ {
+ log.debug("bindResponseMessage: " + opMetaData.getQName());
+
+ try
+ {
+ SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ // Associate current message with message context
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
+ SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage();
+ msgContext.setMessage(resMessage);
+
+ Source payload = (Source)epInv.getReturnValue();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)resMessage.getSOAPBody();
+ soapBody.setPayload(payload);
+
+ return resMessage;
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /** On the client side, extract the OUT parameters from the payload and return them to the client. */
+ public void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
+ {
+ throw new NotImplementedException();
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ return delegate.getHandlerChain();
+ }
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ return delegate.getHandlerChain(handlerType);
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ delegate.setHandlerChain(handlerChain);
+ }
+
+ private void handleException(Exception ex) throws BindingException
+ {
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ if (ex instanceof BindingException)
+ throw (BindingException)ex;
+
+ throw new BindingException(ex);
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/jaxws/core/PayloadBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.jaxws.core;
-
-// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Call;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-
-/**
- * The SOAP11Binding
- *
- * @author Thomas.Diesler at jboss.com
- * @since 04-Jul-2006
- */
-public class SOAP11BindingImpl extends SOAPBindingImpl
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPBindingImpl.class);
-
- /** Create the SOAP-1.1 message */
- protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
- {
- MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
- SOAPMessage soapMessage = factory.createMessage();
-
- Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
- if (Use.ENCODED.equals(encStyle))
- {
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
- }
-
- return soapMessage;
- }
-
- /** On the client side, generate the payload from IN parameters. */
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- SOAPMessage reqMessage = (SOAPMessage) super.bindRequestMessage(opMetaData, epInv, unboundHeaders);
-
- // Set the SOAPAction
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String soapAction = opMetaData.getSOAPAction();
-
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
-
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext.getProperty(Call.SOAPACTION_USE_PROPERTY) != null)
- log.info("Ignore Call.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
-
- String soapActionProperty = (String)msgContext.getProperty(Call.SOAPACTION_URI_PROPERTY);
- if (soapActionProperty != null)
- soapAction = soapActionProperty;
-
- mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");
-
- return reqMessage;
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java (from rev 938, trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingImpl.java 2006-09-11 15:17:07 UTC (rev 938)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
+
+import java.net.URI;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.ws.common.CommonSOAP11Binding;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * The SOAP11Binding
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class SOAP11BindingJAXWS extends CommonSOAP11Binding implements BindingExt, SOAPBinding
+{
+ // Delegate to JAXWS SOAP binding
+ private SOAPBindingDelegate delegate = new SOAPBindingDelegate();
+
+ public Set<URI> getRoles()
+ {
+ return delegate.getRoles();
+ }
+
+ public void setRoles(Set<URI> roles)
+ {
+ delegate.setRoles(roles);
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ return delegate.getHandlerChain();
+ }
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ return delegate.getHandlerChain(handlerType);
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ delegate.setHandlerChain(handlerChain);
+ }
+}
Deleted: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.jaxws.core;
-
-// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
-
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageFactoryImpl;
-
-/**
- * The SOAP11Binding
- *
- * @author Thomas.Diesler at jboss.com
- * @since 04-Jul-2006
- */
-public class SOAP12BindingImpl extends SOAPBindingImpl
-{
- /** Create the SOAP-1.1 message */
- protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
- {
- MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP12_ENV);
- return factory.createMessage();
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java (from rev 938, trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingImpl.java 2006-09-11 15:17:07 UTC (rev 938)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
+
+import java.net.URI;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.ws.common.CommonSOAP12Binding;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * The SOAP11Binding
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class SOAP12BindingJAXWS extends CommonSOAP12Binding implements BindingExt, SOAPBinding
+{
+ // Delegate to JAXWS SOAP binding
+ private SOAPBindingDelegate delegate = new SOAPBindingDelegate();
+
+ public Set<URI> getRoles()
+ {
+ return delegate.getRoles();
+ }
+
+ public void setRoles(Set<URI> roles)
+ {
+ delegate.setRoles(roles);
+ }
+
+ public List<Handler> getHandlerChain()
+ {
+ return delegate.getHandlerChain();
+ }
+
+ public List<Handler> getHandlerChain(HandlerType handlerType)
+ {
+ return delegate.getHandlerChain(handlerType);
+ }
+
+ public void setHandlerChain(List<Handler> handlerChain)
+ {
+ delegate.setHandlerChain(handlerChain);
+ }
+}
Copied: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java (from rev 938, trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java 2006-09-11 15:17:07 UTC (rev 938)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.jaxws.core;
+
+// $Id$
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * The SOAPBinding interface is an abstraction for the SOAP binding.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+public class SOAPBindingDelegate extends BindingImpl
+{
+ private Set<URI> roles = new HashSet<URI>();
+ public Set<URI> getRoles()
+ {
+ return roles;
+ }
+
+ public void setRoles(Set<URI> roles)
+ {
+ this.roles = roles;
+ }
+}
Deleted: trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -1,887 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.jaxws.core;
-
-// $Id$
-
-import java.net.URI;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPBodyElementDoc;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
-import org.jboss.ws.soap.SOAPContentElement;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPFactoryImpl;
-import org.jboss.ws.soap.SOAPFaultImpl;
-import org.jboss.ws.soap.SOAPHeaderElementImpl;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.soap.attachment.CIDGenerator;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.utils.MimeUtils;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Element;
-
-/**
- * The SOAPBinding interface is an abstraction for the SOAP binding.
- *
- * @author Thomas.Diesler at jboss.com
- * @since 04-Jul-2006
- */
-public abstract class SOAPBindingImpl extends BindingImpl implements SOAPBinding
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPBindingImpl.class);
-
- private boolean mtomEnabled;
- private Set<URI> roles = new HashSet<URI>();
-
- public MessageFactory getMessageFactory()
- {
- return new MessageFactoryImpl();
- }
-
- public Set<URI> getRoles()
- {
- return roles;
- }
-
- public void setRoles(Set<URI> roles)
- {
- this.roles = roles;
- }
-
- public SOAPFactory getSOAPFactory()
- {
- return new SOAPFactoryImpl();
- }
-
- public boolean isMTOMEnabled()
- {
- return mtomEnabled;
- }
-
- public void setMTOMEnabled(boolean flag)
- {
- this.mtomEnabled = flag;
- }
-
- /** Create the SOAP-1.1 message */
- protected abstract SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException;
-
- /** On the client side, generate the payload from IN parameters. */
- public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
- {
- log.debug("bindRequestMessage: " + opMetaData.getQName());
-
- try
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
- msgContext.setSOAPMessage(reqMessage);
-
- SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
- SOAPBody soapBody = soapEnvelope.getBody();
- SOAPHeader soapHeader = soapEnvelope.getHeader();
-
- // Get the namespace registry
- NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
-
- Style style = opMetaData.getStyle();
- if (style == Style.RPC)
- {
- QName opQName = opMetaData.getQName();
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
-
- log.debug("Create RPC body element: " + opName);
- SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
-
-
- soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
-
- for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- Object value = epInv.getRequestParamValue(xmlName);
-
- if (paramMetaData.isSwA())
- {
- CIDGenerator cidGenerator = reqMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
- reqMessage.addAttachmentPart(part);
- }
- else
- {
- SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBodyElement;
- addParameterToMessage(paramMetaData, value, soapElement);
- }
- }
- }
- else if (style == Style.DOCUMENT)
- {
- for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- Object value = epInv.getRequestParamValue(xmlName);
-
- if (paramMetaData.isSwA())
- {
- CIDGenerator cidGenerator = reqMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
- reqMessage.addAttachmentPart(part);
- }
- else
- {
- SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBody;
- addParameterToMessage(paramMetaData, value, soapElement);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
-
- // Add unbound headers
- if (unboundHeaders != null)
- {
- Iterator it = unboundHeaders.values().iterator();
- while (it.hasNext())
- {
- UnboundHeader unboundHeader = (UnboundHeader)it.next();
- if (unboundHeader.getMode() != ParameterMode.OUT)
- {
- QName xmlName = unboundHeader.getXmlName();
- Object value = unboundHeader.getHeaderValue();
-
- xmlName = namespaceRegistry.registerQName(xmlName);
- Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
-
- log.debug("Add unboundHeader element: " + soapName);
- SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
- contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
- soapHeader.addChildElement(contentElement);
- contentElement.setObjectValue(value);
- }
- }
- }
-
- return reqMessage;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
- {
- log.debug("unbindRequestMessage: " + opMetaData.getQName());
-
- try
- {
- // Read the SOAPEnvelope from the reqMessage
- SOAPMessage reqMessage = (SOAPMessage)payload;
- SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
- SOAPHeader soapHeader = soapEnvelope.getHeader();
- SOAPBody soapBody = soapEnvelope.getBody();
-
- // Verify the SOAP version
- verifySOAPVersion(opMetaData, soapEnvelope);
-
- // Construct the endpoint invocation object
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Get the namespace registry
- NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
-
- if (opMetaData.isMessageEndpoint() == false)
- {
- Style style = opMetaData.getStyle();
- if (style == Style.RPC)
- {
- SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
- Name elName = soapBodyElement.getElementName();
-
- QName elQName = new QName(elName.getURI(), elName.getLocalName(), elName.getPrefix());
- elQName = namespaceRegistry.registerQName(elQName);
-
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- if (paramMetaData.getMode() == ParameterMode.OUT)
- {
- epInv.setRequestParamValue(xmlName, null);
- }
- else
- {
- if (paramMetaData.isSwA())
- {
- Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
- epInv.setRequestParamValue(xmlName, value);
- }
- else
- {
- if (paramMetaData.isInHeader() == false)
- {
- Object value = getParameterFromMessage(paramMetaData, soapBodyElement, false);
- epInv.setRequestParamValue(xmlName, value);
- }
- else
- {
- Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
- epInv.setRequestParamValue(xmlName, value);
- }
- }
- }
- }
- }
-
- // Document style
- else
- {
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- if (paramMetaData.isSwA())
- {
- Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
- epInv.setRequestParamValue(xmlName, value);
- }
- else
- {
- if (paramMetaData.isInHeader())
- {
- if (paramMetaData.getMode() == ParameterMode.IN)
- {
- Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
- epInv.setRequestParamValue(xmlName, value);
- }
- else
- {
- Object value = getParameterFromMessage(paramMetaData, soapHeader, true);
- epInv.setRequestParamValue(xmlName, value);
- }
- }
- else
- {
- Object value = getParameterFromMessage(paramMetaData, soapBody, false);
- epInv.setRequestParamValue(xmlName, value);
- }
- }
- }
- }
- }
-
- // Generic message endpoint
- else
- {
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- Object value = soapBody.getChildElements().next();
- epInv.setRequestParamValue(xmlName, value);
- }
- }
-
- return epInv;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the server side, generate the payload from OUT parameters. */
- public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
- {
- log.debug("bindResponseMessage: " + opMetaData.getQName());
-
- try
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- // Associate current message with message context
- SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
- msgContext.setSOAPMessage(resMessage);
-
- // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains a SOAP envelope.
- // Specifically, the HTTP response entity-body must be empty.
- if (opMetaData.isOneWayOperation())
- {
- resMessage.getSOAPPart().setContent(null);
- return resMessage;
- }
-
- SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
- SOAPHeader soapHeader = soapEnvelope.getHeader();
- SOAPBody soapBody = soapEnvelope.getBody();
-
- // Get the namespace registry
- NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
-
- Style style = opMetaData.getStyle();
- if (style == Style.RPC)
- {
- QName opQName = opMetaData.getResponseName();
-
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
- SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
-
- soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
-
- // Add the return to the message
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (retMetaData != null)
- {
- Object value = epInv.getReturnValue();
- if (retMetaData.isSwA())
- {
- CIDGenerator cidGenerator = resMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
- resMessage.addAttachmentPart(part);
- epInv.setReturnValue(part);
- }
- else
- {
- SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBodyElement);
- epInv.setReturnValue(soapElement);
- soapElement.setObjectValue(value);
- }
- }
-
- // Add the out parameters to the message
- for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- Object value = epInv.getResponseParamValue(xmlName);
- if (paramMetaData.isSwA())
- {
- CIDGenerator cidGenerator = resMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
- resMessage.addAttachmentPart(part);
- }
- else
- {
- if (paramMetaData.isInHeader())
- {
- addParameterToMessage(paramMetaData, value, soapHeader);
- }
- else
- {
- addParameterToMessage(paramMetaData, value, soapBodyElement);
- }
- }
- }
- }
- else if (style == Style.DOCUMENT)
- {
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (retMetaData != null)
- {
- Object value = epInv.getReturnValue();
- if (opMetaData.isDocumentWrapped())
- value = ParameterWrapping.wrapResponseParameter(opMetaData, value);
-
- if (retMetaData.isSwA())
- {
- CIDGenerator cidGenerator = resMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
- resMessage.addAttachmentPart(part);
- epInv.setReturnValue(part);
- }
- else
- {
- SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBody);
- epInv.setReturnValue(soapElement);
- }
- }
-
- // Add the out header parameters to the message
- for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- if (paramMetaData.isInHeader())
- {
- Object value = epInv.getResponseParamValue(xmlName);
- addParameterToMessage(paramMetaData, value, soapHeader);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
-
- return resMessage;
- }
- catch (Exception e)
- {
- handleException(e);
- return null;
- }
- }
-
- /** On the client side, extract the OUT parameters from the payload and return them to the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, Object payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
- {
- log.debug("unbindResponseMessage: " + opMetaData.getQName());
-
- try
- {
- // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains a SOAP envelope.
- // Specifically, the HTTP response entity-body must be empty.
- if (opMetaData.isOneWayOperation() == true)
- {
- return;
- }
-
- // WS-Addressing might redirect the response, which results in an empty envelope
- SOAPMessage resMessage = (SOAPMessage)payload;
- SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
- if (soapEnvelope == null)
- {
- return;
- }
-
- // Verify the SOAP version
- verifySOAPVersion(opMetaData, soapEnvelope);
-
- // Get the SOAP message context that is associated with the current thread
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- SOAPHeader soapHeader = soapEnvelope.getHeader();
- SOAPBody soapBody = soapEnvelope.getBody();
- Iterator bodyChildren = soapBody.getChildElements();
-
- SOAPBodyElement soapBodyElement = null;
- if (bodyChildren.hasNext() != false)
- soapBodyElement = (SOAPBodyElement)bodyChildren.next();
-
- // Translate the SOAPFault to an exception and throw it
- if (soapBodyElement instanceof SOAPFaultImpl)
- {
- SOAPFaultImpl soapFault = (SOAPFaultImpl)soapBodyElement;
- SOAPFaultException faultEx = SOAPFaultExceptionHelper.getSOAPFaultException(soapFault);
- throw faultEx;
- }
-
- // Extract unbound OUT headers
- if (unboundHeaders != null)
- {
- Map<QName, UnboundHeader> outHeaders = new HashMap<QName, UnboundHeader>();
- Iterator itHeaderElements = soapHeader.getChildElements();
- while (itHeaderElements.hasNext())
- {
- SOAPContentElement soapHeaderElement = (SOAPHeaderElementImpl)itHeaderElements.next();
- Name elName = soapHeaderElement.getElementName();
- QName xmlName = new QName(elName.getURI(), elName.getLocalName());
-
- UnboundHeader unboundHeader = (UnboundHeader)unboundHeaders.get(xmlName);
- if (unboundHeader != null)
- {
- soapHeaderElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
-
- // Do the unmarshalling
- Object value = soapHeaderElement.getObjectValue();
- unboundHeader.setHeaderValue(value);
- outHeaders.put(xmlName, unboundHeader);
- }
- }
- unboundHeaders.clear();
- unboundHeaders.putAll(outHeaders);
- }
-
- Style style = opMetaData.getStyle();
- if (style == Style.RPC)
- {
- if (soapBodyElement == null)
- throw new WSException("Cannot unbind response message with empty soap body");
-
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (retMetaData != null)
- {
- if (retMetaData.isSwA())
- {
- Object value = getAttachmentFromMessage(retMetaData, resMessage);
- epInv.setReturnValue(value);
- }
- else
- {
- Object value = getParameterFromMessage(retMetaData, soapBodyElement, false);
- epInv.setReturnValue(value);
- }
- }
-
- for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- if (paramMetaData.isSwA())
- {
- Object value = getAttachmentFromMessage(paramMetaData, resMessage);
- epInv.setResponseParamValue(xmlName, value);
- }
- else
- {
- SOAPElement soapElement = paramMetaData.isInHeader() ? soapHeader : (SOAPElement)soapBodyElement;
- Object value = getParameterFromMessage(paramMetaData, soapElement, false);
- epInv.setResponseParamValue(xmlName, value);
- }
- }
- }
- else if (style == Style.DOCUMENT)
- {
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
-
- // WS-Eventing has no message part for UnsubscribeResponseMsg
- if (retMetaData != null)
- {
- if (retMetaData.isSwA())
- {
- Object value = getAttachmentFromMessage(retMetaData, resMessage);
- epInv.setReturnValue(value);
- }
- else
- {
- Object value = getParameterFromMessage(retMetaData, soapBody, false);
- epInv.setReturnValue(value);
- }
-
- for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
- {
- QName xmlName = paramMetaData.getXmlName();
- if (paramMetaData.isInHeader())
- {
- Object value = getParameterFromMessage(paramMetaData, soapHeader, false);
- epInv.setResponseParamValue(xmlName, value);
- }
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
- }
- catch (Exception e)
- {
- handleException(e);
- }
- }
-
- private void verifySOAPVersion(OperationMetaData opMetaData, SOAPEnvelope soapEnvelope)
- {
- String envNS = soapEnvelope.getNamespaceURI();
- String bindingId = opMetaData.getEndpointMetaData().getBindingId();
- if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && Constants.NS_SOAP11_ENV.equals(envNS) == false)
- log.warn("Expected SOAP-1.1 envelope, but got: " + envNS);
-
- if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) && Constants.NS_SOAP12_ENV.equals(envNS) == false)
- log.warn("Expected SOAP-1.2 envelope, but got: " + envNS);
- }
-
- private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
- {
- String partName = paramMetaData.getXmlName().getLocalPart();
- Set mimeTypes = paramMetaData.getMimeTypes();
-
- AttachmentPart part = new AttachmentPartImpl();
- if (value instanceof DataHandler)
- {
- DataHandler handler = (DataHandler)value;
- String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
-
- if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- throw new BindingException("Mime type " + mimeType + " not allowed for parameter " + partName + " allowed types are " + mimeTypes);
-
- part.setDataHandler((DataHandler)value);
- }
- else
- {
- String mimeType = null;
- if (mimeTypes != null && mimeTypes.size() > 0)
- {
- mimeType = (String)mimeTypes.iterator().next();
- }
- else
- {
- mimeType = MimeUtils.resolveMimeType(value);
- }
-
- if (mimeType == null)
- throw new BindingException("Could not determine mime type for attachment parameter: " + partName);
-
- part.setContent(value, mimeType);
- }
-
- if (paramMetaData.isSwA())
- {
- String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
- part.setContentId(swaCID);
- }
- if (paramMetaData.isXOP())
- {
- String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
- part.setContentId(xopCID);
- }
-
- return part;
- }
-
- private Object getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
- {
- QName xmlName = paramMetaData.getXmlName();
-
- AttachmentPart part = ((SOAPMessageImpl)message).getAttachmentByPartName(xmlName.getLocalPart());
- if (part == null)
- throw new BindingException("Could not locate attachment for parameter: " + paramMetaData.getXmlName());
-
- return part;
- }
-
- /** Marshall the given parameter and add it to the SOAPMessage */
- private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData, Object value, SOAPElement soapElement) throws SOAPException, BindingException
- {
- QName xmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
-
- if (value != null && paramMetaData.isXOP() == false)
- {
- Class valueType = value.getClass();
- if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new BindingException("javaType " + javaType.getName() + " is not assignable from: " + valueType.getName());
- }
-
- // Make sure we have a prefix on qualified names
- if (xmlName.getNamespaceURI().length() > 0)
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
- xmlName = namespaceRegistry.registerQName(xmlName);
- }
-
- Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
- if (paramMetaData.isSOAPArrayParam())
- soapName = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
-
- SOAPContentElement contentElement;
- if (soapElement instanceof SOAPHeader)
- {
- contentElement = new SOAPHeaderElementImpl(soapName);
- soapElement.addChildElement(contentElement);
- }
- else
- {
- Style style = paramMetaData.getOperationMetaData().getStyle();
- if (style == Style.DOCUMENT)
- {
- contentElement = new SOAPBodyElementDoc(soapName);
- soapElement.addChildElement(contentElement);
- }
- else
- {
- contentElement = new SOAPContentElement(soapName);
- soapElement.addChildElement(contentElement);
- }
- }
-
- contentElement.setParamMetaData(paramMetaData);
-
- if (paramMetaData.isSOAPArrayParam())
- {
- log.trace("Add parameter as SOAP encoded Array");
- contentElement.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
- }
-
- // The object value needs to be set after xmime:contentType
- if (paramMetaData.isXOP())
- {
- log.trace("Add parameter as XOP");
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
- soapMessage.setXOPMessage(true);
- }
-
- contentElement.setObjectValue(value);
-
- return contentElement;
- }
-
- /** Unmarshall a message element and add it to the parameter list */
- private Object getParameterFromMessage(ParameterMetaData paramMetaData, SOAPElement soapElement, boolean optional) throws BindingException
- {
- Name xmlName = new NameImpl(paramMetaData.getXmlName());
- Name soapArrayName = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
-
- SOAPContentElement soapContentElement = null;
- Iterator childElements = soapElement.getChildElements();
- while (childElements.hasNext())
- {
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
-
- // 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();
-
- if (xmlName.equals(elName))
- {
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- break;
- }
-
- if (soapArrayName.equals(elName))
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
- {
- QName compXMLName = paramMetaData.getXmlName();
- Element compElement = DOMUtils.getFirstChildElement(aux);
- if (compElement.getNodeName().equals(compXMLName.getLocalPart()))
- {
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- break;
- }
- }
- finally
- {
- msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
- }
- }
-
- // If matching by name fails, try to match by xmlType
- // This maybe necessary when wsa:Action dispatches to the operation
- if (soapContentElement == null)
- {
- childElements = soapElement.getChildElements();
- OperationMetaData opMetaData = paramMetaData.getOperationMetaData();
- TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- if (childElements.hasNext() && opMetaData.getStyle() == Style.DOCUMENT)
- {
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
-
- // The parameters are expected to be lazy
- SOAPContentElement aux = (SOAPContentElement)childElement;
- Name elName = aux.getElementName();
- QName elType = null;
-
- XSElementDeclaration xsdElement = typesMetaData.getSchemaModel().getElementDeclaration(elName.getLocalName(), elName.getURI());
- if (xsdElement != null && xsdElement.getTypeDefinition() != null)
- {
- XSTypeDefinition xsdType = xsdElement.getTypeDefinition();
- elType = new QName(xsdType.getNamespace(), xsdType.getName());
- }
-
- if (paramMetaData.getXmlType().equals(elType))
- {
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- }
- }
- }
-
- if (soapContentElement == null && optional == false)
- throw new JAXRPCException("Cannot find child element: " + xmlName);
-
- if (paramMetaData.isXOP())
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
- soapMessage.setXOPMessage(true);
- }
- return soapContentElement;
- }
-
- private void handleException(Exception ex) throws BindingException
- {
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- if (ex instanceof BindingException)
- throw (BindingException)ex;
-
- throw new BindingException(ex);
- }
-}
Modified: trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -33,11 +33,10 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.Service.Mode;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.Style;
import org.jboss.ws.jaxrpc.TypeMappingImpl;
import org.jboss.ws.jaxrpc.Use;
@@ -115,7 +114,7 @@
this.type = type;
// The default binding
- this.bindingId = SOAPBinding.SOAP11HTTP_BINDING;
+ this.bindingId = CommonSOAPBinding.SOAP11HTTP_BINDING;
}
public ServiceMetaData getServiceMetaData()
@@ -167,7 +166,7 @@
public void setBindingId(String bindingId)
{
- if (!SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && !SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) && !HTTPBinding.HTTP_BINDING.equals(bindingId))
+ if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && !CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
throw new WSException("Unsupported binding: " + bindingId);
this.bindingId = bindingId;
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -170,7 +170,7 @@
buffer.append("<jaxrpc-mapping-file>"+jaxrpcMappingFile+"</jaxrpc-mapping-file>");
for(PortComponentMetaData pm:portComponents)
buffer.append(pm.serialize());
- buffer.append("</webservice-description></webservices>");
+ buffer.append("</webservice-description>");
return buffer.toString();
}
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -31,7 +31,6 @@
import org.jboss.ws.Constants;
-
// $Id$
/**
@@ -88,6 +87,7 @@
createHeader( buffer,qnames );
for(WebserviceDescriptionMetaData wm:webserviceDescriptions)
buffer.append(wm.serialize());
+ buffer.append("</webservices>");
return buffer.toString();
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -172,7 +172,6 @@
public XSNamedMap getComponentsByNamespace(short objectType, String namespace)
{
JBossXSNamedMap map = new JBossXSNamedMap();
- ;
JBossXSNamespaceItem ni = nsimap.get(namespace);
if (ni == null)
@@ -659,7 +658,10 @@
else name = type.getName();
if (type.getAnonymous())
+ {
anonymousTypeMap.put(namespace + ":" + name, type);
+ log.debug("Registered as anon type: {" + namespace + ":" + name + "} -> " + type);
+ }
return name;
}
@@ -740,4 +742,4 @@
return anonymousTypeMap;
}
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -42,10 +42,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
import org.jboss.ws.jaxrpc.handler.HandlerDelegateJAXRPC;
-import org.jboss.ws.jaxws.core.BindingImpl;
import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.jaxws.handler.HandlerDelegateJAXWS;
import org.jboss.ws.metadata.EndpointMetaData;
@@ -67,22 +68,23 @@
// provide logging
private static Logger log = Logger.getLogger(AbstractServiceEndpointInvoker.class);
- protected BindingProvider bindingProvider;
+ protected CommonBindingProvider bindingProvider;
protected HandlerDelegate handlerDelegate;
/** Initialize the service endpoint */
public void initServiceEndpoint(ServiceEndpointInfo seInfo)
{
ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
- bindingProvider = new BindingProviderImpl(sepMetaData);
if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
{
+ bindingProvider = new CommonBindingProvider(sepMetaData);
handlerDelegate = new HandlerDelegateJAXRPC();
}
else
{
- Binding binding = bindingProvider.getBinding();
+ bindingProvider = new BindingProviderImpl(sepMetaData);
+ Binding binding = ((BindingProvider)bindingProvider).getBinding();
handlerDelegate = new HandlerDelegateJAXWS(binding);
}
}
@@ -131,7 +133,7 @@
try
{
boolean oneway = false;
- BindingImpl binding = null;
+ CommonBinding binding = null;
EndpointInvocation epInv = null;
OperationMetaData opMetaData = null;
@@ -142,7 +144,7 @@
if (handlersPass)
{
// Get the binding from the provideer
- binding = (BindingImpl)bindingProvider.getBinding();
+ binding = bindingProvider.getCommonBinding();
// Get the operation meta data from the SOAP message
opMetaData = getDispatchDestination(epMetaData, reqMessage);
Modified: trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -529,7 +529,7 @@
ServerEndpointMetaData sepMetaData = wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
sepMetaData.clearHandlers();
-
+
for (HandlerMetaData handlerMetaData : handlers)
{
handlerMetaData.setEndpointMetaData(sepMetaData);
Modified: trunk/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -35,10 +35,9 @@
import javax.xml.soap.SOAPHeader;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxws.core.SOAPBindingImpl;
+import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -52,7 +51,7 @@
public class SAAJPayloadBuilderDOM implements PayloadBuilder
{
// provide logging
- private static Logger log = Logger.getLogger(SOAPBindingImpl.class);
+ private static Logger log = Logger.getLogger(SAAJPayloadBuilderDOM.class);
private Style style = Style.DOCUMENT;
Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -43,8 +43,6 @@
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.util.socket.RemotingSSLSocketFactory;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.binding.soap.SOAPMessageMarshaller;
import org.jboss.ws.binding.soap.SOAPMessageUnMarshaller;
import org.jboss.ws.jaxrpc.StubExt;
@@ -342,4 +340,4 @@
return metadata;
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -27,7 +27,6 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.ws.soap.SOAPBinding;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -36,11 +36,11 @@
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.holders.ByteArrayHolder;
import javax.xml.rpc.holders.Holder;
-import javax.xml.ws.soap.SOAPBinding;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.jaxrpc.Style;
import org.jboss.ws.metadata.EndpointMetaData;
@@ -130,9 +130,9 @@
wsdl.registerNamespaceURI(Constants.NS_SCHEMA_XSD, Constants.PREFIX_XSD);
if (wsdlNamespace.equals(Constants.NS_WSDL11))
{
- if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
wsdl.registerNamespaceURI(Constants.NS_SOAP11, Constants.PREFIX_SOAP11);
- else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ else if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
wsdl.registerNamespaceURI(Constants.NS_SOAP12, Constants.PREFIX_SOAP12);
}
}
Modified: trunk/src/main/java/org/jboss/ws/utils/MimeUtils.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/utils/MimeUtils.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/main/java/org/jboss/ws/utils/MimeUtils.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -189,7 +189,7 @@
return converter;
}
- public static ByteArrayConverter getConverterForContentType(String contentType)
+ public static ByteArrayConverter getConverterForContentType(String contentType)
{
ByteArrayConverter converter = null;
@@ -206,7 +206,7 @@
}
if(null == converter)
- throw new WSException("No ByteArrayConverter for content type: " + contentType);
+ throw new WSException("No ByteArrayConverter for content type: " + contentType);
return converter;
}
@@ -349,4 +349,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/src/test/build.xml
===================================================================
--- trunk/src/test/build.xml 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/test/build.xml 2006-09-13 15:36:49 UTC (rev 950)
@@ -98,7 +98,7 @@
</target>
<!--
- Init the various classpaths
+ Init the various classpaths
-->
<target name="init" depends="prepare,thirdparty">
@@ -111,6 +111,13 @@
<isset property="HAVE_JDK_1.5"/>
</condition>
+ <!-- Check that the latest build has been deployed -->
+ <condition property="jbossws.deployed">
+ <filesmatch file1="${jboss.client}/${jbossws.client.jar}" file2="${build.lib.dir}/${jbossws.client.jar}"/>
+ </condition>
+ <fail message="jbossws not delpoyed, run 'ant deploy-jbossws'" unless="jbossws.deployed"/>
+
+ <!-- Define excluded tests -->
<property name="jbossws.target.server.${jbossws.target.server}" value="true"/>
<condition property="tests.excludesfile" value="${test.resources.dir}/tests-no-excludes.txt">
<isset property="jbossws.target.server.jboss"/>
@@ -199,7 +206,6 @@
<mkdir dir="${build.test.dir}/classes"/>
<javac destdir="${build.test.dir}/classes" debug="${javac.debug}" verbose="${javac.verbose}" deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<src path="${test.java.dir}"/>
- <!--exclude name="org/jboss/test/ws/benchmark/**"/-->
<exclude name="org/jboss/test/ws/interop/**"/>
<classpath refid="javac.classpath"/>
</javac>
Modified: trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -33,17 +33,17 @@
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.soap.SOAPBinding;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.common.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
@@ -167,7 +167,7 @@
*/
public void testBindRequestMessage() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!"});
@@ -185,7 +185,7 @@
*/
public void testBindRequestMessageWithBoundHeader() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
// Add bound header
QName xmlName = new QName("http://somens", "String_2");
@@ -209,7 +209,7 @@
*/
public void testBindRequestMessageWithUnboundHeader() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
// Add unbound header
QName xmlName = new QName("http://somens", "String_2");
@@ -235,7 +235,7 @@
*/
public void testUnbindRequestMessage() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelope.getBytes());
@@ -271,7 +271,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
assertNotNull(epInv);
@@ -293,7 +293,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
assertNotNull(epInv);
@@ -306,7 +306,7 @@
*/
public void testBindResponseMessage() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.setReturnValue("Hello World!");
@@ -324,7 +324,7 @@
*/
public void testUnbindResponseMessage() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelope.getBytes());
@@ -343,7 +343,7 @@
*/
public void testUnbindResponseMessageWithBoundHeader() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithBoundHeader.getBytes());
@@ -372,7 +372,7 @@
*/
public void testUnbindResponseMessageWithUnboundHeader() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithUnboundHeader.getBytes());
@@ -399,7 +399,7 @@
*/
public void testUnbindFaultResponse() throws Exception
{
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING).getCommonBinding();
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithFault.getBytes());
Modified: trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-09-13 15:36:49 UTC (rev 950)
@@ -38,15 +38,15 @@
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.soap.SOAPBinding;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
+import org.jboss.ws.common.CommonSOAPBinding;
import org.jboss.ws.jaxrpc.CallImpl;
import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.jaxws.core.BindingImpl;
-import org.jboss.ws.jaxws.core.BindingProviderImpl;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.MessageFactoryImpl;
@@ -145,7 +145,7 @@
MessageContextAssociation.pushMessageContext(messageContext);
messageContext.setOperationMetaData(opMetaData);
- BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP11HTTP_BINDING).getBinding();
+ CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonSOAPBinding.SOAP11HTTP_BINDING).getCommonBinding();
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!", "hi"});
Modified: trunk/src/test/resources/jaxrpc/wsse/webclient/WEB-INF/jboss-web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/wsse/webclient/WEB-INF/jboss-web.xml 2006-09-13 10:53:54 UTC (rev 949)
+++ trunk/src/test/resources/jaxrpc/wsse/webclient/WEB-INF/jboss-web.xml 2006-09-13 15:36:49 UTC (rev 950)
@@ -15,4 +15,5 @@
<config-name>Standard WSSecurity Client</config-name>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-wsse-rpc/Hello?wsdl</wsdl-override>
</service-ref>
+
</jboss-web>
More information about the jboss-svn-commits
mailing list