3 Replies Latest reply on May 31, 2011 5:43 PM by dgleneck@ndi-inc.org

    Problem with Coldfusion generated wsdl file

    kaen123kaen

      Hi all!

       

      We have created a web service with ColdFusion8. One of the functions (GetDeviceAlarms) returns an array of cfobjects.

       

      The result from the function might be an empty result, therefore I need to set minOccurs="0" for the element "GetDeviceAlarmsReturn".
      If this attribute is not set the validation against the schema fails on empty results.

       

      Is there any way to tell ColdFusion to set minOccurs="0" for the element GetDeviceAlarmsReturn?

       

      # Code

       

      <cffunction name="GetDeviceAlarms" access="remote" returntype="alarmstatus_type[]"
                  description="desc"
                  hint="hint">

       

      <cfobject component="alarmstatus_type" name="alarmStruct">

       


      # WSDL

       

      <wsdl:operation name="GetDeviceAlarms">
        <wsdl:input message="impl:GetDeviceAlarmsRequest" name="GetDeviceAlarmsRequest"/>
        <wsdl:output message="impl:GetDeviceAlarmsResponse" name="GetDeviceAlarmsResponse"/>
          <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/>
      </wsdl:operation>

       


      // Generated wsdl
      <element name="GetDeviceAlarmsResponse">
          <complexType>
            <sequence>
              <element maxOccurs="unbounded" name="GetDeviceAlarmsReturn" type="impl:Alarmstatus_type"/>
            </sequence>
          </complexType>
      </element>

       


      // What I would like to accomplish
      <element name="GetDeviceAlarmsResponse">
          <complexType>
            <sequence>
              <element minOccurs="0" maxOccurs="unbounded" name="GetDeviceAlarmsReturn" type="impl:Alarmstatus_type"/>
            </sequence>
          </complexType>
      </element>

       


      // Best Regards Kalle