[jboss-svn-commits] JBossWS SVN: r1061 - in branches/tdiesler/trunk/src/main/java/org/jboss/ws: jaxrpc jaxws/core metadata

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 27 08:17:54 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-09-27 08:17:46 -0400 (Wed, 27 Sep 2006)
New Revision: 1061

Added:
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java
Removed:
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java
Modified:
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java
Log:


Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -23,15 +23,10 @@
 
 //$Id$
 
-import javax.xml.rpc.Call;
-import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
 
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
 import org.jboss.ws.common.CommonSOAP11Binding;
 import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
 
 /**
  * The JAXRPC SOAP11Binding  
@@ -41,32 +36,11 @@
  */
 public class SOAP11BindingJAXRPC extends CommonSOAP11Binding
 {
-   // provide logging
-   private static Logger log = Logger.getLogger(SOAP11BindingJAXRPC.class);
+   // Delegate to JAXWS SOAP binding
+   private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
 
    public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
    {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      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.
-
-      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 : "");
+      delegate.setSOAPActionHeader(opMetaData, reqMessage);
    }
-
 }

Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -23,16 +23,10 @@
 
 //$Id$
 
-import javax.xml.rpc.Call;
-import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
 
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
 import org.jboss.ws.common.CommonSOAP12Binding;
-import org.jboss.ws.common.CommonSOAPBinding;
 import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
 
 /**
  * The JAXRPC SOAP12Binding  
@@ -42,31 +36,11 @@
  */
 public class SOAP12BindingJAXRPC extends CommonSOAP12Binding
 {
-   // provide logging
-   private static Logger log = Logger.getLogger(SOAP12BindingJAXRPC.class);
+   // Delegate to JAXWS SOAP binding
+   private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
 
    public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
    {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      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.
-
-      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 : "");
+      delegate.setSOAPActionHeader(opMetaData, reqMessage);
    }
 }

Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP11BindingJAXWS.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -24,21 +24,18 @@
 // $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
 
 import java.net.URI;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.soap.SOAPBinding;
 
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.Constants;
 import org.jboss.ws.common.CommonSOAP11Binding;
 import org.jboss.ws.metadata.OperationMetaData;
 import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.MessageContextAssociation;
 
 /**
  * The JAXWS SOAP11Binding  
@@ -48,40 +45,26 @@
  */
 public class SOAP11BindingJAXWS extends CommonSOAP11Binding implements BindingExt, SOAPBinding
 {
-   // provide logging
-   private static Logger log = Logger.getLogger(SOAP11BindingJAXWS.class);
-
    // Delegate to JAXWS SOAP binding
-   private SOAPBindingDelegate delegate = new SOAPBindingDelegate();
-   
-   public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+   private SOAPBindingJAXWS delegate = new SOAPBindingJAXWS();
+
+   public SOAP11BindingJAXWS()
    {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      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.
-
-      if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
-         log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
-
-      String soapActionProperty = (String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
-      if (soapActionProperty != null)
-         soapAction = soapActionProperty;
-
-      mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");
+   public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+   {
+      delegate.setSOAPActionHeader(opMetaData, reqMessage);
    }
-   
+
    public Set<URI> getRoles()
    {
-      return delegate.getRoles();
+      // 10.3 Conformance (Default role visibility): An implementation MUST include the required next and ultimate
+      // receiver roles in the Set returned from SOAPBinding.getRoles.
+      // In SOAP 1.1 the ultimate receiver role is identified by omission of the actor attribute from a SOAP header.
+      Set<URI> soap11Roles = new HashSet<URI>(delegate.getRoles());
+      soap11Roles.add(URI.create(Constants.URI_SOAP11_NEXT_ACTOR));
+      return soap11Roles;
    }
 
    public void setRoles(Set<URI> roles)

Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAP12BindingJAXWS.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -24,21 +24,19 @@
 // $Id: SOAPBindingImpl.java 716 2006-08-09 16:42:10Z thomas.diesler at jboss.com $
 
 import java.net.URI;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.soap.SOAPBinding;
 
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.Constants;
 import org.jboss.ws.common.CommonSOAP12Binding;
 import org.jboss.ws.metadata.OperationMetaData;
 import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.MessageContextAssociation;
 
 /**
  * The SOAP11Binding  
@@ -48,44 +46,37 @@
  */
 public class SOAP12BindingJAXWS extends CommonSOAP12Binding implements BindingExt, SOAPBinding
 {
-   // provide logging
-   private static Logger log = Logger.getLogger(SOAP12BindingJAXWS.class);
-
    // Delegate to JAXWS SOAP binding
-   private SOAPBindingDelegate delegate = new SOAPBindingDelegate();
-   
-   public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+   private SOAPBindingJAXWS delegate = new SOAPBindingJAXWS();
+
+   public SOAP12BindingJAXWS()
    {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      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.
-
-      if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
-         log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
-
-      String soapActionProperty = (String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
-      if (soapActionProperty != null)
-         soapAction = soapActionProperty;
-
-      mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");
+   public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+   {
+      delegate.setSOAPActionHeader(opMetaData, reqMessage);
    }
-   
+
    public Set<URI> getRoles()
    {
-      return delegate.getRoles();
+      // 10.3 Conformance (Default role visibility): An implementation MUST include the required next and ultimate
+      // receiver roles in the Set returned from SOAPBinding.getRoles.
+      Set<URI> soap12Roles = new HashSet<URI>(delegate.getRoles());
+      soap12Roles.add(URI.create(Constants.URI_SOAP12_ROLE_NEXT));
+      soap12Roles.add(URI.create(Constants.URI_SOAP12_ROLE_ULTIMATE_RECEIVER));
+      return soap12Roles;
    }
 
    public void setRoles(Set<URI> roles)
    {
+      // 10.5 Conformance (None role error): An implementation MUST throw WebServiceException if a client
+      // attempts to configure the binding to play the none role via SOAPBinding.setRoles.
+      for (URI role : roles)
+      {
+         if (role.equals(Constants.URI_SOAP12_ROLE_NONE))
+            throw new WebServiceException("Attempt to configure the binding to play the none role");
+      }
       delegate.setRoles(roles);
    }
 

Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -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$
-
-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;
-   }
-}

Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java (from rev 1056, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingDelegate.java	2006-09-26 14:56:00 UTC (rev 1056)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/core/SOAPBindingJAXWS.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -0,0 +1,86 @@
+/*
+ * 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;
+
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.soap.MessageContextAssociation;
+
+/**
+ * The SOAPBinding interface is an abstraction for the SOAP binding. 
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 04-Jul-2006
+ */
+class SOAPBindingJAXWS extends BindingImpl 
+{
+   // provide logging
+   private static Logger log = Logger.getLogger(SOAPBindingJAXWS.class);
+   
+   private Set<URI> roles = new HashSet<URI>();
+   
+   public Set<URI> getRoles()
+   {
+      return roles;
+   }
+
+   public void setRoles(Set<URI> roles)
+   {
+      this.roles = roles;
+   }
+   
+   public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+   {
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      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.
+
+      if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
+         log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
+
+      String soapActionProperty = (String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
+      if (soapActionProperty != null)
+         soapAction = soapActionProperty;
+
+      mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");
+   }
+}

Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java	2006-09-26 16:04:46 UTC (rev 1060)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/HandlerMetaDataJAXWS.java	2006-09-27 12:17:46 UTC (rev 1061)
@@ -76,7 +76,7 @@
    {
       this.serviceNamePattern = serviceNamePattern;
    }
-
+   
    public String toString()
    {
       StringBuffer buffer = new StringBuffer("\nHandlerMetaDataJAXWS:");




More information about the jboss-svn-commits mailing list