Forum Discussion

VivaLaManual's avatar
11 years ago

Schema Name Length from Export Definition

I was wondering if there was any way to control the naming of the schemas when you do an Export Definition. I have a wsdl that has a bunch of operations. When you export it, the schema names become REALLY long. Too long for Visual Studio to handle when adding this wsdl as a service reference.

Example:
Service_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40_41_42_43_44_45_46_47_48_49_50_51_52_53_54_55_56_57_58_59.xsd

Is there anyway to control the names given? Can I just manually rename them and change the wsdl?
  • eam's avatar
    eam
    New Member

    It is a shame to see it's not yet fixed in 2019, even though this is clearly a bug, as the number keeps increasing it could have been used like Service_<n+1> and not like Service_1_..._n_<n+1>

    In my case it is even worse, as we got a wsdl with xsds that total up to 140 something files, and SOAP UI could not write those files to the disk, as windows won't let file names longer than 250 something.

    I found these lines in the code which creates the filenames in com.eviware.soapui.impl.support.definition.export.AbstractDefinitionExporter class:

    for(int cnt = 1; urlToFileMap.containsValue(fileName); cnt++)
    {
        ix = fileName.lastIndexOf('.');
        fileName = (new StringBuilder()).append(fileName.substring(0, ix)).append("_").append(cnt).append(fileName.substring(ix)).toString();
    }

    and changed it to:

    for(int cnt = 1; urlToFileMap.containsValue(fileName); cnt++)
    {
        ix = fileName.lastIndexOf('.');
        int iy = fileName.lastIndexOf("_");
        if (iy == -1) iy = ix;
            fileName = (new StringBuilder()).append(fileName.substring(0, iy)).append("_").append(cnt).append(fileName.substring(ix)).toString();
    }

     After adding this file on the classpath and doing the same export, the result looks better:

    Service.wsdl Service.xsd Service_1.wsdl Service_1.xsd Service_2.wsdl Service_2.xsd Service_3.xsd Service_4.xsd Service_5.xsd ...
    • AntonE's avatar
      AntonE
      SmartBear Alumni (Retired)

      eam Thank you! The fix will be included in 5.7.0.