Index: trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
===================================================================
--- trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java	(revision 1999)
+++ trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java	(revision 2000)
@@ -30,4 +30,5 @@
 import java.util.logging.Level;
 
+import org.apache.commons.lang.mutable.MutableInt;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.uml2.uml.Activity;
@@ -59,5 +60,4 @@
 import org.eclipse.uml2.uml.MessageSort;
 import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.NamedElement;
 import org.eclipse.uml2.uml.Operation;
 import org.eclipse.uml2.uml.Package;
@@ -561,5 +561,5 @@
                     callMessage.setSignature(calledOperation);
                     setMessageParameters(callMessage, calledOperation, event,
-                                             useRandomRequestBodies, prefix);
+                                         useRandomRequestBodies, prefix);
                     callMessage.setConnector(connector);
                     callMessage.setSendEvent(callSendFragment);
@@ -611,6 +611,7 @@
                     replyMessage.setMessageSort(MessageSort.REPLY_LITERAL);
                     replyMessage.setSignature(calledOperation);
-                    //setReplyMessageParameters(replyMessage, calledOperation);
-                    setMessageParameters(replyMessage, calledOperation, event, useRandomRequestBodies, prefix);
+                    // setReplyMessageParameters(replyMessage, calledOperation);
+                    setMessageParameters(replyMessage, calledOperation, event,
+                                         useRandomRequestBodies, prefix);
                     replyMessage.setConnector(connector);
                     replyMessage.setSendEvent(replySendFragment);
@@ -649,30 +650,32 @@
                 Message message =
                     ((MessageOccurrenceSpecification) interactionFragment).getMessage();
-                //if (message.getReceiveEvent().equals(interactionFragment) && isCallMessage(message))
-                if (message.getReceiveEvent().equals(interactionFragment))
-                {
+                // if (message.getReceiveEvent().equals(interactionFragment) &&
+                // isCallMessage(message))
+                if (message.getReceiveEvent().equals(interactionFragment)) {
                     String clientName;
                     String serviceName;
                     String methodName = message.getSignature().getName();
                     CallType callType;
-                    if( isCallMessage(message) ) {
+                    if (isCallMessage(message)) {
                         clientName =
-                                ((MessageOccurrenceSpecification) message.getSendEvent()).getCovereds()
-                                    .get(0).getName();
+                            ((MessageOccurrenceSpecification) message.getSendEvent()).getCovereds()
+                                .get(0).getName();
                         serviceName =
-                                ((MessageOccurrenceSpecification) message.getReceiveEvent()).getCovereds()
-                                    .get(0).getName();
+                            ((MessageOccurrenceSpecification) message.getReceiveEvent())
+                                .getCovereds().get(0).getName();
                         callType = CallType.REQUEST;
-                    } else {
+                    }
+                    else {
                         clientName =
-                                ((MessageOccurrenceSpecification) message.getReceiveEvent()).getCovereds()
-                                    .get(0).getName();
+                            ((MessageOccurrenceSpecification) message.getReceiveEvent())
+                                .getCovereds().get(0).getName();
                         serviceName =
-                                ((MessageOccurrenceSpecification) message.getSendEvent()).getCovereds()
-                                    .get(0).getName();
+                            ((MessageOccurrenceSpecification) message.getSendEvent()).getCovereds()
+                                .get(0).getName();
                         callType = CallType.RESPONSE;
                     }
                     eventSequence.add(new Event(new SimpleSOAPEventType(methodName, serviceName,
-                                                                        clientName, null, null, callType)));
+                                                                        clientName, null, null,
+                                                                        callType)));
                 }
             }
@@ -1063,18 +1066,20 @@
      */
     private static void setMessageParameters(Message message,
-                                                 Operation calledOperation,
-                                                 Event event,
-                                                 boolean useRandomMsgBodies,
-                                                 String prefix)
+                                             Operation calledOperation,
+                                             Event event,
+                                             boolean useRandomMsgBodies,
+                                             String prefix)
     {
         org.w3c.dom.Element requestBody;
-        if(SOAPUtils.isSOAPRequest(event)) {
+        if (SOAPUtils.isSOAPRequest(event)) {
             requestBody =
                 SOAPUtils.getSoapBodyFromEvent(event, useRandomMsgBodies, CallType.REQUEST);
-        } else {
+        }
+        else {
             requestBody =
                 SOAPUtils.getSoapBodyFromEvent(event, useRandomMsgBodies, CallType.RESPONSE);
         }
         Package instSpecPkg = null;
+        MutableInt instSpecNumber = new MutableInt(0);
 
         // FOR DEBUGGING
@@ -1108,6 +1113,5 @@
         for (Parameter param : calledOperation.getOwnedParameters()) {
             if (instSpecPkg == null) {
-                instSpecPkg =
-                    getOrCreateInstanceSpecificationPackage(message.getModel(), event);
+                instSpecPkg = getOrCreateInstanceSpecificationPackage(message.getModel(), event);
             }
 
@@ -1118,6 +1122,7 @@
             // (Expression) callMessage.createArgument(param.getName(), param.getType(),
             // UMLPackage.Literals.EXPRESSION);
-            if ( (isInParameter(param) && SOAPUtils.isSOAPRequest(event)) ||
-                 (isOutParameter(param) && SOAPUtils.isSOAPResponse(event))) {
+            if ((isInParameter(param) && SOAPUtils.isSOAPRequest(event)) ||
+                (isOutParameter(param) && SOAPUtils.isSOAPResponse(event)))
+            {
 
                 // create parameters node
@@ -1127,7 +1132,8 @@
                 DataType parametersNode = (DataType) param.getType();
                 InstanceSpecification instSpecParameters =
-                    (InstanceSpecification) instSpecPkg.createPackagedElement(prefix + "instspec_" +
+                    (InstanceSpecification) instSpecPkg.createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + "_" +
                         param.getType().getName(), UMLPackage.Literals.INSTANCE_SPECIFICATION);
                 instSpecParameters.getClassifiers().add((DataType) param.getType());
+                instSpecNumber.setValue(instSpecNumber.intValue()+1);
                 // InstanceValue parametersValue =
                 // (InstanceValue) argument
@@ -1137,5 +1143,5 @@
                 InstanceValue instanceValue =
                     (InstanceValue) message.createArgument(param.getName(), param.getType(),
-                                                               UMLPackage.Literals.INSTANCE_VALUE);
+                                                           UMLPackage.Literals.INSTANCE_VALUE);
                 instanceValue.setInstance(instSpecParameters);
 
@@ -1178,5 +1184,5 @@
                                 .setInstance(createInstanceSpecification((DataType) internalParameter
                                                                              .getType(),
-                                                                         instSpecPkg, prefix,
+                                                                         instSpecPkg, prefix, instSpecNumber, 
                                                                          paramNode, path));
                             /*
@@ -1197,5 +1203,5 @@
                 // argument.createOperand(null, param.getType(), UMLPackage.Literals.LITERAL_NULL);
                 message.createArgument(param.getName(), param.getType(),
-                                           UMLPackage.Literals.LITERAL_NULL);
+                                       UMLPackage.Literals.LITERAL_NULL);
             }
         }
@@ -1225,4 +1231,5 @@
                                                                      Package pkg,
                                                                      String prefix,
+                                                                     MutableInt instSpecNumber,
                                                                      org.w3c.dom.Element currentNode,
                                                                      String path)
@@ -1234,7 +1241,8 @@
         InstanceSpecification instSpec =
             (InstanceSpecification) pkg
-                .createPackagedElement(prefix + "instspec_" + type.getName(),
+                .createPackagedElement(prefix + "instspec" + instSpecNumber.intValue() + "_" + type.getName(),
                                        UMLPackage.Literals.INSTANCE_SPECIFICATION);
         instSpec.getClassifiers().add(type);
+        instSpecNumber.setValue(instSpecNumber.intValue()+1);
         for (Property prop : type.getAllAttributes()) {
             if (prop.getType() instanceof PrimitiveType) {
@@ -1277,5 +1285,5 @@
                                                          UMLPackage.Literals.INSTANCE_VALUE);
                     value.setInstance(createInstanceSpecification((DataType) prop.getType(), pkg,
-                                                                  prefix, attributeNode, path +
+                                                                  prefix, instSpecNumber, attributeNode, path +
                                                                       "." + prop.getName()));
                 }
@@ -1518,6 +1526,6 @@
             LiteralNull argument =
                 (LiteralNull) replyMessage.createArgument(param.getName(), param.getType(),
-                                                         UMLPackage.Literals.LITERAL_NULL);
-            
+                                                          UMLPackage.Literals.LITERAL_NULL);
+
             if (isOutParameter(param)) {
                 argument.applyStereotype(UTPUtils.getLiteralAnyStereotype(replyMessage.getModel()));
