Using groovy ws with enum types?

Posted by Jared on Stack Overflow See other posts from Stack Overflow or by Jared
Published on 2010-03-12T17:43:54Z Indexed on 2010/03/12 17:47 UTC
Read the original article Hit count: 177

Filed under:
|
|

I'm trying to use groovy ws to call a webservice. One of the properties of the generated class is it's self a class with an enum type. Although the debug messages show that the com.test.FinalActionType is created at runtime when the WSDL is read I can't create an instance of it using code like

proxy.create("com.test.FinalActionType")

When I try and assign a string to my class uin place of an instance of FinalActionType groovy is not able to do the conversion. How can I get an instance of this class to use in a webservice call? I've pasted the important part of the WSDL below.

        <xsd:simpleType name="FinalActionType">
            <xsd:restriction base="xsd:string">
                <xsd:enumeration value="stop"/>
                <xsd:enumeration value="quit"/>
                <xsd:enumeration value="continue"/>
                <xsd:whiteSpace value="collapse"/>
            </xsd:restriction>
        </xsd:simpleType>

© Stack Overflow or respective owner

Related posts about groovy

Related posts about webservice