[jboss-svn-commits] JBossWS SVN: r948 - in branches/tdiesler/jbossws-1.0/src: main/java/javax/xml/ws main/java/javax/xml/ws/addressing main/java/org/jboss/ws main/java/org/jboss/ws/common main/java/org/jboss/ws/deployment main/java/org/jboss/ws/integration/jboss main/java/org/jboss/ws/metadata 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 test/java/org/jboss/test/ws/common/binding test/java/org/jboss/test/ws/common/soap/attachment

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 13 06:26:48 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-09-13 06:26:12 -0400 (Wed, 13 Sep 2006)
New Revision: 948

Added:
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
Removed:
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/Binding.java
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/BindingProvider.java
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/WebServiceException.java
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/handler/
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/http/
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/soap/
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/handler/
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxws/
Modified:
   branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/addressing/AddressingException.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
   branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
   branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
   branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
Log:
Remove dependency on JAXWS for the core API

Deleted: branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/Binding.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/Binding.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/Binding.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -1,45 +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 javax.xml.ws;
-
-import java.util.List;
-
-import javax.xml.ws.handler.Handler;
-
-/**
- * The Binding interface is the base interface for JAX-WS protocol bindings.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 03-May-2006
- */
-public interface Binding
-{
-
-   /**
-    * Gets a copy of the handler chain for a protocol binding instance. 
-    * If the returned chain is modified a call to setHandlerChain  
-    * is required to configure the binding instance with the new chain.
-    */
-   List<Handler> getHandlerChain();
-
-   void setHandlerChain(List<Handler> list);
-}
\ No newline at end of file

Deleted: branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/BindingProvider.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/BindingProvider.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/BindingProvider.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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 javax.xml.ws;
-
-import java.util.Map;
-
-/**
- * The BindingProvider interface provides access to the protocol binding and 
- * associated context objects for request and response message processing.
- *  
- * @author Thomas.Diesler at jboss.com
- * @since 03-May-2006
- */
-public interface BindingProvider
-{
-   public static final String USERNAME_PROPERTY = "javax.xml.ws.security.auth.username";
-   public static final String PASSWORD_PROPERTY = "javax.xml.ws.security.auth.password";
-   public static final String ENDPOINT_ADDRESS_PROPERTY = "javax.xml.ws.service.endpoint.address";
-   public static final String SESSION_MAINTAIN_PROPERTY = "javax.xml.ws.session.maintain";
-   public static final String SOAPACTION_USE_PROPERTY = "javax.xml.ws.soap.http.soapaction.use";
-   public static final String SOAPACTION_URI_PROPERTY = "javax.xml.ws.soap.http.soapaction.uri";
-
-   Map<String, Object> getRequestContext();
-
-   Map<String, Object> getResponseContext();
-
-   Binding getBinding();
-
-}
\ No newline at end of file

Deleted: branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/WebServiceException.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/WebServiceException.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/WebServiceException.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -1,53 +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 javax.xml.ws;
-
-// $Id$
-
-/** 
- * The WebServiceException class is the base exception class for all JAX-WS 
- * API runtime exceptions.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 14-Nov-2005
- */
-public class WebServiceException extends RuntimeException
-{
-   public WebServiceException()
-   {
-   }
-
-   public WebServiceException(String message)
-   {
-      super(message);
-   }
-
-   public WebServiceException(Throwable cause)
-   {
-      super(cause);
-   }
-
-   public WebServiceException(String message, Throwable cause)
-   {
-      super(message, cause);
-   }
-}

Modified: branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/addressing/AddressingException.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/addressing/AddressingException.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/javax/xml/ws/addressing/AddressingException.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -24,9 +24,10 @@
 //$Id$
 
 import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
 
-public class AddressingException extends WebServiceException
+import org.jboss.ws.WSException;
+
+public class AddressingException extends WSException
 {
 
    protected QName code;

Added: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -0,0 +1,59 @@
+/*
+ * 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 abstract class CommonBinding 
+{
+   /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
+   public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+   /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
+   public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+
+   /** 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;
+}


Property changes on: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBinding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -0,0 +1,69 @@
+/*
+ * 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 
+{
+   private CommonBinding binding;
+   
+   public CommonBindingProvider(EndpointMetaData epMetaData)
+   {
+      initBinding(epMetaData.getBindingId());
+   }
+   
+   public CommonBindingProvider(String bindingId)
+   {
+      initBinding(bindingId);
+   }
+
+   private void initBinding(String bindingId)
+   {
+      if (CommonBinding.SOAP11HTTP_BINDING.equals(bindingId))
+      {
+         binding = new CommonSOAP11Binding();
+      }
+      else if (CommonBinding.SOAP12HTTP_BINDING.equals(bindingId))
+      {
+         binding = new CommonSOAP12Binding();
+      }
+      else
+      {
+         throw new WSException("Unsupported binding: " + bindingId);
+      }
+   }
+
+   public CommonBinding getBinding()
+   {
+      return binding;
+   }
+}


Property changes on: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonBindingProvider.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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;
@@ -81,7 +78,7 @@
    protected EndpointInvocation epInv;
    
    // The binding provider
-   private BindingProvider bindingProvider;
+   private CommonBindingProvider bindingProvider;
 
    /** Create a call that needs to be configured manually
     */
@@ -238,7 +235,7 @@
       try
       {
          // Get the binding from the provider
-         BindingImpl binding = (BindingImpl)getBindingProvider().getBinding();
+         CommonBinding binding = (CommonBinding)getBindingProvider().getBinding();
 
          // Create the invocation and sync the input parameters
          epInv = new EndpointInvocation(opMetaData);
@@ -348,11 +345,11 @@
       }
    }
 
-   public BindingProvider getBindingProvider()
+   public CommonBindingProvider getBindingProvider()
    {
       if (bindingProvider == null)
       {
-         bindingProvider = new BindingProviderImpl(getEndpointMetaData());
+         bindingProvider = new CommonBindingProvider(getEndpointMetaData());
       }
       return bindingProvider;
    }

Added: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -0,0 +1,103 @@
+/*
+ * 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 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.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 CommonSOAP11Binding extends CommonSOAPBinding
+{
+   // provide logging
+   private static Logger log = Logger.getLogger(CommonSOAPBinding.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;
+   }
+}


Property changes on: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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.common;
+
+// $Id$
+
+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 CommonSOAP12Binding extends CommonSOAPBinding
+{
+   /** 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();
+   }
+}


Property changes on: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -0,0 +1,872 @@
+/*
+ * 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 extends CommonBinding 
+{
+   // provide logging
+   private static Logger log = Logger.getLogger(CommonSOAPBinding.class);
+
+   private boolean mtomEnabled;
+
+   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 (CommonBinding.SOAP11HTTP_BINDING.equals(bindingId) && Constants.NS_SOAP11_ENV.equals(envNS) == false)
+         log.warn("Expected SOAP-1.1 envelope, but got: " + envNS);
+
+      if (CommonBinding.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);
+   }
+}


Property changes on: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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.CommonBinding;
 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(CommonBinding.SOAP11HTTP_BINDING);
       else if (Constants.NS_SOAP12.equals(bindingType))
-         epMetaData.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
+         epMetaData.setBindingId(CommonBinding.SOAP12HTTP_BINDING);
    }
 
    /** Initialize the endpoint encoding style from the binding operations

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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.getBinding();
                SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
                msgContext.setSOAPMessage(resMessage);
             }

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -32,10 +32,10 @@
 import javax.jws.soap.SOAPBinding.ParameterStyle;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.soap.SOAPBinding;
 
 import org.jboss.logging.Logger;
 import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonBinding;
 import org.jboss.ws.jaxrpc.Style;
 import org.jboss.ws.jaxrpc.TypeMappingImpl;
 import org.jboss.ws.jaxrpc.Use;
@@ -109,7 +109,7 @@
       this.type = type;
 
       // The default binding
-      this.bindingId = SOAPBinding.SOAP11HTTP_BINDING;
+      this.bindingId = CommonBinding.SOAP11HTTP_BINDING;
    }
 
    public ServiceMetaData getServiceMetaData()
@@ -161,7 +161,7 @@
 
    public void setBindingId(String bindingId)
    {
-      if (!SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && !SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+      if (!CommonBinding.SOAP11HTTP_BINDING.equals(bindingId) && !CommonBinding.SOAP12HTTP_BINDING.equals(bindingId))
          throw new WSException("Unsupported binding: " + bindingId);
       this.bindingId = bindingId;
    }

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -35,16 +35,15 @@
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
 
 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.metadata.EndpointMetaData;
 import org.jboss.ws.metadata.OperationMetaData;
 import org.jboss.ws.metadata.ServerEndpointMetaData;
@@ -64,14 +63,14 @@
    // 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);
+      bindingProvider = new CommonBindingProvider(sepMetaData);
       handlerDelegate = new HandlerDelegateJAXRPC();
    }
 
@@ -119,7 +118,7 @@
       try
       {
          boolean oneway = false;
-         BindingImpl binding = null;
+         CommonBinding binding = null;
          EndpointInvocation epInv = null;
          OperationMetaData opMetaData = null;
 
@@ -130,7 +129,7 @@
          if (handlersPass)
          {
             // Get the binding from the provideer
-            binding = (BindingImpl)bindingProvider.getBinding();
+            binding = (CommonBinding)bindingProvider.getBinding();
 
             // Get the operation meta data from the SOAP message
             opMetaData = getDispatchDestination(epMetaData, reqMessage);

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -37,8 +37,8 @@
 import org.jboss.logging.Logger;
 import org.jboss.ws.utils.DOMUtils;
 import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonSOAPBinding;
 import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxws.core.SOAPBindingImpl;
 import org.jboss.ws.utils.DOMWriter;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -52,7 +52,7 @@
 public class SAAJPayloadBuilderDOM implements PayloadBuilder
 {
    // provide logging
-   private static Logger log = Logger.getLogger(SOAPBindingImpl.class);
+   private static Logger log = Logger.getLogger(CommonSOAPBinding.class);
    
    private Style style = Style.DOCUMENT;
 

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -36,7 +36,6 @@
 import javax.xml.soap.SOAPEnvelope;
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
 import javax.xml.ws.addressing.EndpointReference;
 
 import org.jboss.logging.Logger;
@@ -68,8 +67,6 @@
    {
       metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
       metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
-      metadataMap.put(BindingProvider.USERNAME_PROPERTY, "http.basic.username");
-      metadataMap.put(BindingProvider.PASSWORD_PROPERTY, "http.basic.password");
    }
    private static Map<String, String> configMap = new HashMap<String, String>();
    static

Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -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.CommonBinding;
 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 (CommonBinding.SOAP11HTTP_BINDING.equals(bindingId))
             wsdl.registerNamespaceURI(Constants.NS_SOAP11, Constants.PREFIX_SOAP11);
-         else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+         else if (CommonBinding.SOAP12HTTP_BINDING.equals(bindingId))
             wsdl.registerNamespaceURI(Constants.NS_SOAP12, Constants.PREFIX_SOAP12);
       }
    }

Modified: branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -33,17 +33,16 @@
 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.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 +166,7 @@
     */
    public void testBindRequestMessage() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       EndpointInvocation epInv = new EndpointInvocation(opMetaData);
       epInv.initInputParams(new Object[]{"Hello World!"});
@@ -185,7 +184,7 @@
     */
    public void testBindRequestMessageWithBoundHeader() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       // Add bound header
       QName xmlName = new QName("http://somens", "String_2");
@@ -209,7 +208,7 @@
     */
    public void testBindRequestMessageWithUnboundHeader() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       // Add unbound header
       QName xmlName = new QName("http://somens", "String_2");
@@ -235,7 +234,7 @@
     */
    public void testUnbindRequestMessage() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelope.getBytes());
 
@@ -271,7 +270,7 @@
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
       msgContext.setSOAPMessage(reqMessage);
 
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
       EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
       assertNotNull(epInv);
 
@@ -293,7 +292,7 @@
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
       msgContext.setSOAPMessage(reqMessage);
 
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
       EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
       assertNotNull(epInv);
 
@@ -306,7 +305,7 @@
     */
    public void testBindResponseMessage() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       EndpointInvocation epInv = new EndpointInvocation(opMetaData);
       epInv.setReturnValue("Hello World!");
@@ -324,7 +323,7 @@
     */
    public void testUnbindResponseMessage() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelope.getBytes());
 
@@ -343,7 +342,7 @@
     */
    public void testUnbindResponseMessageWithBoundHeader() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithBoundHeader.getBytes());
 
@@ -372,7 +371,7 @@
     */
    public void testUnbindResponseMessageWithUnboundHeader() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithUnboundHeader.getBytes());
 
@@ -399,7 +398,7 @@
     */
    public void testUnbindFaultResponse() throws Exception
    {
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP12HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP12HTTP_BINDING).getBinding();
 
       ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithFault.getBytes());
 

Modified: branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java	2006-09-13 08:48:05 UTC (rev 947)
+++ branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java	2006-09-13 10:26:12 UTC (rev 948)
@@ -38,15 +38,14 @@
 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.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 +144,7 @@
       MessageContextAssociation.pushMessageContext(messageContext);
       messageContext.setOperationMetaData(opMetaData);
 
-      BindingImpl binding = (BindingImpl)new BindingProviderImpl(SOAPBinding.SOAP11HTTP_BINDING).getBinding();
+      CommonBinding binding = (CommonBinding)new CommonBindingProvider(CommonBinding.SOAP11HTTP_BINDING).getBinding();
 
       EndpointInvocation epInv = new EndpointInvocation(opMetaData);
       epInv.initInputParams(new Object[]{"Hello World!", "hi"});




More information about the jboss-svn-commits mailing list