0 Replies Latest reply on Nov 3, 2009 12:53 PM by janchj

    Document-Literal and Arrays - WSDL seems incorrect ??

    janchj

      I have create a simple "document-literal" webservice that returns an object containing some simple fields and an array of another object.

       

      Task.cfc

      ===============================

      <cfcomponent>
         <cfproperty name="Id"        type="string">
         <cfproperty name="Priority"  type="numeric">
         <cfproperty name="StartTime" type="date">
         <cfproperty name="StopTime"  type="date">
         <cfproperty name="AOI"       type="VertexPoint[]">
      </cfcomponent>  

       

      VertexPoint.cfc

      ============================

      <cfcomponent>
         <cfproperty name="Latitude"  type="numeric">
         <cfproperty name="Longitude" type="numeric">
         <cfproperty name="Altitude"  type="numeric">
      </cfcomponent>

       

      My webservice returns a Task object

       

      <cfcomponent  style="document">
         <cffunction name="getTask" returnType="Task" access="remote" output="false"> 

            ....

         </cffunction>
      </cfcomponent>

       

      When I look at the generated WSDL is see the following complexTypes:

      NOTICE THE name="item" IN THE COMPLEXTYPE ArrayOf_xsd_anyType.

       

      <complexType name="VertexPoint">
         <sequence>
            <element name="Altitude" nillable="true" type="xsd:double"/>
            <element name="Latitude" nillable="true" type="xsd:double"/>
            <element name="Longitude" nillable="true" type="xsd:double"/>
         </sequence>
      </complexType>

       

      <complexType name="Task">
         <sequence>
            <element name="AOI" nillable="true" type="tns1:ArrayOf_xsd_anyType"/>
            <element name="Id" nillable="true" type="xsd:string"/>
            <element name="Priority" nillable="true" type="xsd:double"/>
            <element name="StartTime" nillable="true" type="xsd:dateTime"/>
            <element name="StopTime" nillable="true" type="xsd:dateTime"/>
         </sequence>
      </complexType>

       

      <complexType name="ArrayOf_xsd_anyType">
         <sequence>
            <element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:VertexPoint"/>
         </sequence>
      </complexType>

       

      When I look at the XML/data returned when I call the webservice it is:

       

        <getTaskResponse xmlns="http://users">
         <getTaskReturn>
          <AOI>
           <AOI xsi:type="ns1:VertexPoint" xmlns:ns1="http://users">
            <Altitude>1.0</Altitude>
            <Latitude>1.0</Latitude>
            <Longitude>1.0</Longitude>
           </AOI>
           <AOI xsi:type="ns2:VertexPoint" xmlns:ns2="http://users">
            <Altitude>2.0</Altitude>
            <Latitude>2.0</Latitude>
            <Longitude>2.0</Longitude>
           </AOI>
          </AOI>
          <Id>1</Id>
          <Priority>99.0</Priority>
          <StartTime>2009-10-15T06:00:00.000Z</StartTime>
          <StopTime>2009-10-17T05:59:59.000Z</StopTime>
         </getTaskReturn>
        </getTaskResponse>

       

      Shouldn't the tags be

      <AOI>

           <item>

           </item>

           <item>

           </item>

      <AOI>

       

      I am trying to access this WS from a java client and the AOI is always null

       

      Any help would be greatly appreciated.  (BTW - If I use "rpc" WS everything work fine)