servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r358362 - /incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java
Date Wed, 21 Dec 2005 19:47:34 GMT
Author: gnodet
Date: Wed Dec 21 11:47:30 2005
New Revision: 358362

URL: http://svn.apache.org/viewcvs?rev=358362&view=rev
Log:
Add a configurable SOAPAction header on SaajBinding

Modified:
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java?rev=358362&r1=358361&r2=358362&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajBinding.java
Wed Dec 21 11:47:30 2005
@@ -21,6 +21,7 @@
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPConnection;
 import javax.xml.soap.SOAPConnectionFactory;
 import javax.xml.soap.SOAPException;
@@ -45,6 +46,7 @@
     private SaajMarshaler marshaler = new SaajMarshaler();
     private SOAPConnectionFactory connectionFactory;
     private Object soapEndpoint;
+    private String soapAction;
 
 
     public SOAPConnectionFactory getConnectionFactory() throws SOAPException {
@@ -86,6 +88,14 @@
             connection = getConnectionFactory().createConnection();
 
             SOAPMessage inMessage = marshaler.createSOAPMessage(exchange.getMessage("in"));
+            if (soapAction != null) {
+				MimeHeaders mh = inMessage.getMimeHeaders();
+				if (mh.getHeader("SOAPAction") == null) {
+					mh.addHeader("SOAPAction", "\"" + soapAction + "\"");
+					inMessage.saveChanges();
+				}
+			}
+            
             SOAPMessage response = connection.call(inMessage, soapEndpoint);
 
             NormalizedMessage outMessage = exchange.createMessage();
@@ -117,5 +127,18 @@
         return getConnectionFactory().createConnection();
     }
 
-
+    /**
+	 * @return Returns the soapAction.
+	 */
+	public String getSoapAction() {
+		return soapAction;
+	}
+ 
+	/**
+	 * @param soapAction
+	 *            The soapAction to set.
+	 */
+	public void setSoapAction(String soapAction) {
+		this.soapAction = soapAction;
+	}
 }



Mime
View raw message