Author: indika
Date: Mon Dec 22 00:56:32 2008
New Revision: 27580
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=27580

Log:
fix for CARBON-1537

Modified:
   
branches/synapse/1.2.wso2v1/modules/samples/src/main/java/samples/userguide/MTOMSwAClient.java

Modified: 
branches/synapse/1.2.wso2v1/modules/samples/src/main/java/samples/userguide/MTOMSwAClient.java
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/samples/src/main/java/samples/userguide/MTOMSwAClient.java?rev=27580&r1=27579&r2=27580&view=diff
==============================================================================
--- 
branches/synapse/1.2.wso2v1/modules/samples/src/main/java/samples/userguide/MTOMSwAClient.java
      (original)
+++ 
branches/synapse/1.2.wso2v1/modules/samples/src/main/java/samples/userguide/MTOMSwAClient.java
      Mon Dec 22 00:56:32 2008
@@ -19,21 +19,21 @@
 
 package samples.userguide;
 
+import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.*;
+import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.Constants;
-import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.OperationClient;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.wsdl.WSDLConstants;
 
-import javax.activation.FileDataSource;
 import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
 import javax.xml.namespace.QName;
 import java.io.*;
 
@@ -51,8 +51,18 @@
 
     public static void main(String[] args) throws Exception {
 
+        File defaultFile = new 
File("./../../repository/conf/sample/resources/mtom/asf-logo.gif");
+
+        if (!defaultFile.exists()) {
+            defaultFile = new 
File("./../../repository/sample/resources/mtom/asf-logo.gif");
+
+            if (!defaultFile.exists()) {
+                System.out.println("WARNING : Default file used in the 
MTOMSwASample isn't exists. ");
+            }
+        }
+        
         String targetEPR = getProperty("opt_url", 
"http://localhost:8280/soap/MTOMSwASampleService";);
-        String fileName = getProperty("opt_file", 
"./../../repository/conf/sample/resources/mtom/asf-logo.gif");
+        String fileName = getProperty("opt_file", 
defaultFile.getAbsolutePath());
         String mode = getProperty("opt_mode", "mtom");
 
         if (args.length > 0) mode = args[0];

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to