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 bu...@apache.org on 2003/11/26 13:14:01 UTC

DO NOT REPLY [Bug 25012] New: - dateTime not parsed properly in the SOAP message

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25012>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25012

dateTime not parsed properly in the SOAP message

           Summary: dateTime not parsed properly in the SOAP message
           Product: Axis
           Version: 1.1
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: zpatel@baan.com


The WSDL file contains :
**************************
<xs:complexType name="ChangeRequestAdjustment">
	<xs:sequence>
		<xs:element minOccurs="0" name="orderDate" 
type="bo:orderDateDT"/>
	</xs:sequence>
</xs:complexType>

<xs:simpleType name="orderDateDT">
	<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
**************************

The java proxies are generated properly without any errors using the 
command "java org.apache.axis.wsdl.WSDL2Java".
Then on top of the generated proxies I make a Java client to run the webService.

I try to set the orderDate by the following code:
**************************
	Calendar cal = Calendar.getInstance();
	cal.set(2003, 10, 20, 13, 56, 00);
	adjustment.setOrderDate(new OrderDateDT (cal));
**************************

But in the SOAP Message the date goes as shown below:
**************************

<orderDate>java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllF
ieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id=&quot;GMT+05:30&qu
ot;,offset=19800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],
firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=10,WEEK_OF_YEAR=
48,WEEK_OF_MONTH=5,DAY_OF_MONTH=20,DAY_OF_YEAR=330,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_
MONTH=4,AM_PM=1,HOUR=5,HOUR_OF_DAY=13,MINUTE=56,SECOND=0,MILLISECOND=813,ZONE_OF
FSET=19800000,DST_OFFSET=0]</orderDate> 

***************************


I tried to change the wsdl by doing the folowing :
**************************
	<xs:element minOccurs="0" name="orderDate" type="xs:dateTime"/>
**************************

Then regenerated the proxies.So in the client the code changed as follows:
**************************
	Calendar cal = Calendar.getInstance();
	cal.set(2003, 10, 20, 13, 56, 00);
	adjustment.setOrderDate(cal);
**************************

In this case the date was passed properly and there was no error. The problem 
here is we need to go with the first defination  of "orderDate" with the 
restriction since the wsdl is auto generated and uses a template .