3 Replies Latest reply on Mar 5, 2009 11:46 AM by gordoh

    Publish ColdFusion Web Service with Complex Return Type

    toniu27
      Hi,

      I am working on a project to publish couple ColdFusion webservices. The cosumer of those webservices is a Java application.

      One of my webservice need return an object. Here are demo codes:

      The returned ojbect is AddressRespond

      AddressRespond.cfc:
      <cfcomponent>
      <cfproperty name="addresses" type="Address[]" />
      <cfproperty name="myLearnException" type="MyException" />
      </cfcomponent>

      Address.cfc:
      <cfcomponent>
      <cfproperty name="city" type="string" />
      <cfproperty name="state" type="string" />
      </cfcomponent>

      MyException.cfc:
      <cfcomponent>
      <cfproperty name="code" type="string" />
      <cfproperty name="reason" type="string" />
      </cfcomponent>

      If the webservice "cosumer" is a ColdFusion application, there is no any problems. But the Java application doesn't understand the type of addresses in the WSDL file which is gernerated by ColdFusion:

      <complexType name="Address">
      <sequence>
      <element name="city" nillable="true" type="xsd:string"/>
      <element name="state" nillable="true" type="xsd:string"/>
      </sequence>
      </complexType>
      <complexType name="MyException">
      <sequence>
      <element name="code" nillable="true" type="xsd:string"/>
      <element name="reason" nillable="true" type="xsd:string"/>
      </sequence>
      </complexType>
      <complexType name="AddressRespond">
      <sequence>
      <element name="addresses" nillable="true" type="tns1:ArrayOf_xsd_anyType"/>
      <element name="MyException" nillable="true" type="impl:MyException"/>
      </sequence>
      </complexType>

      Could anybody give me any idea on how to resolve this problem?

      Thanks!