You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/16 18:18:08 UTC

svn commit: r357187 [3/25] - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./ addressing/ client/ client/async/ context/ deployment/ deployment/listener/ deployment/repository/util/ deployment/scheduler/ deployment/util/ descripti...

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java Fri Dec 16 09:13:57 2005
@@ -39,49 +39,45 @@
  * will be getting parameters using this.
  */
 public class Options {
-    
+
+    // ==========================================================================
+    // ==========================================================================
+    // Constants
+    // ==========================================================================
+    public static final String COPY_PROPERTIES = "CopyProperties";
+    public static final int DEFAULT_TIMEOUT_MILLISECONDS = 5000;
+
+    // ==========================================================================
+
     private Options delegate = null;
-    
     private Map properties = new HashMap();
 
     // ==========================================================================
-    //    Parameters that can be set via Options
+    // Parameters that can be set via Options
     // ==========================================================================
-
     private String soapVersionURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
     private String soapAction = "";
-
     private boolean isExceptionToBeThrownOnSOAPFault = true;
     private long timeOutInMilliSeconds = DEFAULT_TIMEOUT_MILLISECONDS;
+    private boolean useSeparateListener = false;
+
+    // Addressing specific properties
+    private String action;
+    private EndpointReference faultTo;
+    private EndpointReference from;
     private TransportListener listener;
+    private TransportInDescription listenerTransport;
+    private String listenerTransportProtocol;
+    private String messageId;
+    private RelatesTo relatesTo;
+    private EndpointReference replyTo;
 
     /**
      * This is used for sending and receiving messages.
      */
     protected TransportOutDescription senderTransport;
-    private TransportInDescription listenerTransport;
-    private boolean useSeparateListener = false;
-    private String listenerTransportProtocol;
     private String senderTransportProtocol;
-
-    // Addressing specific properties
-    private String action;
-    private String messageId;
     private EndpointReference to;
-    private EndpointReference from;
-    private EndpointReference replyTo;
-    private EndpointReference faultTo;
-    private RelatesTo relatesTo;
-
-    // ==========================================================================
-
-    // ==========================================================================
-    //  Constants
-    // ==========================================================================
-    public static final String COPY_PROPERTIES = "CopyProperties";
-
-    public static final int DEFAULT_TIMEOUT_MILLISECONDS = 5000;
-    // ==========================================================================
 
     /**
      * Default constructor
@@ -90,337 +86,362 @@
     }
 
     /**
-     * Any setting in the delegate always wins. 
+     * Any setting in the delegate always wins.
+     *
      * @param delegate
      */
     public Options(Options delegate) {
         this.delegate = delegate;
     }
 
-    /**
-     * Properties you need to pass in to the message context must be set via this.
-     * If there is a method to the set this property, within this class, its encouraged to use that method,
-     * without duplicating stuff or making room for bugs.
-     *
-     * @param propertyKey
-     * @param property
-     */
-    public void setProperty(String propertyKey, Object property) {
-        properties.put(propertyKey, property);
-    }
-
-    /**
-     * @param key
-     * @return the value realeted to this key. Null, if not found.
-     */
-    public Object getProperty(String key) {
+    public String getAction() {
         if (delegate != null) {
-            Object ret = delegate.getProperty(key);
+            String ret = delegate.getAction();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return properties.get(key);
+
+        return action;
     }
 
-    public Map getProperties() {
+    public EndpointReference getFaultTo() {
         if (delegate != null) {
-            Map properties = delegate.getProperties();
-            if (properties.size() > 0) {
-                HashMap ret = new HashMap(properties);
-                ret.putAll(properties);
+            EndpointReference ret = delegate.getFaultTo();
+
+            if (ret != null) {
                 return ret;
             }
         }
-        return properties;
-    }
 
-    /**
-     * This will set the properties to the context. But in setting that one may need to "copy" all
-     * the properties from the source properties to the target properties. To enable this we introduced
-     * a property (org.apache.axis2.client.Options#COPY_PROPERTIES) so that if set to Boolean(true),
-     * this code will copy the whole thing, without just referencing to the source.
-     *
-     * @param properties
-     */
-    public void setProperties(Map properties) {
-        this.properties = properties;
+        return faultTo;
     }
 
-    public String getSoapVersionURI() {
+    public EndpointReference getFrom() {
         if (delegate != null) {
-            String ret = delegate.getSoapVersionURI();
+            EndpointReference ret = delegate.getFrom();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return soapVersionURI;
-    }
 
-    public void setSoapVersionURI(String soapVersionURI) {
-        this.soapVersionURI = soapVersionURI;
+        return from;
     }
 
-    public String getSoapAction() {
+    public TransportListener getListener() {
         if (delegate != null) {
-            String ret = delegate.getSoapAction();
+            TransportListener ret = delegate.getListener();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return soapAction;
-    }
 
-    public void setSoapAction(String soapAction) {
-        this.soapAction = soapAction;
+        return listener;
     }
 
-    /**
-     * If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to
-     * throw an exception with the details extracted from the information from the fault message.
-     * This boolean variable will enable that facility. If this is false, the response message will just
-     * be returned to the application, irrespective of whether it has a Fault or not.
-     */
-    public boolean isExceptionToBeThrownOnSOAPFault() {
+    public TransportInDescription getListenerTransport() {
         if (delegate != null) {
-            return delegate.isExceptionToBeThrownOnSOAPFault();
-        }
-        return isExceptionToBeThrownOnSOAPFault;
-    }
+            TransportInDescription ret = delegate.getListenerTransport();
 
-    /**
-     * If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to
-     * throw an exception with the details extracted from the information from the fault message.
-     * This boolean variable will enable that facility. If this is false, the response message will just
-     * be returned to the application, irrespective of whether it has a Fault or not.
-     *
-     * @param exceptionToBeThrownOnSOAPFault
-     */
+            if (ret != null) {
+                return ret;
+            }
+        }
 
-    public void setExceptionToBeThrownOnSOAPFault(boolean exceptionToBeThrownOnSOAPFault) {
-        isExceptionToBeThrownOnSOAPFault = exceptionToBeThrownOnSOAPFault;
+        return listenerTransport;
     }
 
-    /**
-     * Gets the wait time after which a client times out in a blocking scenario.
-     * The default is 2000.
-     *
-     * @return timeOutInMilliSeconds
-     */
-    public long getTimeOutInMilliSeconds() {
+    public String getListenerTransportProtocol() {
         if (delegate != null) {
-            return delegate.getTimeOutInMilliSeconds();
+            String ret = delegate.getListenerTransportProtocol();
+
+            if (ret != null) {
+                return ret;
+            }
         }
-        return timeOutInMilliSeconds;
-    }
 
-    /**
-     * This is used in blocking scenario. Client will time out after waiting this amount of time.
-     * The default is 2000 and must be provided in multiples of 100.
-     *
-     * @param timeOutInMilliSeconds
-     */
-    public void setTimeOutInMilliSeconds(long timeOutInMilliSeconds) {
-        this.timeOutInMilliSeconds = timeOutInMilliSeconds;
+        return listenerTransportProtocol;
     }
 
-    public TransportListener getListener() {
+    public String getMessageId() {
         if (delegate != null) {
-            TransportListener ret = delegate.getListener();
+            String ret = delegate.getMessageId();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return listener;
-    }
 
-    public void setListener(TransportListener listener) {
-        this.listener = listener;
+        return messageId;
     }
 
-    public TransportOutDescription getSenderTransport() {
+    public Map getProperties() {
         if (delegate != null) {
-            TransportOutDescription ret = delegate.getSenderTransport();
-            if (ret != null) {
+            Map properties = delegate.getProperties();
+
+            if (properties.size() > 0) {
+                HashMap ret = new HashMap(properties);
+
+                ret.putAll(properties);
+
                 return ret;
             }
         }
-        return senderTransport;
-    }
 
-    public void setSenderTransport(TransportOutDescription senderTransport) {
-        this.senderTransport = senderTransport;
+        return properties;
     }
 
     /**
-     * Sets the transport to be used for sending the SOAP Message
-     *
-     * @param senderTransport
-     * @throws AxisFault if the transport is not found
+     * @param key
+     * @return the value realeted to this key. Null, if not found.
      */
-    public void setSenderTransport(String senderTransport, AxisConfiguration axisConfiguration) throws AxisFault {
-        this.senderTransport =
-                axisConfiguration.getTransportOut(new QName(senderTransport));
-        if (senderTransport == null) {
-            throw new AxisFault(Messages.getMessage("unknownTransport", senderTransport));
+    public Object getProperty(String key) {
+        if (delegate != null) {
+            Object ret = delegate.getProperty(key);
+
+            if (ret != null) {
+                return ret;
+            }
         }
+
+        return properties.get(key);
     }
 
-    public TransportInDescription getListenerTransport() {
+    public RelatesTo getRelatesTo() {
         if (delegate != null) {
-            TransportInDescription ret = delegate.getListenerTransport();
+            RelatesTo ret = delegate.getRelatesTo();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return listenerTransport;
-    }
 
-    public void setListenerTransport(TransportInDescription listenerTransport) {
-        this.listenerTransport = listenerTransport;
+        return relatesTo;
     }
 
-    public boolean isUseSeparateListener() {
+    public EndpointReference getReplyTo() {
         if (delegate != null) {
-            return delegate.isUseSeparateListener();
+            EndpointReference ret = delegate.getReplyTo();
+
+            if (ret != null) {
+                return ret;
+            }
         }
-        return useSeparateListener;
-    }
 
-    /**
-     * Used to specify whether the two SOAP Messages are be sent over same channel
-     * or over separate channels.The value of this variable depends on the transport specified.
-     * For e.g., if the transports are different this is true by default.
-     * HTTP transport supports both cases while SMTP transport supports only two channel case.
-     *
-     * @param useSeparateListener
-     */
-    public void setUseSeparateListener(boolean useSeparateListener) {
-        this.useSeparateListener = useSeparateListener;
+        return replyTo;
     }
 
-    public String getAction() {
+    public TransportOutDescription getSenderTransport() {
         if (delegate != null) {
-            String ret = delegate.getAction();
+            TransportOutDescription ret = delegate.getSenderTransport();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return action;
-    }
 
-    public void setAction(String action) {
-        this.action = action;
+        return senderTransport;
     }
 
-    public String getMessageId() {
+    public String getSenderTransportProtocol() {
         if (delegate != null) {
-            String ret = delegate.getMessageId();
+            String ret = delegate.getSenderTransportProtocol();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return messageId;
-    }
 
-    public void setMessageId(String messageId) {
-        this.messageId = messageId;
+        return senderTransportProtocol;
     }
 
-    public EndpointReference getTo() {
+    public String getSoapAction() {
         if (delegate != null) {
-            EndpointReference ret = delegate.getTo();
+            String ret = delegate.getSoapAction();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return to;
-    }
 
-    public void setTo(EndpointReference to) {
-        this.to = to;
+        return soapAction;
     }
 
-    public EndpointReference getFrom() {
+    public String getSoapVersionURI() {
         if (delegate != null) {
-            EndpointReference ret = delegate.getFrom();
+            String ret = delegate.getSoapVersionURI();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return from;
+
+        return soapVersionURI;
     }
 
-    public void setFrom(EndpointReference from) {
-        this.from = from;
+    /**
+     * Gets the wait time after which a client times out in a blocking scenario.
+     * The default is 2000.
+     *
+     * @return timeOutInMilliSeconds
+     */
+    public long getTimeOutInMilliSeconds() {
+        if (delegate != null) {
+            return delegate.getTimeOutInMilliSeconds();
+        }
+
+        return timeOutInMilliSeconds;
     }
 
-    public EndpointReference getReplyTo() {
+    public EndpointReference getTo() {
         if (delegate != null) {
-            EndpointReference ret = delegate.getReplyTo();
+            EndpointReference ret = delegate.getTo();
+
             if (ret != null) {
                 return ret;
             }
         }
-        return replyTo;
+
+        return to;
     }
 
-    public void setReplyTo(EndpointReference replyTo) {
-        this.replyTo = replyTo;
+    /**
+     * If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to
+     * throw an exception with the details extracted from the information from the fault message.
+     * This boolean variable will enable that facility. If this is false, the response message will just
+     * be returned to the application, irrespective of whether it has a Fault or not.
+     */
+    public boolean isExceptionToBeThrownOnSOAPFault() {
+        if (delegate != null) {
+            return delegate.isExceptionToBeThrownOnSOAPFault();
+        }
+
+        return isExceptionToBeThrownOnSOAPFault;
     }
 
-    public EndpointReference getFaultTo() {
+    public boolean isUseSeparateListener() {
         if (delegate != null) {
-            EndpointReference ret = delegate.getFaultTo();
-            if (ret != null) {
-                return ret;
-            }
+            return delegate.isUseSeparateListener();
         }
-        return faultTo;
+
+        return useSeparateListener;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    /**
+     * If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to
+     * throw an exception with the details extracted from the information from the fault message.
+     * This boolean variable will enable that facility. If this is false, the response message will just
+     * be returned to the application, irrespective of whether it has a Fault or not.
+     *
+     * @param exceptionToBeThrownOnSOAPFault
+     */
+    public void setExceptionToBeThrownOnSOAPFault(boolean exceptionToBeThrownOnSOAPFault) {
+        isExceptionToBeThrownOnSOAPFault = exceptionToBeThrownOnSOAPFault;
     }
 
     public void setFaultTo(EndpointReference faultTo) {
         this.faultTo = faultTo;
     }
 
-    public RelatesTo getRelatesTo() {
-        if (delegate != null) {
-            RelatesTo ret = delegate.getRelatesTo();
-            if (ret != null) {
-                return ret;
-            }
-        }
-        return relatesTo;
+    public void setFrom(EndpointReference from) {
+        this.from = from;
     }
 
-    public void setRelatesTo(RelatesTo relatesTo) {
-        this.relatesTo = relatesTo;
+    public void setListener(TransportListener listener) {
+        this.listener = listener;
     }
 
-    public String getListenerTransportProtocol() {
-        if (delegate != null) {
-            String ret = delegate.getListenerTransportProtocol();
-            if (ret != null) {
-                return ret;
-            }
-        }
-        return listenerTransportProtocol;
+    public void setListenerTransport(TransportInDescription listenerTransport) {
+        this.listenerTransport = listenerTransport;
     }
 
     public void setListenerTransportProtocol(String listenerTransportProtocol) {
         this.listenerTransportProtocol = listenerTransportProtocol;
     }
 
-    public String getSenderTransportProtocol() {
-        if (delegate != null) {
-            String ret = delegate.getSenderTransportProtocol();
-            if (ret != null) {
-                return ret;
-            }
+    public void setMessageId(String messageId) {
+        this.messageId = messageId;
+    }
+
+    /**
+     * This will set the properties to the context. But in setting that one may need to "copy" all
+     * the properties from the source properties to the target properties. To enable this we introduced
+     * a property (org.apache.axis2.client.Options#COPY_PROPERTIES) so that if set to Boolean(true),
+     * this code will copy the whole thing, without just referencing to the source.
+     *
+     * @param properties
+     */
+    public void setProperties(Map properties) {
+        this.properties = properties;
+    }
+
+    /**
+     * Properties you need to pass in to the message context must be set via this.
+     * If there is a method to the set this property, within this class, its encouraged to use that method,
+     * without duplicating stuff or making room for bugs.
+     *
+     * @param propertyKey
+     * @param property
+     */
+    public void setProperty(String propertyKey, Object property) {
+        properties.put(propertyKey, property);
+    }
+
+    public void setRelatesTo(RelatesTo relatesTo) {
+        this.relatesTo = relatesTo;
+    }
+
+    public void setReplyTo(EndpointReference replyTo) {
+        this.replyTo = replyTo;
+    }
+
+    public void setSenderTransport(TransportOutDescription senderTransport) {
+        this.senderTransport = senderTransport;
+    }
+
+    /**
+     * Sets the transport to be used for sending the SOAP Message
+     *
+     * @param senderTransport
+     * @throws AxisFault if the transport is not found
+     */
+    public void setSenderTransport(String senderTransport, AxisConfiguration axisConfiguration)
+            throws AxisFault {
+        this.senderTransport = axisConfiguration.getTransportOut(new QName(senderTransport));
+
+        if (senderTransport == null) {
+            throw new AxisFault(Messages.getMessage("unknownTransport", senderTransport));
         }
-        return senderTransportProtocol;
     }
 
+    public void setSoapAction(String soapAction) {
+        this.soapAction = soapAction;
+    }
+
+    public void setSoapVersionURI(String soapVersionURI) {
+        this.soapVersionURI = soapVersionURI;
+    }
+
+    /**
+     * This is used in blocking scenario. Client will time out after waiting this amount of time.
+     * The default is 2000 and must be provided in multiples of 100.
+     *
+     * @param timeOutInMilliSeconds
+     */
+    public void setTimeOutInMilliSeconds(long timeOutInMilliSeconds) {
+        this.timeOutInMilliSeconds = timeOutInMilliSeconds;
+    }
+
+    public void setTo(EndpointReference to) {
+        this.to = to;
+    }
 
     /**
      * Sets transport information to the call. The senarios supported are as follows:
@@ -441,18 +462,17 @@
      *             You do not need to setSenderTransportProtocol(String) as sender transport can be inferred from the
      *             to EPR. But still you can setSenderTransport(TransportOutDescription).
      */
-
     public void setTransportInfo(String senderTransport, String listenerTransport,
                                  boolean useSeparateListener)
             throws AxisFault {
-        //here we check for a legal combination, for and example if the sendertransport is http and listner
-        //transport is smtp the invocation must using separate transport
+
+        // here we check for a legal combination, for and example if the sendertransport is http and listner
+        // transport is smtp the invocation must using separate transport
         if (!useSeparateListener) {
-            boolean isTransportsEqual =
-                    senderTransport.equals(listenerTransport);
-            boolean isATwoWaytransport =
-                    Constants.TRANSPORT_HTTP.equals(senderTransport)
-                            || Constants.TRANSPORT_TCP.equals(senderTransport);
+            boolean isTransportsEqual = senderTransport.equals(listenerTransport);
+            boolean isATwoWaytransport = Constants.TRANSPORT_HTTP.equals(senderTransport)
+                    || Constants.TRANSPORT_TCP.equals(senderTransport);
+
             if ((!isTransportsEqual || !isATwoWaytransport)) {
                 throw new AxisFault(Messages.getMessage("useSeparateListenerLimited"));
             }
@@ -462,5 +482,17 @@
 
         setListenerTransportProtocol(listenerTransport);
         this.senderTransportProtocol = senderTransport;
+    }
+
+    /**
+     * Used to specify whether the two SOAP Messages are be sent over same channel
+     * or over separate channels.The value of this variable depends on the transport specified.
+     * For e.g., if the transports are different this is true by default.
+     * HTTP transport supports both cases while SMTP transport supports only two channel case.
+     *
+     * @param useSeparateListener
+     */
+    public void setUseSeparateListener(boolean useSeparateListener) {
+        this.useSeparateListener = useSeparateListener;
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/RESTCall.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/RESTCall.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/RESTCall.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/RESTCall.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.client;
 
@@ -22,9 +23,7 @@
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
 
-
 public class RESTCall extends Call {
-
     public RESTCall() throws AxisFault {
         super();
     }
@@ -33,21 +32,15 @@
         super(service);
     }
 
-    public OMElement invokeBlocking()
-            throws AxisFault {
-        return super.invokeBlocking(
-                "nothing",
-                OMAbstractFactory.getOMFactory().createOMElement(
-                        "nothing", "nothing", "nothing"));
-
+    public OMElement invokeBlocking() throws AxisFault {
+        return super.invokeBlocking("nothing",
+                OMAbstractFactory.getOMFactory().createOMElement("nothing",
+                        "nothing", "nothing"));
     }
 
-    public void invokeNonBlocking(Callback callback)
-            throws AxisFault {
-        super.invokeNonBlocking(
-                "nothing",
-                OMAbstractFactory.getOMFactory().createOMElement(
-                        "nothing", "nothing", "nothing"), callback);
-
+    public void invokeNonBlocking(Callback callback) throws AxisFault {
+        super.invokeNonBlocking("nothing",
+                OMAbstractFactory.getOMFactory().createOMElement("nothing",
+                        "nothing", "nothing"), callback);
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.client;
 
@@ -38,20 +39,10 @@
 import javax.xml.stream.XMLStreamReader;
 import java.util.ArrayList;
 
-
 public abstract class Stub {
-
-    protected ConfigurationContext _configurationContext;
     protected static AxisService _service;
-    protected ServiceContext _serviceContext;
     protected ArrayList modules = new ArrayList();
 
-    protected Options _clientOptions = new Options();
-
-    public void engageModule(String moduleName) {
-        this.modules.add(moduleName);
-    }
-
     /**
      * If _maintainSession is set to true, all the calls can use the same
      * ServiceContext. The user can share information through this
@@ -59,30 +50,53 @@
      */
     protected boolean _maintainSession = false;
     protected String _currentSessionId = null;
-
+    protected Options _clientOptions = new Options();
+    protected ConfigurationContext _configurationContext;
+    protected ServiceContext _serviceContext;
 
     protected Stub() {
     }
 
-    public void _setSessionInfo(String key, Object value) throws Exception {
+    public void _endSession() {
+        _maintainSession = false;
+    }
+
+    public Options _getClientOptions() {
+        return _clientOptions;
+    }
+
+    protected String _getServiceContextID() {
+        if (_maintainSession) {
+            return _currentSessionId;
+        } else {
+            return getID();
+        }
+    }
+
+    public Object _getSessionInfo(String key) throws Exception {
         if (!_maintainSession) {
-            //TODO Comeup with a Exception
+
+            // TODO Comeup with a Exception
             throw new Exception(
                     "Client is running the session OFF mode: Start session before saving to a session ");
         }
-        _configurationContext.getServiceContext(_currentSessionId).setProperty(
-                key, value);
+
+        return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
     }
 
+    public void _setClientOptions(Options _clientOptions) {
+        this._clientOptions = _clientOptions;
+    }
 
-    public Object _getSessionInfo(String key) throws Exception {
+    public void _setSessionInfo(String key, Object value) throws Exception {
         if (!_maintainSession) {
-            //TODO Comeup with a Exception
+
+            // TODO Comeup with a Exception
             throw new Exception(
                     "Client is running the session OFF mode: Start session before saving to a session ");
         }
-        return _configurationContext.getServiceContext(_currentSessionId)
-                .getProperty(key);
+
+        _configurationContext.getServiceContext(_currentSessionId).setProperty(key, value);
     }
 
     public void _startSession() {
@@ -90,52 +104,26 @@
         _currentSessionId = getID();
     }
 
-    public void _endSession() {
-        _maintainSession = false;
-    }
-
-    protected String _getServiceContextID() {
-        if (_maintainSession)
-            return _currentSessionId;
-        else
-            return getID();
-    }
-
-    private String getID() {
-        //TODO Get the UUID generator to generate values
-        return Long.toString(System.currentTimeMillis());
-    }
-
-
     protected SOAPEnvelope createEnvelope() throws SOAPProcessingException {
         return getFactory(this._clientOptions.getSoapVersionURI()).getDefaultEnvelope();
     }
 
-    protected OMElement getElementFromReader(XMLStreamReader reader) {
-        StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(
-                OMAbstractFactory.getOMFactory(), reader);
-        return builder.getDocumentElement();
+    public void engageModule(String moduleName) {
+        this.modules.add(moduleName);
     }
 
-    protected void setValueDoc(SOAPEnvelope env, OMElement value) {
-        setValueDoc(env, value, false);
+    protected void populateModules(Call call) throws AxisFault {
+        for (int i = 0; i < modules.size(); i++) {
+            call.engageModule(new QName((String) this.modules.get(i)));
+        }
     }
 
-    protected void setValueDoc(SOAPEnvelope env, OMElement value, boolean isHeader) {
-
-        if (value != null) {
-            if (isHeader) {
-                SOAPHeader header = env.getHeader();
-                header.addChild(value);
-            } else {
-                SOAPBody body = env.getBody();
-                body.addChild(value);
-            }
-
+    protected void populateModules(MessageSender sender) throws AxisFault {
+        for (int i = 0; i < modules.size(); i++) {
+            sender.engageModule(new QName((String) this.modules.get(i)));
         }
     }
 
-
     /**
      * A util method that extracts the correct element.
      *
@@ -148,25 +136,24 @@
         OMElement element = body.getFirstElement();
 
         if (WSDLService.STYLE_RPC.equals(type)) {
-            return element.getFirstElement(); //todo this needs to be fixed
+            return element.getFirstElement();    // todo this needs to be fixed
         } else if (WSDLService.STYLE_DOC.equals(type)) {
             return element;
         } else {
             throw new UnsupportedOperationException("Unsupported type");
         }
-
     }
 
-    /**
-     * Gets the message context.
-     */
-    protected MessageContext getMessageContext() throws AxisFault {
-        return new MessageContext(_configurationContext);
-    }
+    protected OMElement getElementFromReader(XMLStreamReader reader) {
+        StAXOMBuilder builder =
+                OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);
 
+        return builder.getDocumentElement();
+    }
 
     protected SOAPFactory getFactory(String soapNamespaceURI) {
         String soapVersionURI = _clientOptions.getSoapVersionURI();
+
         if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
             return OMAbstractFactory.getSOAP11Factory();
         } else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
@@ -176,25 +163,34 @@
         }
     }
 
-    protected void populateModules(Call call) throws AxisFault {
-        for (int i = 0; i < modules.size(); i++) {
-            call.engageModule(new QName((String) this.modules.get(i)));
-        }
-    }
+    private String getID() {
 
-    protected void populateModules(MessageSender sender) throws AxisFault {
-        for (int i = 0; i < modules.size(); i++) {
-            sender.engageModule(new QName((String) this.modules.get(i)));
-        }
+        // TODO Get the UUID generator to generate values
+        return Long.toString(System.currentTimeMillis());
     }
 
-    public Options _getClientOptions() {
-        return _clientOptions;
+    /**
+     * Gets the message context.
+     */
+    protected MessageContext getMessageContext() throws AxisFault {
+        return new MessageContext(_configurationContext);
     }
 
-    public void _setClientOptions(Options _clientOptions) {
-        this._clientOptions = _clientOptions;
+    protected void setValueDoc(SOAPEnvelope env, OMElement value) {
+        setValueDoc(env, value, false);
     }
 
-}
+    protected void setValueDoc(SOAPEnvelope env, OMElement value, boolean isHeader) {
+        if (value != null) {
+            if (isHeader) {
+                SOAPHeader header = env.getHeader();
 
+                header.addChild(value);
+            } else {
+                SOAPBody body = env.getBody();
+
+                body.addChild(value);
+            }
+        }
+    }
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/WSDLMEPClientBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/WSDLMEPClientBuilder.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/WSDLMEPClientBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/WSDLMEPClientBuilder.java Fri Dec 16 09:13:57 2005
@@ -1,19 +1,20 @@
 /*
- *  Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
+*  Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
 package org.apache.axis2.client;
 
 import org.apache.axis2.AxisFault;
@@ -46,202 +47,222 @@
 import java.util.Iterator;
 
 public class WSDLMEPClientBuilder {
-	private boolean isoneway= false;
-	private WSDLDescription description;
-	private ConfigurationContext configurationContext;
-	
-	public WSDLMEPClientBuilder(String clienthome) throws AxisFault{
-		try{
-		configurationContext = new ConfigurationContextFactory().buildClientConfigurationContext(clienthome);
-		}catch(DeploymentException e){
-			throw new AxisFault(e);
-		}
-	}
-	
-	public void defineDescription(URL wsdlurl)throws AxisFault{
-		try {
-			
-			WOMBuilder buider = WOMBuilderFactory.getBuilder(WSDLConstants.WSDL_1_1);
-			WSDLVersionWrapper vw = buider.build(wsdlurl.openStream());
-			description = vw.getDescription();
-		} catch (Exception e) {
-			throw new AxisFault(e);
-		}
-	}
-	
-	public MEPClient createMEPClient(QName endpointname,String operationname) throws AxisFault{
-        return createMEPClient(null,endpointname,operationname);
-	}
-	public MEPClient createMEPClient(String operationname) throws AxisFault{
-		return createMEPClient(null,null,operationname);
-	}
-	
-	public MEPClient createMEPClient(QName servicename, QName endpointname,String operationname) throws AxisFault{
-		if(description == null){
-			throw new AxisFault("You need to call public void defineDescription(URL wsdlurl before this method)");
-		}
-		WSDLService service = findService(servicename);
-		AxisService serviceDesc = new AxisService();
-		
-		WSDLEndpoint endpoint = findEndpoint(endpointname,service);
-		EndpointReference toepr = null;
-		Options op = new Options();
-		
-		Iterator elements = endpoint.getExtensibilityElements().iterator();
+    private boolean isoneway = false;
+    private ConfigurationContext configurationContext;
+    private WSDLDescription description;
+
+    public WSDLMEPClientBuilder(String clienthome) throws AxisFault {
+        try {
+            configurationContext =
+                    new ConfigurationContextFactory().buildClientConfigurationContext(clienthome);
+        } catch (DeploymentException e) {
+            throw new AxisFault(e);
+        }
+    }
+
+    public MEPClient createMEPClient(String operationname) throws AxisFault {
+        return createMEPClient(null, null, operationname);
+    }
+
+    public MEPClient createMEPClient(QName endpointname, String operationname) throws AxisFault {
+        return createMEPClient(null, endpointname, operationname);
+    }
+
+    public MEPClient createMEPClient(QName servicename, QName endpointname, String operationname)
+            throws AxisFault {
+        if (description == null) {
+            throw new AxisFault(
+                    "You need to call public void defineDescription(URL wsdlurl before this method)");
+        }
+
+        WSDLService service = findService(servicename);
+        AxisService serviceDesc = new AxisService();
+        WSDLEndpoint endpoint = findEndpoint(endpointname, service);
+        EndpointReference toepr = null;
+        Options op = new Options();
+        Iterator elements = endpoint.getExtensibilityElements().iterator();
+
         while (elements.hasNext()) {
-                Object obj = elements.next();
-                System.out.println("Extension = " +obj);
-                if(obj instanceof SOAPAddress){
-                        SOAPAddress soapAddress = (SOAPAddress) obj;
-                        System.out.println(soapAddress.getLocationURI());
-                        toepr = new EndpointReference(soapAddress.getLocationURI());
-                }
-        }
-        
-        if(toepr != null){
-        	op.setTo(toepr);
-        }else{
-        	throw new AxisFault("To Address not found");
+            Object obj = elements.next();
+
+            System.out.println("Extension = " + obj);
+
+            if (obj instanceof SOAPAddress) {
+                SOAPAddress soapAddress = (SOAPAddress) obj;
+
+                System.out.println(soapAddress.getLocationURI());
+                toepr = new EndpointReference(soapAddress.getLocationURI());
+            }
+        }
+
+        if (toepr != null) {
+            op.setTo(toepr);
+        } else {
+            throw new AxisFault("To Address not found");
         }
 
         WSDLBinding binding = endpoint.getBinding();
-        
-        //let us configure the complete AxisService out of this, not the current the Operation only
+
+        // let us configure the complete AxisService out of this, not the current the Operation only
         Iterator bindings = binding.getBindingOperations().values().iterator();
-        while(bindings.hasNext()){
-        	WSDLBindingOperation wsdlbop =(WSDLBindingOperation)bindings.next();
-        	WSDLOperation wsdlop = wsdlbop.getOperation();
-        	AxisOperation axisOp =  AxisOperationFactory.getAxisOperation(findMEP(wsdlop));
-        	axisOp.setName(wsdlop.getName());
-        	serviceDesc.addOperation(axisOp);
+
+        while (bindings.hasNext()) {
+            WSDLBindingOperation wsdlbop = (WSDLBindingOperation) bindings.next();
+            WSDLOperation wsdlop = wsdlbop.getOperation();
+            AxisOperation axisOp = AxisOperationFactory.getAxisOperation(findMEP(wsdlop));
+
+            axisOp.setName(wsdlop.getName());
+            serviceDesc.addOperation(axisOp);
         }
-        
-        //This part is compelte mess .. I think we need to look closly at the ServiceGroups  ..time been this works
+
+        // This part is compelte mess .. I think we need to look closly at the ServiceGroups  ..time been this works
         configurationContext.getAxisConfiguration().addService(serviceDesc);
-        AxisServiceGroup serviceGroup = new AxisServiceGroup(configurationContext.getAxisConfiguration());
-        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configurationContext,serviceGroup);
-        ServiceContext serviceContext =  new ServiceContext(serviceDesc,serviceGroupContext);
-
-        
-        WSDLOperation wsdlop = getOperation(operationname,endpoint);
-        
+
+        AxisServiceGroup serviceGroup =
+                new AxisServiceGroup(configurationContext.getAxisConfiguration());
+        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configurationContext,
+                serviceGroup);
+        ServiceContext serviceContext = new ServiceContext(serviceDesc, serviceGroupContext);
+        WSDLOperation wsdlop = getOperation(operationname, endpoint);
         WSDLBindingOperation bop = binding.getBindingOperation(wsdlop.getName());
         Iterator elments = bop.getExtensibilityElements().iterator();
+
         while (elments.hasNext()) {
-                Object obj = elments.next();
-                if (obj instanceof SOAPOperation) {
-                        SOAPOperation soapOp = (SOAPOperation) obj;
-                        op.setSoapAction(soapOp.getSoapAction());
-                        break;
-                }
-        }
-        
-        
-        
-        
+            Object obj = elments.next();
+
+            if (obj instanceof SOAPOperation) {
+                SOAPOperation soapOp = (SOAPOperation) obj;
+
+                op.setSoapAction(soapOp.getSoapAction());
+
+                break;
+            }
+        }
+
         MEPClient mepclient = null;
-        if(wsdlop.getInputMessage() != null && wsdlop.getOutputMessage() != null && !isoneway){
-        	mepclient = new InOutMEPClient(serviceContext);
-        }else if(wsdlop.getInputMessage() != null || isoneway){
-            mepclient = new InOnlyMEPClient(serviceContext);      	
-        }else{
-        	throw new AxisFault("Unknown MEP");
+
+        if ((wsdlop.getInputMessage() != null) && (wsdlop.getOutputMessage() != null) && !isoneway) {
+            mepclient = new InOutMEPClient(serviceContext);
+        } else if ((wsdlop.getInputMessage() != null) || isoneway) {
+            mepclient = new InOnlyMEPClient(serviceContext);
+        } else {
+            throw new AxisFault("Unknown MEP");
         }
-        
+
         mepclient.setClientOptions(op);
+
         return mepclient;
-	}
-	
-	
-	private WSDLService findService(QName serviceName) throws AxisFault{
-		WSDLService service = null;
-		if(serviceName == null){
-			Iterator services = description.getServices().values().iterator();
-			if(services.hasNext()){
-				service = (WSDLService)services.next();
-			}else{
-				throw new AxisFault("No service found");
-			}
-		}else{
-			service = description.getService(serviceName);
-		}
-		
-		if(service == null){
-			throw new AxisFault("No service found");
-		}
-		return service;
-	}
-	
-	private WSDLEndpoint findEndpoint(QName endpointname,WSDLService service) throws AxisFault{
-		WSDLEndpoint endpoint = null;
-		if(endpointname == null){
-			Iterator endpoints = service.getEndpoints().values().iterator();
-			if (endpoints.hasNext()) {
-				endpoint = (WSDLEndpoint) endpoints.next();
-			} else {
-				throw new AxisFault("No Endpoint Found in Service, " + service.getName());
-			}
-		}else{
-			endpoint = service.getEndpoint(endpointname);
-		}
-		if(endpoint == null){
-			throw new AxisFault("Endpoint Not found");
-		}
-		return endpoint;
-	}
-	
-	 private WSDLOperation getOperation(String operation,WSDLEndpoint endpoint) throws AxisFault {
-         WSDLInterface wsdlinterface = endpoint.getBinding().getBoundInterface();
-         Iterator operations = wsdlinterface.getAllOperations().values().iterator();
-         while(operations.hasNext()){
-                 WSDLOperation wsdlOp = (WSDLOperation)operations.next();
-                 if(wsdlOp.getName().getLocalPart().equals(operation)){
-                         return wsdlOp;
-                 }
-
-         }
-         throw new AxisFault("Operation Not found");
- }
-
-	public WSDLDescription getDescription() {
-		return description;
-	}
-
-	public void setIsoneway(boolean isoneway) {
-		this.isoneway = isoneway;
-	}
-	
-	
-	private int findMEP(WSDLOperation wsdlOp) throws AxisFault{
-		if(wsdlOp.getInputMessage() == null){
-			throw new AxisFault("Unsupported MEP");
-		}
-		if(wsdlOp.getOutputMessage() == null){
-			return WSDLConstants.MEP_CONSTANT_IN_ONLY;
-		}else{
-			return WSDLConstants.MEP_CONSTANT_IN_OUT;
-		}
-	}
-	
-//	public static void main(String[] args) throws Exception{
-//		WSDLMEPClientBuilder builder = new WSDLMEPClientBuilder("/home/hemapani/tools/axis2-0.93-SNAPSHOT-bin/repository/");
-//		//builder.defineDescription(new URL("http://mssoapinterop.org/asmx/WSDL/InteropTestDocLit.wsdl"));
-//		builder.defineDescription(new File("/home/hemapani/temp/InteropTestDocLit.wsdl").toURL());
-//		InOutMEPClient mepclient = (InOutMEPClient)builder.createMEPClient("echoStruct");
-//		
-//		String message= "<echoStructParam xmlns=\"http://soapinterop.org/xsd\"><varFloat>23.4</varFloat>\"<varInt>35</varInt><varString>Hello1</varString></echoStructParam>";
-//		XMLStreamReader in = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(message.getBytes()));
-//		StAXOMBuilder omb = new StAXOMBuilder(in);
-//		
-//		AxisOperation opDesc = AxisOperationFactory.getAxisOperation(AxisOperationFactory.MEP_CONSTANT_IN_OUT);
-//		opDesc.setName(new QName("http://soapinterop.org","echoStruct"));
-//		MessageContext msgctx= new MessageContext(mepclient.getServiceContext().getConfigurationContext());
-//		
-//		SOAPFactory soapFactory = new SOAP11Factory();
-//		SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
-//		envelope.getBody().setFirstChild(omb.getDocumentElement());
-//		msgctx.setEnvelope(envelope);
-//		
-//		mepclient.invokeBlocking(opDesc,msgctx);
-//	}
+    }
+
+    public void defineDescription(URL wsdlurl) throws AxisFault {
+        try {
+            WOMBuilder buider = WOMBuilderFactory.getBuilder(WSDLConstants.WSDL_1_1);
+            WSDLVersionWrapper vw = buider.build(wsdlurl.openStream());
+
+            description = vw.getDescription();
+        } catch (Exception e) {
+            throw new AxisFault(e);
+        }
+    }
+
+    private WSDLEndpoint findEndpoint(QName endpointname, WSDLService service) throws AxisFault {
+        WSDLEndpoint endpoint = null;
+
+        if (endpointname == null) {
+            Iterator endpoints = service.getEndpoints().values().iterator();
+
+            if (endpoints.hasNext()) {
+                endpoint = (WSDLEndpoint) endpoints.next();
+            } else {
+                throw new AxisFault("No Endpoint Found in Service, " + service.getName());
+            }
+        } else {
+            endpoint = service.getEndpoint(endpointname);
+        }
+
+        if (endpoint == null) {
+            throw new AxisFault("Endpoint Not found");
+        }
+
+        return endpoint;
+    }
+
+    private int findMEP(WSDLOperation wsdlOp) throws AxisFault {
+        if (wsdlOp.getInputMessage() == null) {
+            throw new AxisFault("Unsupported MEP");
+        }
+
+        if (wsdlOp.getOutputMessage() == null) {
+            return WSDLConstants.MEP_CONSTANT_IN_ONLY;
+        } else {
+            return WSDLConstants.MEP_CONSTANT_IN_OUT;
+        }
+    }
+
+    private WSDLService findService(QName serviceName) throws AxisFault {
+        WSDLService service = null;
+
+        if (serviceName == null) {
+            Iterator services = description.getServices().values().iterator();
+
+            if (services.hasNext()) {
+                service = (WSDLService) services.next();
+            } else {
+                throw new AxisFault("No service found");
+            }
+        } else {
+            service = description.getService(serviceName);
+        }
+
+        if (service == null) {
+            throw new AxisFault("No service found");
+        }
+
+        return service;
+    }
+
+    public WSDLDescription getDescription() {
+        return description;
+    }
+
+    private WSDLOperation getOperation(String operation, WSDLEndpoint endpoint) throws AxisFault {
+        WSDLInterface wsdlinterface = endpoint.getBinding().getBoundInterface();
+        Iterator operations = wsdlinterface.getAllOperations().values().iterator();
+
+        while (operations.hasNext()) {
+            WSDLOperation wsdlOp = (WSDLOperation) operations.next();
+
+            if (wsdlOp.getName().getLocalPart().equals(operation)) {
+                return wsdlOp;
+            }
+        }
+
+        throw new AxisFault("Operation Not found");
+    }
+
+    public void setIsoneway(boolean isoneway) {
+        this.isoneway = isoneway;
+    }
+
+//  public static void main(String[] args) throws Exception{
+//          WSDLMEPClientBuilder builder = new WSDLMEPClientBuilder("/home/hemapani/tools/axis2-0.93-SNAPSHOT-bin/repository/");
+//          //builder.defineDescription(new URL("http://mssoapinterop.org/asmx/WSDL/InteropTestDocLit.wsdl"));
+//          builder.defineDescription(new File("/home/hemapani/temp/InteropTestDocLit.wsdl").toURL());
+//          InOutMEPClient mepclient = (InOutMEPClient)builder.createMEPClient("echoStruct");
+//          
+//          String message= "<echoStructParam xmlns=\"http://soapinterop.org/xsd\"><varFloat>23.4</varFloat>\"<varInt>35</varInt><varString>Hello1</varString></echoStructParam>";
+//          XMLStreamReader in = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(message.getBytes()));
+//          StAXOMBuilder omb = new StAXOMBuilder(in);
+//          
+//          AxisOperation opDesc = AxisOperationFactory.getAxisOperation(AxisOperationFactory.MEP_CONSTANT_IN_OUT);
+//          opDesc.setName(new QName("http://soapinterop.org","echoStruct"));
+//          MessageContext msgctx= new MessageContext(mepclient.getServiceContext().getConfigurationContext());
+//          
+//          SOAPFactory soapFactory = new SOAP11Factory();
+//          SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
+//          envelope.getBody().setFirstChild(omb.getDocumentElement());
+//          msgctx.setEnvelope(envelope);
+//          
+//          mepclient.invokeBlocking(opDesc,msgctx);
+//  }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/AsyncResult.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/AsyncResult.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/AsyncResult.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/AsyncResult.java Fri Dec 16 09:13:57 2005
@@ -1,37 +1,40 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
 package org.apache.axis2.client.async;
 
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.soap.SOAPEnvelope;
 
 /**
- * This class represents the results of an asynchronous invocation. The axis engine 
- * reports back the results in this object via the callback function. 
+ * This class represents the results of an asynchronous invocation. The axis engine
+ * reports back the results in this object via the callback function.
  */
 public class AsyncResult {
 
-    public AsyncResult(MessageContext result) {
-        this.result = result;
-    }
     /**
      * Field result
      */
     private MessageContext result;
 
+    public AsyncResult(MessageContext result) {
+        this.result = result;
+    }
+
     /**
      * @return SOAPEnvelope
      */
@@ -41,10 +44,9 @@
         } else {
             return null;
         }
-
     }
 
-     /**
+    /**
      * @return MessageContext
      */
     public MessageContext getResponseMessageContext() {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/Callback.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/Callback.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/Callback.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/async/Callback.java Fri Dec 16 09:13:57 2005
@@ -5,31 +5,31 @@
  * asynchronous invocation.
  */
 public abstract class Callback {
+
     /**
      * Field complete
      */
     private boolean complete = false;
 
-
     /**
      * This method is invoked by Axis Engine once the asynchronous operation has completed sucessfully.
-     *     
+     *
      * @param result
      */
     public abstract void onComplete(AsyncResult result);
 
     /**
-     * This method is called by Axis Engine if the asynchronous operation fails. 
+     * This method is called by Axis Engine if the asynchronous operation fails.
      *
      * @param e
      */
     public abstract void reportError(Exception e);
 
     /**
-     * Returns true if the asynchronous operation has completed, false otherwise. Typically this is 
+     * Returns true if the asynchronous operation has completed, false otherwise. Typically this is
      * used for polling. e.g.
      * <code>
-     *      <pre>
+     * <pre>
      *          while(!callback.isComplete()){
      *             Thread.sleep(1000);
      *          }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java Fri Dec 16 09:13:57 2005
@@ -1,24 +1,23 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.context;
 
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.client.Options;
-import org.apache.axis2.engine.AxisConfiguration;
 
 import java.util.HashMap;
 import java.util.Iterator;
@@ -28,25 +27,23 @@
  * This is the top most level of the Context hierachy and is a bag of properties.
  */
 public abstract class AbstractContext {
-
-    protected Map properties;
-
     protected AbstractContext parent;
+    protected Map properties;
 
     protected AbstractContext(AbstractContext parent) {
         this.properties = new HashMap();
         this.parent = parent;
     }
 
-
     /**
-     * Store a property for message context
-     *
-     * @param key
-     * @param value
+     * @return Returns AbstractContext.
      */
-    public void setProperty(String key, Object value) {
-        properties.put(key, value);
+    public AbstractContext getParent() {
+        return parent;
+    }
+
+    public Map getProperties() {
+        return properties;
     }
 
     /**
@@ -57,10 +54,13 @@
      */
     public Object getProperty(String key) {
         Object obj = null;
+
         obj = properties.get(key);
-        if (obj == null && parent != null) {
+
+        if ((obj == null) && (parent != null)) {
             obj = parent.getProperty(key);
         }
+
         return obj;
     }
 
@@ -72,17 +72,6 @@
     }
 
     /**
-     * @return Returns AbstractContext.
-     */
-    public AbstractContext getParent() {
-        return parent;
-    }
-
-    public Map getProperties() {
-        return properties;
-    }
-
-    /**
      * This will set the properties to the context. But in setting that one may need to "copy" all
      * the properties from the source properties to the target properties. To enable this we introduced
      * a property (org.apache.axis2.client.Options#COPY_PROPERTIES) so that if set to true, this code
@@ -91,21 +80,33 @@
      * @param properties
      * @see org.apache.axis2.client.Options#COPY_PROPERTIES
      */
-
     public void setProperties(Map properties) {
         if (properties == null) {
             this.properties = null;
         } else {
             Boolean copyProperties = ((Boolean) properties.get(Options.COPY_PROPERTIES));
-            if (copyProperties != null && copyProperties.booleanValue()) {
+
+            if ((copyProperties != null) && copyProperties.booleanValue()) {
                 Iterator iterator = properties.keySet().iterator();
+
                 while (iterator.hasNext()) {
                     Object key = iterator.next();
+
                     this.properties.put(key, properties.get(key));
                 }
             } else {
                 this.properties = properties;
             }
         }
+    }
+
+    /**
+     * Store a property for message context
+     *
+     * @param key
+     * @param value
+     */
+    public void setProperty(String key, Object value) {
+        properties.put(key, value);
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.context;
 
@@ -31,43 +32,84 @@
 /**
  * This contains all the configuration information for Axis2.
  */
-
 public class ConfigurationContext extends AbstractContext {
 
-    private transient AxisConfiguration axisConfiguration;
-
-    private transient ThreadFactory threadPool;
-
-    private File rootDir;
-
     /**
      * Map containing <code>MessageID</code> to
      * <code>OperationContext</code> mapping.
      */
     private final Map operationContextMap = new HashMap();
-
     private final Map serviceContextMap = new HashMap();
-
     private final Map serviceGroupContextMap = new HashMap();
+    private transient AxisConfiguration axisConfiguration;
+    private File rootDir;
+    private transient ThreadFactory threadPool;
 
     public ConfigurationContext(AxisConfiguration axisConfiguration) {
         super(null);
         this.axisConfiguration = axisConfiguration;
     }
 
-    public synchronized void removeService(QName name) {
-        serviceContextMap.remove(name);
-    }
-
-    public AxisConfiguration getAxisConfiguration() {
-        return axisConfiguration;
-    }
-
     /**
-     * @param configuration
+     * Searches for a ServiceGroupContext in the map with given id as the key.
+     * <pre>
+     * If(key != null && found)
+     * check for a service context for the intended service.
+     * if (!found)
+     * create one and hook up to ServiceGroupContext
+     * else
+     * create new ServiceGroupContext with the given key or if key is null with a new key
+     * create a new service context for the service
+     * </pre>
+     *
+     * @param messageContext
      */
-    public void setAxisConfiguration(AxisConfiguration configuration) {
-        axisConfiguration = configuration;
+    public ServiceGroupContext fillServiceContextAndServiceGroupContext(
+            MessageContext messageContext)
+            throws AxisFault {
+        String serviceGroupContextId = messageContext.getServiceGroupContextId();
+
+        // by this time service group context id must have a value. Either from transport or from addressing
+        ServiceGroupContext serviceGroupContext;
+        ServiceContext serviceContext;
+
+        if (!isNull(serviceGroupContextId)
+                && (serviceGroupContextMap.get(serviceGroupContextId) != null)) {
+
+            // SGC is already there
+            serviceGroupContext =
+                    (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
+            serviceContext =
+                    serviceGroupContext.getServiceContext(messageContext.getAxisService().getName());
+        } else {
+
+            // either the key is null or no SGC is found from the give key
+            if (isNull(serviceGroupContextId)) {
+                serviceGroupContextId = UUIDGenerator.getUUID();
+                messageContext.setServiceGroupContextId(serviceGroupContextId);
+            }
+
+            if (messageContext.getAxisService() != null) {
+                AxisServiceGroup axisServiceGroup = messageContext.getAxisService().getParent();
+
+                serviceGroupContext = new ServiceGroupContext(this, axisServiceGroup);
+                serviceContext = serviceGroupContext.getServiceContext(
+                        messageContext.getAxisService().getName());
+
+                // set the serviceGroupContextID
+                serviceGroupContext.setId(serviceGroupContextId);
+                this.registerServiceGroupContext(serviceGroupContext);
+            } else {
+                throw new AxisFault("AxisService Not found yet");
+            }
+        }
+
+        // when you come here operation context MUST already been assigned to the message context
+        messageContext.getOperationContext().setParent(serviceContext);
+        messageContext.setServiceContext(serviceContext);
+        messageContext.setServiceGroupContext(serviceGroupContext);
+
+        return serviceGroupContext;
     }
 
     /**
@@ -76,13 +118,37 @@
      * @param messageID
      * @param mepContext
      */
-    public synchronized void registerOperationContext(
-            String messageID,
-            OperationContext mepContext) {
+    public synchronized void registerOperationContext(String messageID,
+                                                      OperationContext mepContext) {
         this.operationContextMap.put(messageID, mepContext);
     }
 
     /**
+     * Registers a ServiceContext with a given service ID.
+     */
+    public synchronized void registerServiceContext(String serviceInstanceID,
+                                                    ServiceContext serviceContext) {
+        this.serviceContextMap.put(serviceInstanceID, serviceContext);
+    }
+
+    public void registerServiceGroupContext(ServiceGroupContext serviceGroupContext) {
+        String id = serviceGroupContext.getId();
+
+        if (serviceGroupContextMap.get(id) == null) {
+            serviceGroupContextMap.put(id, serviceGroupContext);
+            serviceGroupContext.setParent(this);
+        }
+    }
+
+    public synchronized void removeService(QName name) {
+        serviceContextMap.remove(name);
+    }
+
+    public AxisConfiguration getAxisConfiguration() {
+        return axisConfiguration;
+    }
+
+    /**
      * Gets a OperationContext given a Message ID.
      *
      * @param messageID
@@ -97,12 +163,16 @@
     }
 
     /**
-     * Registers a ServiceContext with a given service ID.
+     * Allows users to resolve the path relative to the root diretory.
+     *
+     * @param path
      */
-    public synchronized void registerServiceContext(
-            String serviceInstanceID,
-            ServiceContext serviceContext) {
-        this.serviceContextMap.put(serviceInstanceID, serviceContext);
+    public File getRealPath(String path) {
+        if (rootDir == null) {
+            return new File(path);
+        } else {
+            return new File(rootDir, path);
+        }
     }
 
     /**
@@ -114,6 +184,23 @@
         return (ServiceContext) this.serviceContextMap.get(serviceInstanceID);
     }
 
+    public ServiceGroupContext getServiceGroupContext(String serviceGroupContextId) {
+        if (serviceGroupContextMap != null) {
+            return (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets all service groups in the system.
+     *
+     * @return Returns hashmap of ServiceGroupContexts.
+     */
+    public HashMap getServiceGroupContexts() {
+        return (HashMap) serviceGroupContextMap;
+    }
+
     /**
      * Returns the thread factory.
      *
@@ -123,34 +210,19 @@
         if (threadPool == null) {
             threadPool = new ThreadPool();
         }
+
         return threadPool;
     }
 
-    /**
-     * Sets the thread factory.
-     *
-     * @param pool
-     */
-    public void setThreadPool(ThreadFactory pool) throws AxisFault {
-        if (threadPool == null) {
-            threadPool = pool;
-        } else {
-            throw new AxisFault("Thread pool already set.");
-        }
-
+    private boolean isNull(String string) {
+        return "".equals(string) || (string == null);
     }
 
     /**
-     * Allows users to resolve the path relative to the root diretory.
-     *
-     * @param path
+     * @param configuration
      */
-    public File getRealPath(String path) {
-        if (rootDir == null) {
-            return new File(path);
-        } else {
-            return new File(rootDir, path);
-        }
+    public void setAxisConfiguration(AxisConfiguration configuration) {
+        axisConfiguration = configuration;
     }
 
     /**
@@ -161,83 +233,15 @@
     }
 
     /**
-     * Searches for a ServiceGroupContext in the map with given id as the key.
-     * <pre>
-     * If(key != null && found)
-     * check for a service context for the intended service.
-     * if (!found)
-     * create one and hook up to ServiceGroupContext
-     * else
-     * create new ServiceGroupContext with the given key or if key is null with a new key
-     * create a new service context for the service
-     * </pre>
+     * Sets the thread factory.
      *
-     * @param messageContext
+     * @param pool
      */
-    public ServiceGroupContext fillServiceContextAndServiceGroupContext(MessageContext messageContext) throws AxisFault {
-
-        String serviceGroupContextId = messageContext.getServiceGroupContextId();
-
-        // by this time service group context id must have a value. Either from transport or from addressing
-        ServiceGroupContext serviceGroupContext;
-        ServiceContext serviceContext;
-        if (!isNull(serviceGroupContextId) && serviceGroupContextMap.get(serviceGroupContextId) != null) {
-            // SGC is already there
-            serviceGroupContext = (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
-            serviceContext = serviceGroupContext.getServiceContext(messageContext.getAxisService().getName());
+    public void setThreadPool(ThreadFactory pool) throws AxisFault {
+        if (threadPool == null) {
+            threadPool = pool;
         } else {
-            // either the key is null or no SGC is found from the give key
-            if (isNull(serviceGroupContextId)) {
-                serviceGroupContextId = UUIDGenerator.getUUID();
-                messageContext.setServiceGroupContextId(serviceGroupContextId);
-            }
-            if (messageContext.getAxisService() != null) {
-                AxisServiceGroup axisServiceGroup =
-                        messageContext.getAxisService().getParent();
-                serviceGroupContext = new ServiceGroupContext(this, axisServiceGroup);
-                serviceContext = serviceGroupContext.getServiceContext(
-                        messageContext.getAxisService().getName());
-                //set the serviceGroupContextID
-                serviceGroupContext.setId(serviceGroupContextId);
-                this.registerServiceGroupContext(serviceGroupContext);
-            } else {
-                throw new AxisFault("AxisService Not found yet");
-            }
-        }
-
-        // when you come here operation context MUST already been assigned to the message context
-        messageContext.getOperationContext().setParent(serviceContext);
-        messageContext.setServiceContext(serviceContext);
-        messageContext.setServiceGroupContext(serviceGroupContext);
-        return serviceGroupContext;
-    }
-
-    public void registerServiceGroupContext(ServiceGroupContext serviceGroupContext) {
-        String id = serviceGroupContext.getId();
-        if (serviceGroupContextMap.get(id) == null) {
-            serviceGroupContextMap.put(id, serviceGroupContext);
-            serviceGroupContext.setParent(this);
-        }
-    }
-
-    public ServiceGroupContext getServiceGroupContext(String serviceGroupContextId) {
-        if (serviceGroupContextMap != null) {
-            return (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
+            throw new AxisFault("Thread pool already set.");
         }
-        return null;
     }
-
-    private boolean isNull(String string) {
-        return "".equals(string) || string == null;
-    }
-
-    /**
-     * Gets all service groups in the system.
-     *
-     * @return Returns hashmap of ServiceGroupContexts.
-     */
-    public HashMap getServiceGroupContexts() {
-        return (HashMap) serviceGroupContextMap;
-    }
-
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java Fri Dec 16 09:13:57 2005
@@ -21,62 +21,42 @@
 import java.util.Iterator;
 
 public class ConfigurationContextFactory {
-
-
     private Log log = LogFactory.getLog(getClass());
 
-    public ConfigurationContext getConfigurationContext(
-            AxisConfigurationCreator axisConfigurationCreator) throws AxisFault {
-        AxisConfiguration axisConfig = axisConfigurationCreator.getAxisConfiguration();
-        ConfigurationContext configContext = new ConfigurationContext(axisConfig);
-        init(configContext);
-        return configContext;
-    }
-
     /**
-     * Builds the configuration for the Server.
+     * Builds the configuration for the client.
      *
-     * @param repositoryName
-     * @return Returns the built ConfigurationContext.
+     * @param axis2home the value can be null and resolves to the default axis2.xml file
+     * @return Returns ConfigurationContext.
      * @throws DeploymentException
      */
-    public ConfigurationContext buildConfigurationContext(String repositoryName)
-            throws AxisFault {
+    public ConfigurationContext buildClientConfigurationContext(String axis2home) throws AxisFault {
         AxisConfigurationCreator repoBasedConfigCreator =
-                new FileSystemBasedAxisConfigurationCreteator(repositoryName, true);
+                new FileSystemBasedAxisConfigurationCreteator(axis2home, false);
         AxisConfiguration axisConfig = repoBasedConfigCreator.getAxisConfiguration();
         ConfigurationContext configurationContext = new ConfigurationContext(axisConfig);
+
         init(configurationContext);
+
         return configurationContext;
     }
 
     /**
-     * Builds the configuration for the client.
+     * Builds the configuration for the Server.
      *
-     * @param axis2home the value can be null and resolves to the default axis2.xml file
-     * @return Returns ConfigurationContext.
+     * @param repositoryName
+     * @return Returns the built ConfigurationContext.
      * @throws DeploymentException
      */
-    public ConfigurationContext buildClientConfigurationContext(String axis2home)
-            throws AxisFault {
+    public ConfigurationContext buildConfigurationContext(String repositoryName) throws AxisFault {
         AxisConfigurationCreator repoBasedConfigCreator =
-                new FileSystemBasedAxisConfigurationCreteator(axis2home, false);
+                new FileSystemBasedAxisConfigurationCreteator(repositoryName, true);
         AxisConfiguration axisConfig = repoBasedConfigCreator.getAxisConfiguration();
         ConfigurationContext configurationContext = new ConfigurationContext(axisConfig);
-        init(configurationContext);
-        return configurationContext;
-    }
 
+        init(configurationContext);
 
-    /**
-     * To get the default configuration context  , this will return a AxisConfiguration
-     * which is created by fileSystem based AxisConfiguration creator
-     *
-     * @return ConfigurationContext
-     */
-    public ConfigurationContext getDafaultConfigurationContext() {
-        AxisConfiguration axisConfig = new AxisConfiguration();
-        return new ConfigurationContext(axisConfig);
+        return configurationContext;
     }
 
     /**
@@ -85,6 +65,7 @@
     private void init(ConfigurationContext configContext) throws AxisFault {
         try {
             PhaseResolver phaseResolver = new PhaseResolver(configContext.getAxisConfiguration());
+
             phaseResolver.buildTranspotsChains();
             initModules(configContext);
             initTransports(configContext);
@@ -102,18 +83,15 @@
      * @param context
      * @throws DeploymentException
      */
-
-    private void initModules(ConfigurationContext context)
-            throws DeploymentException {
+    private void initModules(ConfigurationContext context) throws DeploymentException {
         try {
-            HashMap modules =
-                    context.getAxisConfiguration()
-                            .getModules();
+            HashMap modules = context.getAxisConfiguration().getModules();
             Collection col = modules.values();
+
             for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-                ModuleDescription axismodule =
-                        (ModuleDescription) iterator.next();
+                ModuleDescription axismodule = (ModuleDescription) iterator.next();
                 Module module = axismodule.getModule();
+
                 if (module != null) {
                     module.init(context.getAxisConfiguration());
                 }
@@ -131,39 +109,64 @@
     public void initTransports(ConfigurationContext configContext) {
         AxisConfiguration axisConf = configContext.getAxisConfiguration();
 
-        //Initzialize Transport Ins
+        // Initzialize Transport Ins
         HashMap transportIns = axisConf.getTransportsIn();
         Iterator values = transportIns.values().iterator();
+
         while (values.hasNext()) {
-            TransportInDescription transportIn =
-                    (TransportInDescription) values.next();
+            TransportInDescription transportIn = (TransportInDescription) values.next();
             TransportListener listener = transportIn.getReceiver();
+
             if (listener != null) {
                 try {
                     listener.init(configContext, transportIn);
                 } catch (AxisFault axisFault) {
-                    log.info("Transport-IN initialization error : " +
-                            transportIn.getName().getLocalPart());
+                    log.info("Transport-IN initialization error : "
+                            + transportIn.getName().getLocalPart());
                 }
             }
         }
-        //Initzialize Transport Outs
+
+        // Initzialize Transport Outs
         HashMap transportOuts = axisConf.getTransportsOut();
+
         values = transportOuts.values().iterator();
+
         while (values.hasNext()) {
-            TransportOutDescription transportOut =
-                    (TransportOutDescription) values.next();
+            TransportOutDescription transportOut = (TransportOutDescription) values.next();
             TransportSender sender = transportOut.getSender();
+
             if (sender != null) {
                 try {
                     sender.init(configContext, transportOut);
                 } catch (AxisFault axisFault) {
-                    log.info("Transport-OUT initialization error : " +
-                            transportOut.getName().getLocalPart());
+                    log.info("Transport-OUT initialization error : "
+                            + transportOut.getName().getLocalPart());
                 }
             }
         }
+    }
+
+    public ConfigurationContext getConfigurationContext(
+            AxisConfigurationCreator axisConfigurationCreator)
+            throws AxisFault {
+        AxisConfiguration axisConfig = axisConfigurationCreator.getAxisConfiguration();
+        ConfigurationContext configContext = new ConfigurationContext(axisConfig);
 
+        init(configContext);
+
+        return configContext;
     }
 
+    /**
+     * To get the default configuration context  , this will return a AxisConfiguration
+     * which is created by fileSystem based AxisConfiguration creator
+     *
+     * @return ConfigurationContext
+     */
+    public ConfigurationContext getDafaultConfigurationContext() {
+        AxisConfiguration axisConfig = new AxisConfiguration();
+
+        return new ConfigurationContext(axisConfig);
+    }
 }