aspose file tools*
The moose likes Web Services and the fly likes JAX-RPC and Calendar question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-RPC and Calendar question" Watch "JAX-RPC and Calendar question" New topic
Author

JAX-RPC and Calendar question

Ong Vua
Ranch Hand

Joined: Jan 24, 2008
Posts: 59
I generated JAX-RPC WS proxy from a WSDL using JDeveloper 11g. In the generated java class, the setter methods for Date fields accept java.util.Calendar as an input parameter. For example

setStartDate(java.util.Calendar)

I know I need to format my Calendar object as below because I'm using WS 2.0

2009-10-09T17:00:00Z

But I kept getting this error message

"The value '09-10-09-17:00' cannot be converted to a date time value"

Has anyone tried this before? If you don't mind sharing your code on how to format the Calendar object to the above format, I really appreciate it.

Thanks





H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
Not sure if I understand your issue correctly, but I did 1 quick test as below:

I used AXIS 1.4

Provider/Server side




Consumer/Client side

From the wsdl from the server, I generated client code and tested as below and see Soap request



Mayur Lanjwar
Greenhorn

Joined: Jun 24, 2013
Posts: 2
thanks dude....it worked!!

--on client
Calendar ebmTimestamp = Calendar.getInstance();
ebmTimestamp.set(2009, 10,9 , 17, 10, 10);

--on xsd/wsdl
<xsd:element name="ebmTimestamp" type="xsd:dateTime"/>

--on soapuri in soap reponse
<util:ebmTimestamp>2009-11-10T01:10:10.281Z</util:ebmTimestamp>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JAX-RPC and Calendar question