Index: trunk/zoo-project/zoo-kernel/service.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service.h	(revision 454)
+++ trunk/zoo-project/zoo-kernel/service.h	(revision 458)
@@ -254,52 +254,4 @@
   }
 
-  static char* getMapsAsKVP(maps* m,int length,int type){
-    char *dataInputsKVP=(char*) malloc(length*sizeof(char));
-    maps* curs=m;
-    int i=0;
-    while(curs!=NULL){
-      map *inRequest=getMap(curs->content,"inRequest");
-      if(strncasecmp(inRequest->value,"true",4)==0){
-	if(i==0)
-	  if(type==0)
-	    sprintf(dataInputsKVP,"%s=",curs->name);
-	  else
-	    sprintf(dataInputsKVP,"%s",curs->name);
-	else{
-	  char *temp=zStrdup(dataInputsKVP);
-	  if(type==0)
-	    sprintf(dataInputsKVP,"%s;%s=",temp,curs->name);
-	  else
-	    sprintf(dataInputsKVP,"%s;%s",temp,curs->name);
-	  free(temp);
-	}
-	map* icurs=curs->content;
-	if(type==0){
-	  char *temp=zStrdup(dataInputsKVP);
-	  if(getMap(m->content,"xlink:href")!=NULL)
-	    sprintf(dataInputsKVP,"%sReference",temp);
-	  else
-	    sprintf(dataInputsKVP,"%s%s",temp,icurs->value);
-	  free(temp);
-	}
-	while(icurs!=NULL){
-	  if(strcasecmp(icurs->name,"value")!=0 &&
-	     strcasecmp(icurs->name,"Reference")!=0 &&
-	     strcasecmp(icurs->name,"minOccurs")!=0 &&
-	     strcasecmp(icurs->name,"maxOccurs")!=0 &&
-	     strcasecmp(icurs->name,"inRequest")!=0){
-	    char *itemp=zStrdup(dataInputsKVP);
-	    sprintf(dataInputsKVP,"%s@%s=%s",itemp,icurs->name,icurs->value);
-	    free(itemp);
-	  }
-	  icurs=icurs->next;
-	}
-      }
-      curs=curs->next;
-      i++;
-    }
-    return dataInputsKVP;
-  }
-
 
   static void freeMap(map** mo){
@@ -909,4 +861,86 @@
   }
 
+#ifdef WIN32
+  extern char *url_encode(char *);
+
+  static char* getMapsAsKVP(maps* m,int length,int type){
+    char *dataInputsKVP=(char*) malloc(length*sizeof(char));
+    char *dataInputsKVPi=NULL;
+    maps* curs=m;
+    int i=0;
+    while(curs!=NULL){
+      map *inRequest=getMap(curs->content,"inRequest");
+      map *hasLength=getMap(curs->content,"length");
+      if((inRequest!=NULL && strncasecmp(inRequest->value,"true",4)==0) ||
+	 inRequest==NULL){
+	if(i==0)
+	  if(type==0){
+	    sprintf(dataInputsKVP,"%s=",curs->name);
+	    if(hasLength!=NULL){
+	      dataInputsKVPi=(char*)malloc((strlen(curs->name)+2)*sizeof(char));
+	      sprintf(dataInputsKVPi,"%s=",curs->name);
+	    }
+	  }
+	  else
+	    sprintf(dataInputsKVP,"%s",curs->name);
+	else{
+	  char *temp=zStrdup(dataInputsKVP);
+	  if(type==0)
+	    sprintf(dataInputsKVP,"%s;%s=",temp,curs->name);
+	  else
+	    sprintf(dataInputsKVP,"%s;%s",temp,curs->name);
+	}
+	map* icurs=curs->content;
+	if(type==0){
+	  char *temp=zStrdup(dataInputsKVP);
+	  if(getMap(curs->content,"xlink:href")!=NULL)
+	    sprintf(dataInputsKVP,"%sReference",temp);
+	  else{
+	    if(hasLength!=NULL){
+	      for(int j=0;j<atoi(hasLength->value);j++){
+		map* tmp0=getMapArray(curs->content,"value",j);
+		if(j==0)
+		  free(temp);
+		temp=zStrdup(dataInputsKVP);
+		if(j==0)
+		  sprintf(dataInputsKVP,"%s%s",temp,tmp0->value);
+		else
+		  sprintf(dataInputsKVP,"%s;%s%s",temp,dataInputsKVPi,tmp0->value);
+	      }
+	    }
+	    else
+	      sprintf(dataInputsKVP,"%s%s",temp,icurs->value);
+	  }
+	  free(temp);
+	}
+	while(icurs!=NULL){
+	  if(strncasecmp(icurs->name,"value",5)!=0 &&
+	     strncasecmp(icurs->name,"mimeType_",9)!=0 &&
+	     strncasecmp(icurs->name,"dataType_",9)!=0 &&
+	     strncasecmp(icurs->name,"size",4)!=0 &&
+	     strncasecmp(icurs->name,"length",4)!=0 &&
+	     strncasecmp(icurs->name,"isArray",7)!=0 &&
+	     strcasecmp(icurs->name,"Reference")!=0 &&
+	     strcasecmp(icurs->name,"minOccurs")!=0 &&
+	     strcasecmp(icurs->name,"maxOccurs")!=0 &&
+	     strncasecmp(icurs->name,"fmimeType",9)!=0 &&
+	     strcasecmp(icurs->name,"inRequest")!=0){
+	    char *itemp=zStrdup(dataInputsKVP);
+	    if(strcasecmp(icurs->name,"xlink:href")!=0)
+	      sprintf(dataInputsKVP,"%s@%s=%s",itemp,icurs->name,icurs->value);
+	    else
+	      sprintf(dataInputsKVP,"%s@%s=%s",itemp,icurs->name,url_encode(icurs->value));
+	    free(itemp);
+	  }
+	  icurs=icurs->next;
+	}
+      }
+      curs=curs->next;
+      i++;
+    }
+    return dataInputsKVP;
+  }
+#endif
+
 #ifdef __cplusplus
 }
