This content has been marked as final. Show 5 replies
String dateString = "2011-09-08T00:00:00-0700-07:00";This seems incorrect, maybe a typo after all?
For the parsing of date or datetime, you seem to using a deprecated method. In any case use javax.xml.bind.DatatypeConverter class to do the task, and then the TimeZone set to your desired one if you want to display it. In any case, pass the cal obtained from this?
String dateString = "2011-09-08T00:00:00-07:00";
Also note that xs:date is actually constructed with an option of appending an extension of TimeZone data to iso8601, it is not exactly iso8601 to the letter.
Calendar cal = javax.xml.bind.DatatypeConverter.parseDateTime(dateString);
Actually I have a Date object and instead of parsing it, how can I call a Web Service method that accepts a Calendar type?
The date format of the WS I tried to call is in the form 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)?
represents noon on 10th October 2002, Central Daylight Savings Time, which is equivalent to Eastern
Standard Time in the US.
As a further example:
represents noon on 9th October 2009, UCT, which is equivalent to the GMT time zone.
First, you've to make up your mind in fixing what the question is otherwise every time it will end up "actually I have this rather than that... and need this rather than that...".
Actually I have a Date object and instead of parsing it, how can I call a Web Service method that accepts a Calendar type?So you have a Date object. The service accepts a Calendar type? What kind of service would that be?
For Web services v2.0, the data in SOAP requests conforms to XSD data formats.So that is a string of xs:date (date, not data?). Why would that be a Calendar type?
If you start with a Date object and want to pass a string of xs:date format, you do this, as I'd practically suggested all the ingredients already.
//dt being your date object Calendar cal=Calendar.getInstance(); cal.setTime(dt); String s=javax.xml.bind.DatatypeConverter.printDate(cal); //you pass s to the soap message.
It's Oracle CRM On Demand web service
So you have a Date object. The service accepts a Calendar type? What kind of service would that be?
I have a field in CRM On Demand of type Date. After I generated the Web Service Proxy from the WSDL, the setter method for that field is of type java.util.Calendar
So that is a string of xs:date (date, not data?). Why would that be a Calendar type?
I have a Date object in my application and I want to pass it to this Date field in CRM On Demand.