Generate unique 10 char string

Hi,
i have to generate a unique 10 char string ( a string with length of 10 ) which has numbers and alphabets with no special characters, is there any code of doing it
Ashish

class UniqueString {
  private static final int NUM_CHARS = 10;
  private static int[] lastString = new int[NUM_CHARS];
  private static final String chars =
"0123456789abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
  static String getUnique() {   
     char[] buf = new char[NUM_CHARS];   
     carry(lastString, buf.length-1);
     for(int i=0;i<buf.length;i++) {
       buf[i] = chars.charAt(lastString);
return new String(buf);
private static void carry(int[] ca, int index) {
if(ca[index]==(chars.length()-1)) {
ca[index]=0;
carry(ca,--index);
else ca[index]= ca[index]+1;
public static void main(String[] args) {
for(int i=0;i<10000;i++)
     System.out.println(UniqueString.getUnique());
Guarenteed to be unique within one VM instance.
matfud

Similar Messages

  • I have to generate a 4 char unique string from a long value

    I got a requirment
    I have to generate a 4 char unique string from a long value
    Eeach char can be any of 32 character defined has below.
    private static final char char_map[] = new char[]{'7','2','6','9','5','3','4','8','X','M','G','D','A','E','B','F','C','Q','J','Y','H','U','W','V','S','K','R','L','N','P','Z','T'};
    So for 4 char string the possible combination can be 32 * 32 * 32 * 32 = 1048576
    If any one passes a long value between 0 - 1048576 , it should generate a unique 4 char string.
    Any one with idea will be a great help.

    Well, a long is 64 bits. A char is 16 bits. Once you determine how you want to map the long's bits to your char bits, go google for "java bitwise operators".

  • How to generate unique filenames??

    i need to be able to generate unique files from a servlet..
    my initial instinct was to use the seesion id as part of the filename, however as this file will be embedded in the responding html, this is not safe, as the user will only have to look at the html source to view a session id value.
    i am now considering to use the date/time of the creation of a session as the unique identifier for the file, however this will not work if two sessions can be created at the same time.
    my question thefore is if no two sessions can have the same date and time?
    if not.. can anyone give me an idea as how to produce unique filenames?

    If you are actually creating a file, why not usethe
    java.io.File.createTempFile() method?how does that help with prducing a unique value to use
    as the name of a file?
    with that method i still need to supply the filename
    as one of its arguments!
    No you don't. You provide a prefix and suffix and it fills in the middle with something guaranteed to be unique, in the directory you specify. Here is the javadoc:
    createTempFile
    public static File createTempFile(String prefix,
    String suffix,
    File directory)
    throws IOException
    Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name. If this method returns successfully then it is guaranteed that:
    1. The file denoted by the returned abstract pathname did not exist before this method was invoked, and
    2. Neither this method nor any of its variants will return the same abstract pathname again in the current invocation of the virtual machine.
    This method provides only part of a temporary-file facility. To arrange for a file created by this method to be deleted automatically, use the deleteOnExit() method.
    The prefix argument must be at least three characters long. It is recommended that the prefix be a short, meaningful string such as "hjb" or "mail". The suffix argument may be null, in which case the suffix ".tmp" will be used.
    To create the new file, the prefix and the suffix may first be adjusted to fit the limitations of the underlying platform. If the prefix is too long then it will be truncated, but its first three characters will always be preserved. If the suffix is too long then it too will be truncated, but if it begins with a period character ('.') then the period and the first three characters following it will always be preserved. Once these adjustments have been made the name of the new file will be generated by concatenating the prefix, five or more internally-generated characters, and the suffix.
    If the directory argument is null then the system-dependent default temporary-file directory will be used. The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of this property is typically "/tmp" or "/var/tmp"; on Microsoft Windows systems it is typically "c:\\temp". A different value may be given to this system property when the Java virtual machine is invoked, but programmatic changes to this property are not guaranteed to have any effect upon the the temporary directory used by this method.
    Parameters:
    prefix - The prefix string to be used in generating the file's name; must be at least three characters long
    suffix - The suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be used
    directory - The directory in which the file is to be created, or null if the default temporary-file directory is to be used
    Returns:
    An abstract pathname denoting a newly-created empty file
    Throws:
    IllegalArgumentException - If the prefix argument contains fewer than three characters
    IOException - If a file could not be created
    SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method does not allow a file to be created
    Since:
    1.2

  • Generating unique no.'s using random function

    Hi,
    I'm trying to generate unique values for row and column say from 0-3
    and I read some where that if we use random.nextInt() we will get unique values but I'm getting repeated values.I'll appreciate if anyone can help me in this matter.Here's the code:
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class random{
    public static void main(String args[])
    int b[]=new int[4];
    int c[]=new int[4];
    int i;
    Date date;
    Random random;
    date=new Date();
    random = new Random(date.getTime());
    for(i=0;i<4;i++)
    digit = random.nextInt(4);
    b=digit;
    for(i=0;i<4;i++)
    digit = random.nextInt(4);
    c[i] = digit;
    for(i=0;i<4;i++)
    System.out.println("column array is" + c[i]);
    for(i=0;i<4;i++)
    System.out.println("row array is" + b[i]);
    }//end main
    }//end class
    Thanks
    Suneetha.

    here is my code for generating a random number but not a unique number. with a big enough number the possibility getting a unique is high so you may modify it to suit you need:
      private void initial_node()
        float Qxyd = -1, Qyzd = -1, Cxyd = -1, Cyzd = -1;
        long seed;
        Q_table = new float[row][col];
        seed = (long)( Math.random() * System.currentTimeMillis() * 100000000 );
        Random rand1 = new Random( seed );
        seed = (long)( Math.random() * System.currentTimeMillis() * 100000000 );
        Random rand2 = new Random( seed );
        seed = (long)( Math.random() * System.currentTimeMillis() * 100000000 );
        Random rand3 = new Random( seed );
        seed = (long)( Math.random() * System.currentTimeMillis() * 100000000 );
        Random rand4 = new Random( seed );
        for( int i = 0; i < row; i++ )
          do
            Qxyd = (float)( rand1.nextFloat() + (float)rand1.nextFloat() / 3 );
          while( Qxyd < 0.35 || Qxyd == -1 );
          Q_table[5] = Math.abs( Qxyd );
    do
    Qyzd = (float)( rand2.nextFloat() + (float)rand2.nextFloat() / 7 );
    while( Qyzd < 0.45 || Qyzd == -1 );
    Q_table[i][3] = Math.abs( Qyzd );
    do
    Cxyd = (float)( rand3.nextFloat() + (float)rand3.nextFloat() / 9 );
    while( Cxyd > 0.15 || Cxyd == -1 );
    Q_table[i][8] = Math.abs( Cxyd );
    do
    Cyzd = (float)( rand4.nextFloat() + (float)rand4.nextFloat() / 11 );
    while( Cyzd > 0.10 || Cyzd == -1 );
    Q_table[i][9] = Math.abs( Cyzd );

  • How to generate 10,000 different strings?

    Hi, everyone!
    I want to generate 10,000 different strings. I mean they are
    different from each other. The characters that is used to
    form the string is a subset of ASCII. A optional requirement is
    that I can assign the length of the string.
    Who have efficient solutions? Have I made myself understood?
    Are there some sample codes that I can refer?
    regards,
    George

    Your method is nice, but if I want to generate
    random strings, what can I do? well, in case you want to generate something RANDOM, then you should use java.util.Random or Math.random()
    if you want to have those strings differing from each other, then you could number them...
    for example you get five random characters from your array of chars you want to use, and then add numbers from 1 to 10000 at the end of it (you may use other numbers as well, you already have some good exsamples)
    or if you don't want to number your strings, then you'd have to deal with the risk that one string is generated more than once. to escape this risk you may store all these strings in an array and then check if you already have that string... if yes, then skip it...

  • How can I get an unsigned char string with nulls from a dll into LabVIEW 6i?

    The following ethernet packet data is contained in an unsigned char * string returned from my dll (it's formatted on printing):
    Received A 230 Packet On Adapter 0x008F0070
    Ethernet Dest: 01.E0.BB.00.00.15 Src: 00.E0.BB.00.DD.CC Type: 0x8868
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 F0 18 FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................etc., etc.
    However, when I read this string into LabVIEW 6i, I only get the following:
    01E0 BB
    Which is the data before the first NULL or 00 information. I found a "Remove Unprintable Chars.vi" but it
    just sees more data before the above string, nothing after, as seen here: 5C30 31E0 BB.
    Anybody have any suggestions for how to get the rest of the string? Is there something I can do to further reformat my dll? The dll I'm using is already a wrapper around another dll so I have some flexibility, but the bottom line is, the data I want is in the format of an unsigned char *.

    Excellent advice, this mostly works so I have some further questions:
    I am just reading network traffic off my ethernet card right now, but here is what I get using my C program to test:
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 38 3C FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ..8<............
    000030: FF 7F 7F FF FF 7F 7F FF : 7F 7F 7F FF FF FF FF FE ................
    000040: FE FF FF FF FF 7F 7F 7F : 7F 7E 7E 7F 7F 7E 7E FF .........~~..~~.
    000050: 7F 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7E 7F ..............~.
    000060: 7F 7F 7E 7F 7F 7E 7F FF : FF 7F FF FF FE FF FF FE ..~..~..........
    000070: FF FF FF FF FF 7F 7F FF : FF 7F 7F FF FF FF FF FF ................
    000080: FF 7F 7F FF FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................
    000090: FF 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ................
    0000A0: FF 7F 7F 7F 7F 7E 7E 7F : 7F 7F FF FF FF FF FF FF .....~~.........
    0000B0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7E 7F FF .............~..
    0000C0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7F 7F FF ................
    0000D0: FF 7F 7F FF FF 7F 7F 7F : 7F 7F 7F FF FF FF FF FE ................
    0000E0: FE FF FF FF 00 01 : ................
    And here is what I get using LabVIEW to call the dll:
    0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 B405 4300 3300 0000 0000 0000 01E0 BB00 0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 F405 1B04 0C04 0000 0000 0000 8000 0000 0000 0000 0800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    The first thing I notice is that the first 4 bytes are chopped off, and after about 50 bytes, the data is corrupted until the sequence starts to repeat, but this time it starts with the missing 4 bytes and still corrupts after about 55 bytes.
    I am expecting the data in LabVIEW to look very similar to the C data because the network packets I am grabbing are pretty consistant, only a couple bytes will vary between them, not the number I am seeing in LabVIEW.
    Another side effect I'm seeing is that I can only run my labVIEW code once, if I try running it again it crashes with failures such as:
    memory could not be "read"
    For reference, I am opening and closing the network adapter inside the read function of my dll, but the pointer seems like it should be intact...
    Attachments:
    zListAdapters.vi ‏30 KB
    listAdapters.dll ‏201 KB
    Reading.dll ‏213 KB

  • How to generate unique numbers

    hi all,
    I want to generate unique numbers always starting from 1 using a single sql query and I dont want to use a sequence and i dont think rownum will be helpful for generating unique numbers in all cases . how to do this ?
    thanks & regards,
    kumar.

    If two users get the MAX from temp, they would be updating with the same value for two different rows.If TEMP is a genuine temporary table, this is not an issue, because the data in a temporary table is only visible within a session.
    The big problem with this approach is the mutating table one: we cannot issue the requisite select statement from a BEFORE INSERT trigger. So this solution is only going to work with a view and an INSTEAD OF INSERT trigger.
    Another, more workable, solution is to use a code control table. This can be (should be) another temporary table, with one row holding one column - next value for TEMP.ID. Normally we would rule out such a solution because it serializes access to the inserted table, but as this is only on a per session basis, it doesn't matter.
    CREATE OR REPLACE TRIGGER tmp_bir BEFORE INSERT ON temp1 FOR EACH ROW
    DECLARE
      ln NUMBER;
    BEGIN
      SELECT nvl(code1.next_id,1) INTO ln
      FROM code1;
      :NEW.id := ln;
      UPDATE code1
      SET    next_id := ln+1;
    END;Beware: coded freehand, so may need debugging.
    Cheers, APC

  • Fine Grained Access ERROR on INSERT when generating unique keys

    I'm using VPD/Fine Grained Access Control (FGAC) to implement security on my 9i backend. I created a security policy function that returns the predicate 'owner = USER'; - each of the tables has an additional column titled OWNER which contains the name of the logged-in user. Every time a user inserts a record, a BEFORE INSERT trigger fires (for every row) and inserts the USER name into the OWNER column. This is fairly straightforward and ensures that users can see only their rows. Using the DBMS_RLS.add_policy procedure, I attached the security policy to several tables and made it effective upon SELECT, UPDATE, INSERT, and DELETE statements.
    However, the frontend Java application (custom-made) generates unique IDs (sequences are not used) by selecting max(ID)+1 from the primary key columns of the tables. The problem is that the predicate is appended to the SELECT max(ID)+1 query to limit the max(ID) to only those rows where 'owner = USER'. Therefore, the max(ID) generated is not the largest ID for the entire table, but only the largest among the USER rows.
    So unless that USER happens to have the the largest ID in the whole table (and it has worked then), a primary-key violation error will be returned and the INSERT operation will be aborted.
    How can I allow every USER to select from AND get the absolute largest ID from the PK column without allowing that user to select records that don't belong to him? If I had developed the application, I would have made use of sequences on the back-end to generate unique primary key IDs. Unfortunately, I don't have this option and must work with the application as is.
    NOTE: the front-end Java application understands only the base table names, NOT Views created by me on the server. If the answer to this problem involves views, how can I make use of them on the backend when the front-end code does not recognize them?
    Any help is greatly appreciated!
    Michael

    first you could use default column values, not a trigger, which is more expensive.
    if your apps already assumes full access to table to get max id ( another RT ), this is bad. Current RLS can not really help if you can not change the apps because of this flaw logic ( you can store the maxid anywhere, why scanning the whole table to find it )

  • Eliminating ###'s after hex reconversion to char string

    This is interesting.
    I was originally required to pass a segment to my subroutine. I had to do so using text literals. The   symbol is not recognizable by text literals. Therefore, I had to convert the entire string to hex.
    I then passed the hex segment to the subroutine, and reconverted it back to char string.
    After this I found a ton of unexpected # symbols in my segment. I tried doing a
    REPLACE '###' WITH '' INTO CHARSTRING.
    , but unsuccessfully. There is not much documentation on hex_to_char conversion, there are 2 FMs on 46, but I cannot get them to work. If anyone knows how to eliminate these unexpected # symbols please let me know.

    DATA: HEXSTRINGER(6000) TYPE 'X'.
    DATA: STRINGER(3000) TYPE 'C'.
    FIELD-SYMBOLS: <FSHEX>, <RECONVERT2>.
    CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
                   EXPORTING
                         ARCHIVE_HANDLE       = READ_HANDLE
                   IMPORTING
                         RECORD               = ARC_BUFFER-SEGMENT
                         RECORD_STRUCTURE     = ARC_BUFFER-RNAME
               MOVE ARC_BUFFER-SEGMENT TO SEGSTER.
               assign SEGSTER to <fsHEX> type 'X'.
               MOVE <fsHEX> to HEXSTRINGER.
    APPEND 'REPORT ZSUBR.' TO CODE.
    APPEND 'FORM DYN1 USING HEXSTRINGER.' TO CODE.
    APPEND 'DATA: SEGSTER2(3000) TYPE ''C''.' TO CODE.
    APPEND 'ASSIGN HEXSTRINGER TO <RECONVERT2> TYPE ''C'' .' TO CODE.
    APPEND 'MOVE <RECONVERT2> TO SEGSTER2.' TO CODE.
    APPEND 'WRITE:/ SEGSTER2.' TO CODE.
    APPEND 'ENDFORM.' TO CODE.
    I write out Segster2 and compare it to segster.
    I've done some variations of this where after I change the char string to hex string I replace 'C' with '7C' into hexstringer and then re-replace it in the subroutine, and then reconvert it to a char string- but actually I don't think that was a necessary step. I believe I can just convert it to hex, and then reconvert it back to hex in the subroutine.

  • Need to generate Unique User IDs in OIM

    Hi,
    I am working in OIM 9.1 environment right now. I need to generate unique User IDs for all the users who come via self request. My problem is that while creating the user ids, I can search for the existing users in OIM and AD easily, but i am unable to search the users for whom the request has been made but approval is pending. Such user ids are reserved in OIM so if an employee with the same first and last name comes, there might be a conflict which might lead to an error. Can someone suggest any api or query using which I can search for these IDs under request in OIM.

    If i use the userid generator as Pre-Insert, there will be a conflict if two similar named users request at the same time (or if one of the request is yet to be approved).
    I am getting the below error while creating user id as Pre-Insert. What is the correct way of getting this done? Please suggest.
    012-11-20 19:25:41,787 INFO [STDOUT] Running CREATEUSERINOIM
    2012-11-20 19:25:41,788 INFO [STDOUT] Target Class = com.pldt.adapter.createuser.CreateUserInOIM
    2012-11-20 19:25:41,788 INFO [STDOUT] ***********************Inside Create User****************************
    2012-11-20 19:25:41,805 INFO [STDOUT] =====================Before Date Insert===============
    2012-11-20 19:25:41,805 INFO [STDOUT] =====================hiredate===============1970-01-01
    2012-11-20 19:25:41,805 INFO [STDOUT] ***************************section***************XTNL Active
    2012-11-20 19:25:42,647 INFO [STDOUT] Running DISABLEUSERINOIM
    2012-11-20 19:25:42,649 INFO [STDOUT] Target Class = com.pldt.adapter.disableuser.DisableUserInOIM
    2012-11-20 19:25:42,649 INFO [STDOUT] Entered Method retrieveUtility in SelectApprovalUser class
    2012-11-20 19:25:42,662 INFO [STDOUT] *************************************Inside disableOIMUser**********************
    2012-11-20 19:25:42,662 INFO [STDOUT] *************************************2**************
    2012-11-20 19:25:42,663 INFO [STDOUT] ******************tcUserIntf**********Thor.API.Operations.tcUserOperationsClient@5fd3131f
    2012-11-20 19:25:42,663 INFO [STDOUT] *************usrkey**********713
    2012-11-20 19:25:42,664 INFO [STDOUT] *************usrkey**********XTNL Active
    2012-11-20 19:25:42,664 INFO [STDOUT] ********************employeeGroup check Value*************XTNL Active
    2012-11-20 19:25:42,664 INFO [STDOUT] returning False
    2012-11-20 19:25:42,797 INFO [STDOUT] ***********************User Created Succesfully****************************
    2012-11-20 19:25:42,848 INFO [STDOUT] **************************Employee Group**********XTNL Active
    2012-11-20 19:25:44,199 INFO [STDOUT] Running CREATEUSERINOIM
    2012-11-20 19:25:44,200 INFO [STDOUT] Target Class = com.pldt.adapter.createuser.CreateUserInOIM
    2012-11-20 19:25:44,200 INFO [STDOUT] ***********************Inside Create User****************************
    2012-11-20 19:25:44,212 INFO [STDOUT] =====================Before Date Insert===============
    2012-11-20 19:25:44,213 INFO [STDOUT] =====================hiredate===============1970-01-01
    2012-11-20 19:25:44,213 INFO [STDOUT] ***************************section***************XTNL Active
    2012-11-20 19:25:44,255 ERROR [XELLERATE.SERVER] Class/Method: tcUSR/verifyUserLogin Error :User Loginid is duplicate.
    2012-11-20 19:25:44,258 ERROR [XELLERATE.SERVER] Class/Method: tcUSR/eventPreInsert Error :User login is not correct.

  • One Char String - performance

    Hi-ya all
    Two questions, both performance related.
    1. What would be the fastest way to produce a one char string, is there anything faster than new String(char + "").
    2. What would be the fastest way to get an uppercase from a char, is there anything better than a switch and or set of if/elses, for example some sort of fiddle factor?
    thanks

    Character.toString(char)
    Character.toUpperCase(char)

  • Bit char string...need help

    Hi I am trying to convert a bit char string to something useful.  Basically I have an activex tool that allows me acess to a serial port based scale.
    I send a weight request command and it sends me this gibberish:
    °®°° ìb ÇR
    Thank I try to do a tostring() and get this:
    \u00b0\u00ae\u00b0\u00b0, on line 1, column 21, is not a valid identifer name.
    Hmm.. anyone have to deal with bitchar strings coming from serioal ports or know what i am dealing with here?
    Thanks
    Frank

    Basically you need to access the string as a byte array - I think
    there's a method getBytes() that you can apply to a string.
    Mack

  • How to replace mixed chars string

    Hi All,
    I want to replace mixed chars string from each row and want to replace with new string.
    Ex : The existing string might be in different cases like "Abc string", "abc string", "aBC string". I want to search for all these string types and want to replace with new string "Abc string".
    Could anyone give suggestions on this.
    Thanks,
    Prakash

    [url http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/functions149.htm#i1305521]REGEXP_REPLACE supports case insensitive replacing.
    REGEXP_REPLACE(source_string,'abc string','Abc string',1,0,'i')The *'i'* specifies case insensitive replacing, so it will find all of "Abc string", "abc string", "aBC string" :-)

  • Char. strings w/o text elements will not be translated:

    Hi ,
    I have a few constants in my program.
    But when i declare them as
    text(12) type c value ' hello world',
    In the code inspector i encounter "Char. strings w/o text elements will not be translated:" error.
    Can somebody h

    Hi,
    Text elements are required for Translating purpose. You have declared a free string but haven't declared the corresponding text element for that string. Thus the error. Please double click on the string and create the text element to get rid of the error in code inspector. This is not a mandatory thing but should be done.
    Hope it helps.
    Regards,
    R

  • Generate Unique Schema Types

    Hello!
    In the "Consume Adapter Service" dialog box, on the bottom left corner of the form, there is a check box that says "Generate Unique Schema Types".  I cannot not find anything in the documentation that indicates what this does, what it is used for, or when to use it and when not to use it.  In the screen shots of the help files this check box does not appear, so I am guessing that this is a new feature and the documentation just hasn't been updated.
    Can someone please explain what this check box does and when and when not to use it?
    Thanks.

    Hi!
    Scenario why this was required:
    (a) you create a new BTS project
    (b) you generate metadata for an operation O1, containing a parameter which is of a complex type CT1.
    (c) you close the add adapter service wizard
    (d) you re-open the add adapter service wizard, and generate metadata for an operation O2, which contains a parameter, also of complex type CT1
    (e) you close the add adapter service wizard.
    Now, what you will see is that the complex type CT1 has been defined twice (in different XSD files). This can lead to compilation errors.
    Hence, this setting "Generate unique schema types".
    At step (b) above, after the metadata has been generated, but before the XSD files are created, complex type CT1 is renamed to something like CT1_GUID1. At step (d) above, complex type CT1 is renamed to something like CT1_GUID2. Since the names are not conflicting anymore, there are no compilation errors.
    Recommendation - if you want to generate schemas for multiple operations, you should generate them at the same time (so that there is just one definition for complex type CT1 (no renaming)).
    Mustansir

Maybe you are looking for