[jboss-svn-commits] JBL Code SVN: r17122 - labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Dec 8 17:39:53 EST 2007


Author: mark.little at jboss.com
Date: 2007-12-08 17:39:53 -0500 (Sat, 08 Dec 2007)
New Revision: 17122

Modified:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1400 and http://jira.jboss.com/jira/browse/JBESB-1397

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java	2007-12-08 22:27:06 UTC (rev 17121)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java	2007-12-08 22:39:53 UTC (rev 17122)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.actions.soap;
 
 import java.io.*;
@@ -148,7 +170,7 @@
  * Option 2 (above) provides a quick-and-dirty way to populate a SOAP message without having to create an Object
  * model ala Option 1.  The OGNL expressions that correspond with the SOAP operation parameters are exactly the same
  * as for Option 1, except that there's not Object Graph Navigation involved.  The OGNL expression is simply used as
- * the key into the {@link Map}, with the corresponding key-value being the parameter. 
+ * the key into the {@link Map}, with the corresponding key-value being the parameter.
  *
  * <h2>SOAP Response Message Consumption</h2>
  * The SOAP response object instance can be is attached to the ESB {@link Message} instance in one of the
@@ -215,10 +237,10 @@
  * with a Smooks transformation configuration property as follows:
  * <pre>
  *     &lt;property name="smooksTransform" value="/transforms/order-transform.xml" /&gt;</pre>
- * 
+ *
  * The value of the "smooksTransform" property is resolved by first checking it as a filesystem based resource.
- * Failing that, it's checked as a classpath resource and failing that, as a URI based resource. 
- * 
+ * Failing that, it's checked as a classpath resource and failing that, as a URI based resource.
+ *
  * <h3>Specifying a different SOAP schema</h3>
  * <pre>
  *    &lt;property name="SOAPNS" value="http://www.w3.org/2009/09/soap-envelope"/&gt;
@@ -295,7 +317,7 @@
     public void initialise() throws ActionLifecycleException {
         super.initialise();
         // Create the SoapUIInvoker instance for this SOAPClient...
-        soapUIInvoker = new SoapUIInvoker();        
+        soapUIInvoker = new SoapUIInvoker();
     }
 
     private void extractHttpClientProps(ConfigTree config) {
@@ -330,6 +352,7 @@
         String request;
         try {
             request = soapUIInvoker.buildRequest(wsdl, getEndpointOperation(), params, httpClientProps, smooksTransform, soapNs);
+
         } catch (IOException e) {
             throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
         } catch (SAXException e) {
@@ -342,7 +365,7 @@
 
         return message;
     }
-    
+
     public String getSoapNS()
 	{
 		return soapNs;
@@ -361,20 +384,24 @@
 
     protected String invokeEndpoint(String request) throws ActionProcessingException {
         String endpoint;
+
         try {
             endpoint = soapUIInvoker.getEndpoint(wsdl, httpClientProps);
+
         } catch (IOException e) {
             throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
         }
         PostMethod post = new PostMethod(endpoint);
 
         post.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
-        post.setRequestHeader("SOAPAction", soapAction);
+
+        post.setRequestHeader("SOAPAction", "\"" + soapAction + "\"");  /// Customization to add quotes to Soap action
         post.setRequestEntity(new StringRequestEntity(request));
         try {
             int result = httpclient.executeMethod(post);
             if(result != HttpStatus.SC_OK) {
                 // TODO: We need to do more here!!
+
                 logger.warn("Received status code '" + result + "' on HTTP SOAP (POST) request to '" + endpoint + "'.");
             }
             return post.getResponseBodyAsString();
@@ -493,7 +520,7 @@
 
     private static DocumentBuilderFactory createDocumentBuilderFactory() {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        
+
         factory.setNamespaceAware(true);
         factory.setExpandEntityReferences(true);
 




More information about the jboss-svn-commits mailing list