Index: /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/SOAPUtils.java
===================================================================
--- /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/SOAPUtils.java	(revision 1993)
+++ /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/SOAPUtils.java	(revision 1994)
@@ -94,5 +94,6 @@
                         newSequence.add(new Event(new SimpleSOAPEventType(eventType
                             .getCalledMethod(), eventType.getServiceName(), eventType
-                            .getClientName(), eventType.getSoapRequestBody(), equalSOAPDataMap)));
+                            .getClientName(), eventType.getSoapRequestBody(), equalSOAPDataMap,
+                                                                          CallType.REQUEST)));
                     }
                     else {
@@ -222,32 +223,124 @@
      */
     public static Element getSoapBodyFromEvent(Event event) {
-        return getSoapBodyFromEvent(event, false);
-    }
-
-    /**
-     * <p>
-     * Helper function to get the body of a SOAP request.
+        return getSoapBodyFromEvent(event, false, CallType.REQUEST);
+    }
+
+    /**
+     * <p>
+     * Helper function to get the body of a SOAP message.
      * </p>
      * 
      * @param event
-     *            event for which the SOAP request body is retrieved
-     * @param useRandomRequestBodies
-     *            defines is random request bodies are used or the body of the associated event
+     *            event for which the SOAP message body is retrieved
+     * @param useRandomBodies
+     *            defines if random message bodies are used or the body of the associated event
+     * @param callType
+     *            defines if the request or response of a message is retrieved
      * @return body of the SOAP event
      */
-    public static Element getSoapBodyFromEvent(Event event, boolean useRandomRequestBodies) {
-        Element requestBody = null;
+    public static Element getSoapBodyFromEvent(Event event,
+                                               boolean useRandomBodies,
+                                               CallType callType)
+    {
         if (event.getType() instanceof SOAPEventType) {
-            requestBody = ((SOAPEventType) event.getType()).getSoapRequestBody();
+            switch (callType)
+            {
+                case REQUEST:
+                    return ((SOAPEventType) event.getType()).getSoapRequestBody();
+                case RESPONSE:
+                    return ((SOAPEventType) event.getType()).getSoapResponseBody();
+                default:
+                    throw new RuntimeException("unsupported call type: " + callType);
+            }
         }
         else if (event.getType() instanceof SimpleSOAPEventType) {
-            if (useRandomRequestBodies) {
-                requestBody = ((SimpleSOAPEventType) event.getType()).getRandomSoapMsgBody();
-            }
-            else {
-                requestBody = ((SimpleSOAPEventType) event.getType()).getSoapMsgBody();
-            }
-        }
-        return requestBody;
+            switch (callType)
+            {
+                case REQUEST:
+                    if (((SimpleSOAPEventType) event.getType()).getCallType() == CallType.REQUEST) {
+                        if (useRandomBodies) {
+                            return ((SimpleSOAPEventType) event.getType()).getRandomSoapMsgBody();
+                        }
+                        else {
+                            return ((SimpleSOAPEventType) event.getType()).getSoapMsgBody();
+                        }
+                    }
+                    else {
+                        throw new RuntimeException(
+                                                   "cannot retrieve request body, is of CallType: " +
+                                                       ((SimpleSOAPEventType) event.getType())
+                                                           .getCallType());
+                    }
+                case RESPONSE:
+                    if (((SimpleSOAPEventType) event.getType()).getCallType() == CallType.RESPONSE)
+                    {
+                        if (useRandomBodies) {
+                            return ((SimpleSOAPEventType) event.getType()).getRandomSoapMsgBody();
+                        }
+                        else {
+                            return ((SimpleSOAPEventType) event.getType()).getSoapMsgBody();
+                        }
+                    }
+                    else {
+                        throw new RuntimeException(
+                                                   "cannot retrieve response body, is of CallType: " +
+                                                       ((SimpleSOAPEventType) event.getType())
+                                                           .getCallType());
+                    }
+                default:
+                    throw new RuntimeException("unsupported call type: " + callType);
+            }
+        }
+        else {
+            throw new RuntimeException(
+                                       "unsupported event type; must be SOAPEventType or SimpleSOAPEventType but is: " +
+                                           event.getType().getClass().getName());
+        }
+    }
+
+    /**
+     * <p>
+     * Checks if an event is a SOAP request
+     * </p>
+     * 
+     * @param event
+     *            event that is checked
+     * @return true if SOAP request; false otherwise
+     */
+    public static boolean isSOAPRequest(Event event) {
+        if (event.getType() instanceof SOAPEventType) {
+            return true;
+        }
+        else if (event.getType() instanceof SimpleSOAPEventType) {
+            return ((SimpleSOAPEventType) event.getType()).getCallType() == CallType.REQUEST;
+        }
+        else {
+            throw new RuntimeException(
+                                       "unsupported event type; must be SOAPEventType or SimpleSOAPEventType but is: " +
+                                           event.getType().getClass().getName());
+        }
+    }
+
+    /**
+     * <p>
+     * Checks if an event is a SOAP response
+     * </p>
+     * 
+     * @param event
+     *            event that is checked
+     * @return true if SOAP response; false otherwise
+     */
+    public static boolean isSOAPResponse(Event event) {
+        if (event.getType() instanceof SOAPEventType) {
+            return true;
+        }
+        else if (event.getType() instanceof SimpleSOAPEventType) {
+            return ((SimpleSOAPEventType) event.getType()).getCallType() == CallType.RESPONSE;
+        }
+        else {
+            throw new RuntimeException(
+                                       "unsupported event type; must be SOAPEventType or SimpleSOAPEventType but is: " +
+                                           event.getType().getClass().getName());
+        }
     }
 
@@ -384,5 +477,6 @@
                                                           eventType.getClientName(),
                                                           eventType.getSoapMsgBody(),
-                                                          eventType.getEqualSOAPDataMap()),
+                                                          eventType.getEqualSOAPDataMap(),
+                                                          eventType.getCallType()),
                                   event.getTarget());
                 }
@@ -497,4 +591,5 @@
                     long responseOrderId =
                         soapEventType.getExchange().getResponse().getOrderingId();
+                    // System.out.println(requestOrderId + " / " + responseOrderId);
 
                     if (requestOrderId > lastOrderId && requestOrderId < selectedOrderId) {
@@ -532,6 +627,7 @@
                     lastOrderId = selectedOrderId;
                 }
-                
-            } while(selectedEvent!=null);
+
+            }
+            while (selectedEvent != null);
             sortedSequences.add(sortedSequence);
         }
Index: /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java
===================================================================
--- /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java	(revision 1993)
+++ /trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java	(revision 1994)
@@ -17,4 +17,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -91,39 +94,10 @@
      * reference to the {@link EqualSOAPDataMap} associated with the sequence this event belongs to.
      */
-    private final EqualSOAPDataMap equalBodyMap;
-
-    /**
-     * <p>
-     * Constructor. Creates a new SimpleSOAPEventType.
-     * </p>
-     * 
-     */
-    public SimpleSOAPEventType(String calledMethod,
-                               String serviceName,
-                               String clientName,
-                               Element soapMsgBody)
-    {
-        this(calledMethod, serviceName, clientName, soapMsgBody, null, CallType.REQUEST);
-    }
-
-    /**
-     * <p>
-     * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap.
-     * </p>
-     * 
-     */
-    public SimpleSOAPEventType(String calledMethod,
-                               String serviceName,
-                               String clientName,
-                               Element soapMsgBody,
-                               EqualSOAPDataMap equalRequestsMap)
-    {
-        this(calledMethod, serviceName, clientName, soapMsgBody, equalRequestsMap,
-             CallType.REQUEST);
-    }
-
-    /**
-     * <p>
-     * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap.
+    private transient EqualSOAPDataMap equalBodyMap;
+
+    /**
+     * <p>
+     * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap. Should always call
+     * initEqualBodyMap afterwards.
      * </p>
      * 
@@ -151,9 +125,7 @@
         this.soapMsgBody = SOAPUtils.getSerialization(soapMsgBody);
         this.callType = callType;
-
-        // this must be the last part of the constructor and only be called after all variables are
-        // initialized
-        if (equalRequestsMap != null) {
-            equalRequestsMap.add(this, this.soapMsgBody);
+        
+        if (equalBodyMap != null) {
+            equalBodyMap.add(this, this.soapMsgBody);
         }
     }
@@ -256,5 +228,17 @@
         }
         else if (obj instanceof SimpleSOAPEventType) {
-            return callType.equals(((SimpleSOAPEventType) obj).callType) &&
+            boolean callTypesEqual = true;
+            if (callType == null) {
+                if (((SimpleSOAPEventType) obj).callType == null) {
+                    callTypesEqual = true;
+                }
+                else {
+                    callTypesEqual = false;
+                }
+            }
+            else {
+                callTypesEqual = callType.equals(((SimpleSOAPEventType) obj).callType);
+            }
+            return callTypesEqual &&
                 HTTPUtils.equals(calledMethod, ((SimpleSOAPEventType) obj).calledMethod) &&
                 HTTPUtils.equals(serviceName, ((SimpleSOAPEventType) obj).serviceName) &&
@@ -273,6 +257,12 @@
     @Override
     public int hashCode() {
-        return callType.hashCode() + calledMethod.hashCode() + serviceName.hashCode() +
-            clientName.hashCode();
+        int hashCode = 13;
+        if (callType != null) {
+            hashCode += callType.hashCode();
+        }
+        if (calledMethod == null || serviceName == null || clientName == null) {
+            System.out.print("fu!");
+        }
+        return hashCode + calledMethod.hashCode() + serviceName.hashCode() + clientName.hashCode();
     }
 
@@ -296,3 +286,18 @@
         }
     }
+    
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        out.defaultWriteObject();
+        out.writeObject(equalBodyMap);
+    }
+
+    private void readObject(ObjectInputStream in)
+        throws ClassNotFoundException, IOException
+    {
+        in.defaultReadObject();
+        equalBodyMap = (EqualSOAPDataMap) in.readObject();
+        if ( equalBodyMap == null) {
+            throw new InvalidObjectException("null");
+        }
+    }
 }
Index: /trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java
===================================================================
--- /trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java	(revision 1993)
+++ /trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java	(revision 1994)
@@ -19,11 +19,8 @@
 import java.io.FileOutputStream;
 import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 import java.util.Random;
-import java.util.Set;
 import java.util.logging.Level;
 
@@ -42,5 +39,4 @@
 import de.ugoe.cs.autoquest.plugin.http.HTTPLogParser;
 import de.ugoe.cs.autoquest.plugin.http.SOAPUtils;
-import de.ugoe.cs.autoquest.plugin.http.SOAPUtils.SequenceOrder;
 import de.ugoe.cs.autoquest.plugin.http.eventcore.SimpleSOAPEventType;
 import de.ugoe.cs.autoquest.testgeneration.RandomWalkGenerator;
@@ -173,9 +169,9 @@
             .add(new Event(new SimpleSOAPEventType("transportInstructionRequest",
                                                    "TransportService", "Logistics_Environment",
-                                                   null)));
+                                                   null, null, null)));
         manuallyCreatedSequence
             .add(new Event(new SimpleSOAPEventType("transportInstructionConfirmationRequest",
                                                    "materialSupplierService",
-                                                   "Logistics_Environment", null)));
+                                                   "Logistics_Environment", null, null, null)));
 
         // TODO make test case run
@@ -271,4 +267,14 @@
     public void testValidateModelWithLog_ITA_1() throws Exception {
         validateModelWithLogWorkflow(ita_1);
+    }
+    
+    @Test
+    public void testSerialization_ITA_1() throws Exception {
+        TestData testdata = ita_1;
+        Properties properties = loadProperties(testdata);
+        Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties);
+        IStochasticProcess model = createUsageProfile(testdata, sequences);
+        byte[] serialized = SerializationUtils.serialize(model);
+        SerializationUtils.deserialize(serialized);
     }
 
