[jboss-svn-commits] JBossWS SVN: r750 - in branches/jbossws-1.0/src/main/java/org/jboss/ws: binding/soap soap

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Aug 14 17:35:14 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-08-14 17:35:10 -0400 (Mon, 14 Aug 2006)
New Revision: 750

Modified:
   branches/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAP11BindingProvider.java
   branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
Log:
[JBWS-983] Configure SOAPAction on the Call object

Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAP11BindingProvider.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAP11BindingProvider.java	2006-08-14 20:04:18 UTC (rev 749)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAP11BindingProvider.java	2006-08-14 21:35:10 UTC (rev 750)
@@ -1,24 +1,24 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.ws.binding.soap;
 
 // $Id$
@@ -26,16 +26,20 @@
 import java.util.Map;
 
 import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
 import javax.xml.soap.MimeHeaders;
 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.metadata.OperationMetaData;
+import org.jboss.ws.soap.MessageContextAssociation;
 import org.jboss.ws.soap.MessageFactoryImpl;
+import org.jboss.ws.soap.SOAPMessageContextImpl;
 
 /** A BindingProvider that implements the SOAP-1.1 specifics.
  *
@@ -44,6 +48,9 @@
  */
 public class SOAP11BindingProvider extends SOAPBindingProvider
 {
+   // provide logging
+   private static final Logger log = Logger.getLogger(SOAP11BindingProvider.class);
+
    /** Create the SOAP-1.1 message */
    protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
    {
@@ -51,17 +58,35 @@
       factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
       return factory.createMessage();
    }
-   
+
    /** On the client side, generate the payload from IN parameters. */
    public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
    {
       SOAPMessage reqMessage = 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.
+
+      SOAPMessageContextImpl 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;
    }
 }

Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java	2006-08-14 20:04:18 UTC (rev 749)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java	2006-08-14 21:35:10 UTC (rev 750)
@@ -222,7 +222,8 @@
       // 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.
-
+	   
+	   // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
       MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
       String[] action = mimeHeaders.getHeader("SOAPAction");
       if (action != null && action.length > 0)




More information about the jboss-svn-commits mailing list