Issue using SWIG enums

Hello there,

We managed to build the latest Fesapi (Jan 2 2019) and now we are trying to use the SWIG Java API. As a test we tried to make a Java-version of the example program. Then it is tempting to convert the C++

	WITSML1_4_1_1_NS::Well* witsmlWell = pck->createWell("", "Well1", "00:00");
	witsmlWell->setEastingNorthingLocation(gsoap_witsml1_4_1_1::witsml1__LengthUom__m, 275, 75, witsmlCrs);


    val witsmlWell = epc.createWell("", "Well1", "00:00")
    witsmlWell.setEastingNorthingLocation(witsml1__LengthUom.witsml1__LengthUom__m, 275.0, 75.0, witsmlCrs.get)

However, in C++:

gsoap_witsml1_4_1_1::witsml1__LengthUom__m = 'm'; // (ASCII 109)

and in Java:

witsml1__LengthUom.witsml1__LengthUom__m = 0

That does not work.

Similar issues are with the Java enums witsml1__WellVerticalCoordinateUom, witsml1__PlaneAngleUom and witsml1__MeasuredDepthUom.


Hi Danny,

This clearly looks as a bug. Thanks for reporting it.
The reason is that the enum generation from xsd to C++ does not guarantee a same ordering of the enumerated values (at least from a gsoap version to another gsoap version).
It is not automatized in our building process and, because we are given up witsml (to move towards witsml2.0), we have forgotten to update this piece of code.

I’ll make a commit soon.
If you are in hurry, please replace line 44 of with the same enum found in (line 427). You need to rerun cmake and to rebuild the C++ library.

Fixed in which is going to be merged in master in few hours.

Thanks man, that was quick.