Index: java/src/org/apache/wsif/WSIFServiceFactory.java
===================================================================
RCS file: /home/cvspublic/ws-wsif/java/src/org/apache/wsif/WSIFServiceFactory.java,v
retrieving revision 1.12
diff -u -r1.12 WSIFServiceFactory.java
--- java/src/org/apache/wsif/WSIFServiceFactory.java	6 Mar 2003 15:54:40 -0000	1.12
+++ java/src/org/apache/wsif/WSIFServiceFactory.java	27 Jan 2004 22:56:57 -0000
@@ -63,7 +63,9 @@
 import javax.wsdl.Service;
 
 import org.apache.wsif.base.WSIFServiceFactoryImpl;
+import org.apache.wsif.logging.MessageLogger;
 import org.apache.wsif.logging.Trc;
+import org.apache.wsif.util.WSIFProperties;
 import org.apache.wsif.util.WSIFUtils;
 
 /**
@@ -75,6 +77,8 @@
  */
 public abstract class WSIFServiceFactory {
 
+    private static final String SERVICE_FACTORY_PROPERTY = "wsif.servicefactory";
+
     /** 
      * Creates a new instance of an implementation the abstract
      * WSIFServiceFactory class.
@@ -82,7 +86,28 @@
     public static WSIFServiceFactory newInstance() {
         Trc.entry(null);
 
-        WSIFServiceFactoryImpl wsf = new WSIFServiceFactoryImpl();
+        WSIFServiceFactory wsf;
+    
+        String serviceFactoryName = WSIFProperties.getProperty(SERVICE_FACTORY_PROPERTY);
+        if ( serviceFactoryName == null ) {
+            wsf = new WSIFServiceFactoryImpl();
+        } else {
+            try {
+                wsf = (WSIFServiceFactory)Thread.currentThread().getContextClassLoader().loadClass(serviceFactoryName).newInstance();
+            } catch (InstantiationException e) {
+                Trc.exception(e);
+                MessageLogger.log("WSIF.0012W",new String[] {serviceFactoryName,e.getClass().getName(),e.getMessage()});
+                wsf = new WSIFServiceFactoryImpl();
+            } catch (IllegalAccessException e) {
+                Trc.exception(e);
+                MessageLogger.log("WSIF.0012W",new String[] {serviceFactoryName,e.getClass().getName(),e.getMessage()});
+                wsf = new WSIFServiceFactoryImpl();
+            } catch (ClassNotFoundException e) {
+                Trc.exception(e);
+                MessageLogger.log("WSIF.0012W",new String[] {serviceFactoryName,e.getClass().getName(),e.getMessage()});
+                wsf = new WSIFServiceFactoryImpl();
+            }
+        }
 
         // Create the simple types map for use by other WSIF classes
         WSIFUtils.createSimpleTypesMap();
Index: java/src/org/apache/wsif/catalog/Messages.properties
===================================================================
RCS file: /home/cvspublic/ws-wsif/java/src/org/apache/wsif/catalog/Messages.properties,v
retrieving revision 1.7
diff -u -r1.7 Messages.properties
--- java/src/org/apache/wsif/catalog/Messages.properties	7 Dec 2002 12:33:57 -0000	1.7
+++ java/src/org/apache/wsif/catalog/Messages.properties	27 Jan 2004 22:56:58 -0000
@@ -63,3 +63,13 @@
 # Parameter(s):    {0} the user's preferred port
 # Description:     The preferred port set by the user on org.apache.wsif.WSIFService is not available
 # User Action:     None unless this message appears for long periods of time in which case the user might want to pick a different port as their preferred port
+
+WSIF.0012W=WSIF0012W: Could not create instance of custom WSIFServiceFactory ''{0}'', using default instead. This was due to a ''{1}'': ''{2}''
+# Parameter(s):    {0} the class name of the custom factory.
+#                  {1} the class name of the exception causing the failure.
+#                  {2} the text of the message from the exception.
+# Description:     Failed to instantiate the custom WSIFServiceFactory for some reason.
+# User Action:     This could indicate the the class was not found, or not accessible. The user should check that 
+#                  the class name is correct, that the class is available from the calling thread's context classloader
+#                  and that the class is publicly accessible. Additionally, the class must have a default (no argument)
+#                  constructor, which must also be publicly accessible.
