I'm calling Oracle CRM On Demand by generating a WS proxy of its WSDL file. There's a field of date datatype in CRMOD and in the java class, it accepts a Calendar object. Below is my code
Here's my code
1) I have a Date object
2) I found a piece of code on the internet to get the WS 2.0 ISO8601 DateTime format. This method will format my Date object and return a String as below
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
5) customObject.setDStartDate(cal);
but it kept saying
"The value '11-09-08-07:00' cannot be converted to a date time value.(SBL-DAT-00359)"
It looks like Calendar reverts back to the default date formatting which does not conform to XSD format.
Do you have any idea?
Thanks
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
posted
0
Hi!
How are you calling the web service?
Are you using client artifacts generated by some tool from some web service stack? If so, which tool and which web service stack?
Posting a little code may make the question easier to answer.
Best wishes!
I generate WS Proxy (JAX-RPC) using JDeveloper from a WSDL file and call it from within a Java application.
How do you pass in a Calendar object in the XSD format as below?
For Web services v2.0, the data in SOAP requests conforms to XSD data formats.
The XSD dateTime datatype has the format:
yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?
For example:
2009-10-10T12:00:00-05:00
represents noon on 10th October 2002, Central Daylight Savings Time, which is equivalent to Eastern
Standard Time in the US.
As a further example:
2009-10-09T17:00:00Z
represents noon on 9th October 2009, UCT, which is equivalent to the GMT time zone.
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
posted
0
Hi!
Are you sure that you are to use JAX-RPC?
If not, then I suggest you give JAX-WS a try - there may issues with the implementation in JAX-RPC that prevents proper serialization of dates and/or calendars.
Best wishes!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.