A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Web Services
Author
JAX-RPC and Calendar question
Ong Vua
Ranch Hand
Joined: Jan 24, 2008
Posts: 57
posted
Sep 21, 2011 21:39:08
0
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: 299
posted
Sep 27, 2011 21:45:44
0
Not sure if I understand your issue correctly, but I did 1 quick
test
as below:
I used AXIS 1.4
Provider/Server side
public class JAXRPCDocumentLiteralProvider { public Calendar getCalendar(Calendar in ) { System.out.format("", in.toString()); return in; } }
Consumer/Client side
From the wsdl from the server, I generated client code and tested as below and see Soap request
Calendar in = Calendar.getInstance(); in.set(2009, 10,9 , 17, 10, 10); // See Soap Request output Calendar out = port.getCalendar(in);
SOAP Request: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getCalendar xmlns="http://jaxrpc.provider.test"> <in xsi:type="xsd:dateTime">2009-11-10T01:10:10.281Z</in> </getCalendar> </soapenv:Body> </soapenv:Envelope>
I agree. Here's the link:
http://aspose.com/file-tools
subject: JAX-RPC and Calendar question
Similar Threads
JAXB ObjectFactory to create an empty xml tag example
Error passing in a date object
JBoss WS client exception
How come there's no exceptions when use JAX-WS?
Extending java.util.Calendar()
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter