• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with Coldfusion generated wsdl file

New Here ,
Jan 14, 2011 Jan 14, 2011

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

869

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 18, 2011 Jan 18, 2011

Copy link to clipboard

Copied

In thiscase you may need to add it manually. To do this you could use

the cfcomponent tag's wsdlfile attribute. Basically, copy the

dynamically generated WSDL, add the minOccurs as needed, then point

the wsdlfile attribute of the component to the saved, static WSDL.

--Nathan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2011 Jan 18, 2011

Copy link to clipboard

Copied

Ok, thanks for your reply!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2011 May 31, 2011

Copy link to clipboard

Copied

LATEST

WARNING: if Coldfusion 8, and have OnRequest() in application.cfc, this will not work --it is a  known cf8 bug.  For a workaround, see
http://www.coldfusionjedi.com/index.cfm/2008/3/19/Ask-a-Jedi-Ajaxbound-requests-and-onRequest

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation