3 Replies Latest reply on Mar 23, 2007 10:07 AM by insuractive

    WSDL enumerations

    mufi2 Level 1
      I'm trying to use CFMX7's native webservice support (i.e. Axis 1.2.1/WSDL2Java) to pass an enumerated value to a web method whose signature includes an argument of simpleType whose domain of values is restricted. (On the webservice side, this translates into a C#.NET Enum.)

      Here's a mock-up of the WSDL schema:

      <s:element name="saveEnumTest">
      <s:element minOccurs="1" maxOccurs="1" name="saveType" type="tns:MyEnum" />

      <s:simpleType name="MyEnum">
      <s:restriction base="s:string">
      <s:enumeration value="Element 1" />
      <s:enumeration value="Element 2" />

      I can't seem to come up with a CFML input that will work. (Usually, some form of struct does the trick.)

      Any suggestions?

        • 1. WSDL enumerations
          insuractive Level 3
          I knew I've seen a similar issue with someone else having a hard time consuming enumerated value types on this forum, but it took me FOREVER to find it with the Adobe forum search interface. ug.

          Anyway, I think the answer to your problem can be found in this thread in the house of fusion forums:

          • 2. Re: WSDL enumerations
            mufi2 Level 1
            Thanks, for the response, but my question really is: What if the application doesn't know the domain of enumerated values (e.g. 'USD' and 'GBP')? How can it possibly pass in a valid enumeration option?

            I think I've come up with a work-around (which basically involves side-stepping CF's native webservice support), but it's messy.

            I think my problem would be solved if CF's version of Axis/WSDL2Java* were to add a method to the class (i.e. the one representing the particular WSDL enumeration) which returns a list or array of enumeration values (e.g. 'AFA, ALL, DZD...'), so that I could use that to select the desired enumeration object and then pass it along to the web method.


            * This might be the problem:
            http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200604.mbox/%3C4736124.1145204669658. JavaMail.jira@brutus%3E
            • 3. WSDL enumerations
              insuractive Level 3
              UPDATE - nevermind my last post, I just went back and reread the original post.

              Assuming you are collecting the data on your end before passing it to the webservice, wouldn't you have to perform data mapping from your data to the enumeration values anyway? In that case, why would it matter that your application can't see the enumerated values (which, by the way, you CAN do with a combination of CFHTTP and XMLParse())?