To understand why the dates are getting off you'd need to look at the 
actual XML being marshalled or unmarshalled. The format you give is that 
used for the schema xs:dateTime type, which allows (but does not 
require) a UTC offset. If the XML representation doesn't include UTC 
offsets it could well explain why the time values you're seeing are 
different from what you expect.

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Glenn2041 wrote:
> Thanks for that Dennis,
>
> I've since rewrote the binding from scratch. I think it may have had 
> something to do with the way I was handling the namespaces.
>
> Without the date format declared, 24 hour time is mishandled. All 
> dates increase by 12 hours. The date format I'm currently using is 
> "yyyy-MM-dd'T'HH:mm:ss".
>
>
> Here's the binding file for reference.
>
> <binding xsi:noNamespaceSchemaLocation="binding.xsd" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>
>     <namespace 
> uri="https://localhost:9444/businesspartners/timeofuse-consumption/ws/nominations-service.wsdl";
>  
> default="elements" />
>
>     <format type="java.util.Date" 
> deserializer="nz.co.company.util.SerializationUtils.deserializeDate"
>                                 
> serializer="nz.co.company.util.SerializationUtils.serializeDate" />
>
>     <mapping name="SubmitTimeOfUseConsumptionNominationsRequest" 
> class="nz.co.company.timeofuseconsumption.domain.SubmitTimeOfUseConsumptionNominationsRequest">
>         <value style="attribute" name="source" field="source" />
>         <value style="attribute" name="messageId" field="messageId" 
> usage="optional" />
>         <value style="attribute" name="requestDate" field="requestDate" />
>         <value style="attribute" name="consumptionType" 
> field="consumptionType" />
>         <structure name="nominations">
>             <collection field="nominations" 
> create-type="java.util.ArrayList">
>                 <structure name="nomination" 
> type="nz.co.company.timeofuseconsumption.domain.TimeOfUseConsumptionNomination">
>                     <value style="attribute" name="dateTimeStamp" 
> field="dateTimeStamp" />
>                     <value style="attribute" name="consumption" 
> field="consumption" />
>                 </structure>
>             </collection>
>         </structure>
>     </mapping>
>
>     <mapping name="SubmitTimeOfUseConsumptionNominationsResponse" 
> class="nz.co.company.timeofuseconsumption.domain.SubmitTimeOfUseConsumptionNominationsResponse">
>         <value style="attribute" name="messageId" field="messageId" 
> usage="optional" />
>         <value style="attribute" name="processedDate" 
> field="processedDate" />
>         <value style="attribute" name="responseCode" 
> field="responseCode" />
>         <value style="element" name="responseMessage" 
> field="responseMessage" usage="optional" />
>     </mapping>
>
> </binding>
>
>
> Thanks
> Glenn Gilbert
>
>
> Dennis Sosnoski wrote:
>> Hi Glenn,
>>
>> I don't know why load="true" on the Ant task would cause a problem. Do 
>> you have any more information about what went wrong?
>>
>> Re the dateTime attributes, JiBX by default handles the conversions to 
>> and from java.util.Date with some assumptions, which may or may not be 
>> correct for your application. See 
>> http://jibx.sourceforge.net/binding/conversions.html for the details of 
>> this and other conversions. I'm finally getting out a 1.2.2 release this 
>> week which includes support for the Joda date/time classes, so you'll 
>> have other options as soon as that's available.
>>
>>   - Dennis
>>
>> Dennis M. Sosnoski
>> XML and Web Services in Java
>> Training and Consulting
>> http://www.sosnoski.com - http://www.sosnoski.co.nz
>> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>>
>>
>>
>> Glenn2041 wrote:
>>   
>>> Found it.
>>> The Ant task org.jibx.binding.ant.CompileTask had load="true". It came 
>>> in when copying an example. Removing it solved my problem.
>>> Thanks anyway
>>>
>>> ------------------------------------------------------------------------------
>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
>>> trial. Simplify your report design, integration and deployment - and focus 
>>> on 
>>> what you do best, core application coding. Discover what's new with 
>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>> _______________________________________________
>>> jibx-users mailing list
>>> jibx-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>>
>>>   
>>>     
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay 
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> jibx-users mailing list
>> jibx-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>   
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to