[jboss-svn-commits] JBossWS SVN: r1012 - in trunk/src/main/java/org/jboss/ws: common deployment jaxrpc metadata/wsdl

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 19 11:05:21 EDT 2006


Author: david.boeren
Date: 2006-09-19 11:05:15 -0400 (Tue, 19 Sep 2006)
New Revision: 1012

Modified:
   trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
   trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
   trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
   trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java
   trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
   trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java
Log:
Fix for JBWS-1171, added support for SOAPAction for 1.2 style webservices.

Modified: trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -32,7 +32,6 @@
 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;
@@ -50,9 +49,6 @@
  */
 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
    {
@@ -69,35 +65,4 @@
          
       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;
-   }
 }

Modified: trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -23,11 +23,20 @@
 
 // $Id$
 
+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.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;
 
 /**

Modified: trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -30,11 +30,13 @@
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
 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.MimeHeaders;
 import javax.xml.soap.Name;
 import javax.xml.soap.SOAPBody;
 import javax.xml.soap.SOAPBodyElement;
@@ -150,7 +152,6 @@
 
             log.debug("Create RPC body element: " + opName);
             SOAPBodyElement soapBodyElement = new SOAPBodyElementRpc(opName);
-            
 
             soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
 
@@ -221,6 +222,28 @@
             }
          }
 
+         // 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.
+
+         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;
       }
       catch (Exception e)

Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -153,7 +153,7 @@
 
             seiMethodMapping = seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
             if (seiMethodMapping == null)
-               throw new WSException("Cannot obtain method maping for: " + opName);
+               throw new WSException("Cannot obtain method mapping for: " + opName);
 
             javaName = seiMethodMapping.getJavaMethodName();
          }

Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -33,6 +33,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.rpc.Call;
 import javax.xml.rpc.JAXRPCException;
 import javax.xml.rpc.Stub;
 import javax.xml.rpc.soap.SOAPFaultException;

Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java	2006-09-19 15:00:02 UTC (rev 1011)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java	2006-09-19 15:05:15 UTC (rev 1012)
@@ -831,8 +831,8 @@
          {
             Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
             operationStyle = getOptionalAttribute(domElement, "style");
+            destBindingOperation.setSOAPAction(getOptionalAttribute(domElement, "soapAction"));
          }
-
       }
       destIntfOperation.setStyle(operationStyle != null ? operationStyle : bindingStyle);
 
@@ -1107,14 +1107,14 @@
     */
    private String getSOAPAddress(Port srcPort)
    {
-      String soapAddress = null;
+      String soapAddress = "dummy";
 
       Iterator it = srcPort.getExtensibilityElements().iterator();
       while (it.hasNext())
       {
          ExtensibilityElement extElement = (ExtensibilityElement)it.next();
          QName elementType = extElement.getElementType();
-
+         
          if (extElement instanceof SOAPAddress)
          {
             SOAPAddress addr = (SOAPAddress)extElement;
@@ -1127,6 +1127,10 @@
             soapAddress = getOptionalAttribute(domElement, "location");
             break;
          }
+         else if ("address".equals(elementType.getLocalPart()))
+         {
+            log.warn("Unprocessed extension element: " + elementType);
+         }
       }
 
       if (soapAddress == null)




More information about the jboss-svn-commits mailing list