You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Dave Cherkassky (JIRA)" <ji...@apache.org> on 2012/09/20 02:05:08 UTC

[jira] [Created] (AXIS2-5425) arrays that should be empty are returned with a single blank element

Dave Cherkassky created AXIS2-5425:
--------------------------------------

             Summary: arrays that should be empty are returned with a single blank element
                 Key: AXIS2-5425
                 URL: https://issues.apache.org/jira/browse/AXIS2-5425
             Project: Axis2
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.6.2
         Environment: Windows 7
            Reporter: Dave Cherkassky


I am summarizing below, please let me know if you need more information, complete details or full generated classes.

Relevant XSD:
  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
      targetNamespace="http://isis.tacl.on.ca/attendancemgmt/2012/08/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:isis="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
    ...

    <xs:complexType name="PartDayPlacementScheduleDetailListType">
      <xs:sequence>
        <xs:element name="items" minOccurs="0" maxOccurs="unbounded" type="isis:PartDayPlacementScheduleDetailType"/>
      </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PartDayPlacementScheduleType">
      <xs:all>
        <xs:element name="activityOccurrenceLocationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="timeslotCode" minOccurs="1" maxOccurs="1" type="xs:string" />
      </xs:all>
      <xs:attribute name="plannedPartDayAttendanceId" type="xs:integer"/>
    </xs:complexType>
    <xs:complexType name="PlacementType">
      <xs:all>
        <xs:element name="locationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="activityOccurrenceId" minOccurs="1" maxOccurs="1" type="xs:integer"/>
        <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="endDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="partDayPlacementScheduleList" minOccurs="0" maxOccurs="1" type="isis:PartDayPlacementScheduleListType" />
      </xs:all>
      <xs:attribute ref="isis:activityOccurrenceLocationId" use="required"/>
    </xs:complexType>
    <xs:element name="placement" type="isis:PlacementType" />
    ...
  </xs:schema>

I used AXIS2 code generation to create ADB classes and service skeletons.  Here's the command-line:
C:\jdk1.6.0_24\jre\bin\java.exe
  -Dlog4j.ignoreTCL=true
  -Dlog4j.configuration=file:///C:/code/cltoronto/isis/dev/etc/lib/logging/log4j.properties
  -classpath ...
  org.apache.axis2.wsdl.WSDL2Java
  -uri file:///C:/code/cltoronto/isis/dev/ISISWeb/JavaSource/resources/attendancemgmt-module.wsdl
  -o ../tmp/axis2/wsdl2java
  -p ca.on.tacl.isis.attendancemgmt.axis2._201208.service'
  -ns2p http://isis.tacl.on.ca/attendancemgmt/2012/08/=ca.on.tacl.isis.attendancemgmt.axis2._201208.entity
  -s
  -ss
  -sd
  -g
  -Euwc
  -Emp ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.mapper'
  --service-name activityOccurrenceTypeService
  -or
  --noBuildXML

And I wrote code like this:

/**
 * PlacementServiceSkeleton.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.6.2  Built on : Apr 17, 2012 (05:33:49 IST)
 */
    package ca.on.tacl.isis.attendancemgmt.axis2._201208.service;

    // ...

    /**
     *  PlacementServiceSkeleton java skeleton for the axisService
     */
    public class PlacementServiceSkeleton{
                 public ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.ClientPlacements getByClient
                  (
                  ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.PlacementGetByClientCriteria placementGetByClientCriteria
                  )
            throws FaultsException{

                // implementing the getByClient operation
                // ...
                PartDayPlacementScheduleType[] partDay =
                    placement.getPlacement().getPartDayPlacementScheduleList().getItems();
                // ...
            }

    // ...

    }

Incoming SOAP message:
  <?xml version='1.0' encoding='utf-8'?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
      <ns1:placement xmlns:ns1="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
        <ns1:endDate>2012-09-30-04:00</ns1:endDate>
        <ns1:locationId>130</ns1:locationId>
        <ns1:partDayPlacementScheduleList>
          <ns1:items />
        </ns1:partDayPlacementScheduleList>
        <ns1:startDate>2012-09-01-04:00</ns1:startDate>
        <ns1:activityOccurrenceId>16769</ns1:activityOccurrenceId>
      </ns1:placement>
    </soapenv:Body>
  </soapenv:Envelope>

Expected:
  partDay.length == 0

Actual:
  partDay.length == 1
  partDay[0] has all attributes == null



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Updated] (AXIS2-5425) arrays that should be empty are returned with a single blank element

Posted by "Dave Cherkassky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Cherkassky updated AXIS2-5425:
-----------------------------------

    Description: 
I am summarizing below, please let me know if you need more information, complete details or full generated classes.

Relevant XSD:
  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
      targetNamespace="http://isis.tacl.on.ca/attendancemgmt/2012/08/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:isis="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
    ...

    <xs:complexType name="PartDayPlacementScheduleDetailListType">
      <xs:sequence>
        <xs:element name="items" minOccurs="0" maxOccurs="unbounded" type="isis:PartDayPlacementScheduleDetailType"/>
      </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PartDayPlacementScheduleType">
      <xs:all>
        <xs:element name="activityOccurrenceLocationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="timeslotCode" minOccurs="1" maxOccurs="1" type="xs:string" />
      </xs:all>
      <xs:attribute name="plannedPartDayAttendanceId" type="xs:integer"/>
    </xs:complexType>
    <xs:complexType name="PlacementType">
      <xs:all>
        <xs:element name="locationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="activityOccurrenceId" minOccurs="1" maxOccurs="1" type="xs:integer"/>
        <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="endDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="partDayPlacementScheduleList" minOccurs="0" maxOccurs="1" type="isis:PartDayPlacementScheduleListType" />
      </xs:all>
      <xs:attribute ref="isis:activityOccurrenceLocationId" use="required"/>
    </xs:complexType>
    <xs:element name="placement" type="isis:PlacementType" />
    ...
  </xs:schema>

I used AXIS2 code generation to create ADB classes and service skeletons.  Here's the command-line:
C:\jdk1.6.0_24\jre\bin\java.exe
  -Dlog4j.ignoreTCL=true
  -Dlog4j.configuration=file:///C:/code/cltoronto/isis/dev/etc/lib/logging/log4j.properties
  -classpath ...
  org.apache.axis2.wsdl.WSDL2Java
  -uri file:///C:/code/cltoronto/isis/dev/ISISWeb/JavaSource/resources/attendancemgmt-module.wsdl
  -o ../tmp/axis2/wsdl2java
  -p ca.on.tacl.isis.attendancemgmt.axis2._201208.service'
  -ns2p http://isis.tacl.on.ca/attendancemgmt/2012/08/=ca.on.tacl.isis.attendancemgmt.axis2._201208.entity
  -s
  -ss
  -sd
  -g
  -Euwc
  -Emp ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.mapper'
  --service-name activityOccurrenceTypeService
  -or
  --noBuildXML

And I wrote code like this:

/**
 * PlacementServiceSkeleton.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.6.2  Built on : Apr 17, 2012 (05:33:49 IST)
 */
    package ca.on.tacl.isis.attendancemgmt.axis2._201208.service;

    /**
     *  PlacementServiceSkeleton java skeleton for the axisService
     */
    public class PlacementServiceSkeleton{
        // ...

        /**
         * Auto generated method signature
         * <![CDATA[
				Adds or edits a placement
			]]>
                                     * @param placement 
             * @return itemCount0 
             * @throws FaultsException 
         */
                 public ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.ItemCount putPlacement
                  (
                  ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.Placement placement
                  )
            throws FaultsException{
                // implementing the putPlacement operation
                // ...
                PartDayPlacementScheduleType[] partDay =
                    placement.getPlacement().getPartDayPlacementScheduleList().getItems();
                // ...
            }

        // ...

    }

Incoming SOAP message:
  <?xml version='1.0' encoding='utf-8'?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
      <ns1:placement xmlns:ns1="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
        <ns1:endDate>2012-09-30-04:00</ns1:endDate>
        <ns1:locationId>130</ns1:locationId>
        <ns1:partDayPlacementScheduleList>
          <ns1:items />
        </ns1:partDayPlacementScheduleList>
        <ns1:startDate>2012-09-01-04:00</ns1:startDate>
        <ns1:activityOccurrenceId>16769</ns1:activityOccurrenceId>
      </ns1:placement>
    </soapenv:Body>
  </soapenv:Envelope>

Expected:
  partDay.length == 0

Actual:
  partDay.length == 1
  partDay[0] has all attributes == null



  was:
I am summarizing below, please let me know if you need more information, complete details or full generated classes.

Relevant XSD:
  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
      targetNamespace="http://isis.tacl.on.ca/attendancemgmt/2012/08/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:isis="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
    ...

    <xs:complexType name="PartDayPlacementScheduleDetailListType">
      <xs:sequence>
        <xs:element name="items" minOccurs="0" maxOccurs="unbounded" type="isis:PartDayPlacementScheduleDetailType"/>
      </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PartDayPlacementScheduleType">
      <xs:all>
        <xs:element name="activityOccurrenceLocationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="timeslotCode" minOccurs="1" maxOccurs="1" type="xs:string" />
      </xs:all>
      <xs:attribute name="plannedPartDayAttendanceId" type="xs:integer"/>
    </xs:complexType>
    <xs:complexType name="PlacementType">
      <xs:all>
        <xs:element name="locationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
        <xs:element name="activityOccurrenceId" minOccurs="1" maxOccurs="1" type="xs:integer"/>
        <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="endDate" minOccurs="0" maxOccurs="1" type="xs:date" />
        <xs:element name="partDayPlacementScheduleList" minOccurs="0" maxOccurs="1" type="isis:PartDayPlacementScheduleListType" />
      </xs:all>
      <xs:attribute ref="isis:activityOccurrenceLocationId" use="required"/>
    </xs:complexType>
    <xs:element name="placement" type="isis:PlacementType" />
    ...
  </xs:schema>

I used AXIS2 code generation to create ADB classes and service skeletons.  Here's the command-line:
C:\jdk1.6.0_24\jre\bin\java.exe
  -Dlog4j.ignoreTCL=true
  -Dlog4j.configuration=file:///C:/code/cltoronto/isis/dev/etc/lib/logging/log4j.properties
  -classpath ...
  org.apache.axis2.wsdl.WSDL2Java
  -uri file:///C:/code/cltoronto/isis/dev/ISISWeb/JavaSource/resources/attendancemgmt-module.wsdl
  -o ../tmp/axis2/wsdl2java
  -p ca.on.tacl.isis.attendancemgmt.axis2._201208.service'
  -ns2p http://isis.tacl.on.ca/attendancemgmt/2012/08/=ca.on.tacl.isis.attendancemgmt.axis2._201208.entity
  -s
  -ss
  -sd
  -g
  -Euwc
  -Emp ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.mapper'
  --service-name activityOccurrenceTypeService
  -or
  --noBuildXML

And I wrote code like this:

/**
 * PlacementServiceSkeleton.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.6.2  Built on : Apr 17, 2012 (05:33:49 IST)
 */
    package ca.on.tacl.isis.attendancemgmt.axis2._201208.service;

    // ...

    /**
     *  PlacementServiceSkeleton java skeleton for the axisService
     */
    public class PlacementServiceSkeleton{
                 public ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.ClientPlacements getByClient
                  (
                  ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.PlacementGetByClientCriteria placementGetByClientCriteria
                  )
            throws FaultsException{

                // implementing the getByClient operation
                // ...
                PartDayPlacementScheduleType[] partDay =
                    placement.getPlacement().getPartDayPlacementScheduleList().getItems();
                // ...
            }

    // ...

    }

Incoming SOAP message:
  <?xml version='1.0' encoding='utf-8'?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
      <ns1:placement xmlns:ns1="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
        <ns1:endDate>2012-09-30-04:00</ns1:endDate>
        <ns1:locationId>130</ns1:locationId>
        <ns1:partDayPlacementScheduleList>
          <ns1:items />
        </ns1:partDayPlacementScheduleList>
        <ns1:startDate>2012-09-01-04:00</ns1:startDate>
        <ns1:activityOccurrenceId>16769</ns1:activityOccurrenceId>
      </ns1:placement>
    </soapenv:Body>
  </soapenv:Envelope>

Expected:
  partDay.length == 0

Actual:
  partDay.length == 1
  partDay[0] has all attributes == null



    
> arrays that should be empty are returned with a single blank element
> --------------------------------------------------------------------
>
>                 Key: AXIS2-5425
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5425
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.6.2
>         Environment: Windows 7
>            Reporter: Dave Cherkassky
>
> I am summarizing below, please let me know if you need more information, complete details or full generated classes.
> Relevant XSD:
>   <?xml version="1.0" encoding="UTF-8"?>
>   <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
>       targetNamespace="http://isis.tacl.on.ca/attendancemgmt/2012/08/"
>       xmlns:xs="http://www.w3.org/2001/XMLSchema"
>       xmlns:isis="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
>     ...
>     <xs:complexType name="PartDayPlacementScheduleDetailListType">
>       <xs:sequence>
>         <xs:element name="items" minOccurs="0" maxOccurs="unbounded" type="isis:PartDayPlacementScheduleDetailType"/>
>       </xs:sequence>
>     </xs:complexType>
>     <xs:complexType name="PartDayPlacementScheduleType">
>       <xs:all>
>         <xs:element name="activityOccurrenceLocationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
>         <xs:element name="timeslotCode" minOccurs="1" maxOccurs="1" type="xs:string" />
>       </xs:all>
>       <xs:attribute name="plannedPartDayAttendanceId" type="xs:integer"/>
>     </xs:complexType>
>     <xs:complexType name="PlacementType">
>       <xs:all>
>         <xs:element name="locationId" minOccurs="1" maxOccurs="1" type="xs:integer" />
>         <xs:element name="activityOccurrenceId" minOccurs="1" maxOccurs="1" type="xs:integer"/>
>         <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="xs:date" />
>         <xs:element name="endDate" minOccurs="0" maxOccurs="1" type="xs:date" />
>         <xs:element name="partDayPlacementScheduleList" minOccurs="0" maxOccurs="1" type="isis:PartDayPlacementScheduleListType" />
>       </xs:all>
>       <xs:attribute ref="isis:activityOccurrenceLocationId" use="required"/>
>     </xs:complexType>
>     <xs:element name="placement" type="isis:PlacementType" />
>     ...
>   </xs:schema>
> I used AXIS2 code generation to create ADB classes and service skeletons.  Here's the command-line:
> C:\jdk1.6.0_24\jre\bin\java.exe
>   -Dlog4j.ignoreTCL=true
>   -Dlog4j.configuration=file:///C:/code/cltoronto/isis/dev/etc/lib/logging/log4j.properties
>   -classpath ...
>   org.apache.axis2.wsdl.WSDL2Java
>   -uri file:///C:/code/cltoronto/isis/dev/ISISWeb/JavaSource/resources/attendancemgmt-module.wsdl
>   -o ../tmp/axis2/wsdl2java
>   -p ca.on.tacl.isis.attendancemgmt.axis2._201208.service'
>   -ns2p http://isis.tacl.on.ca/attendancemgmt/2012/08/=ca.on.tacl.isis.attendancemgmt.axis2._201208.entity
>   -s
>   -ss
>   -sd
>   -g
>   -Euwc
>   -Emp ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.mapper'
>   --service-name activityOccurrenceTypeService
>   -or
>   --noBuildXML
> And I wrote code like this:
> /**
>  * PlacementServiceSkeleton.java
>  *
>  * This file was auto-generated from WSDL
>  * by the Apache Axis2 version: 1.6.2  Built on : Apr 17, 2012 (05:33:49 IST)
>  */
>     package ca.on.tacl.isis.attendancemgmt.axis2._201208.service;
>     /**
>      *  PlacementServiceSkeleton java skeleton for the axisService
>      */
>     public class PlacementServiceSkeleton{
>         // ...
>         /**
>          * Auto generated method signature
>          * <![CDATA[
> 				Adds or edits a placement
> 			]]>
>                                      * @param placement 
>              * @return itemCount0 
>              * @throws FaultsException 
>          */
>                  public ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.ItemCount putPlacement
>                   (
>                   ca.on.tacl.isis.attendancemgmt.axis2._201208.entity.Placement placement
>                   )
>             throws FaultsException{
>                 // implementing the putPlacement operation
>                 // ...
>                 PartDayPlacementScheduleType[] partDay =
>                     placement.getPlacement().getPartDayPlacementScheduleList().getItems();
>                 // ...
>             }
>         // ...
>     }
> Incoming SOAP message:
>   <?xml version='1.0' encoding='utf-8'?>
>   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>     <soapenv:Body>
>       <ns1:placement xmlns:ns1="http://isis.tacl.on.ca/attendancemgmt/2012/08/">
>         <ns1:endDate>2012-09-30-04:00</ns1:endDate>
>         <ns1:locationId>130</ns1:locationId>
>         <ns1:partDayPlacementScheduleList>
>           <ns1:items />
>         </ns1:partDayPlacementScheduleList>
>         <ns1:startDate>2012-09-01-04:00</ns1:startDate>
>         <ns1:activityOccurrenceId>16769</ns1:activityOccurrenceId>
>       </ns1:placement>
>     </soapenv:Body>
>   </soapenv:Envelope>
> Expected:
>   partDay.length == 0
> Actual:
>   partDay.length == 1
>   partDay[0] has all attributes == null

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org