I am invoking a webservice whic has field EndTime defined as DateTime data type in the xsd. But When I created the webservice connector, the document that got created for the request has EndTime as a string.
ns1:createComparisonProductMovement
When I parse the datetime into string and invoke the webservice with that, the webservice treats it in a strange manner and does not store the right date.
Is there a problem with the webservice or the way I am invoking it?
What date format are you using? XML dateTimes are in the format yyyy-MM-ddThh:mm:ss.SSSZ. The “T” is a literal capital letter “T”. The Z can either be a literal “Z” if UTC timezone is desired or can be an timezone offset from UTC in hours and minutes. Refer to the XML schema data types documentation for more details.
Hi Mark,
With the help of this post i formed correct datetime format…Now i want to change this datetime format to UTC format…How to solve this…Can you please help me onthis issuse.
Hi Raemon,
Thanks for ur reply…I am trying to develope service…say for example client send his own format like yyyy-MM-dd’T’HH:mm:ss ex:2012-10-08T11:47:33(JST)…now i want to convert this time to UTC format by using webMethods built in services…can you please help me on this issuse.
Hi Reamon,
By using your post in some other thread i created one java service.
1)It is taking the string as date object and giving dateobject as string.
2)By using this service I am able to convert My Jvm time format to any other format(UTC or IST…etc)…
But i am looking for if client sends his own format(whatever it may be) but we should convert that into UTC time format. can you please help regarding this.
Create a service with these parameters:
IN dateString - the string to be converted
IN pattern - the pattern of the string in dateString
OUT date - a java.util.Date object representing the value passed in dateString
Logic: use SimpleDateFormat to parse the string and return the Date object
Call pub.date:formatDate.
IN date - pass the date object from the previous call
IN pattern - specify the pattern string for the desire format. Based on what you’ve previously posted, this would be yyyy-MM-dd’T’hh:mm:ss.SSSZ
IN timezone - omit this input; the default timezone is GMT
IN locale - probably want to omit this unless you want to use another language
OUT value - a string in the W3C format for the GMT/UT timezone
You could combine these into a FLOW service if you want a single service to do both steps.
For each partner, you’d call the service passing the format pattern that matches the string they are sending you.
You need to create some custom logic to get GMT/UTC timezone from local…pl check the PSUtilities package there are some datetime utilities provided to play with.
Also here is the sample java program that does converts to GMT time zone and similarly create a java service in wM
Hi Raemon,
Thanks for ur reply…it helped alot to me…
i want to explain in a more clear way about what i need and what this service gave to me…
As you told i developed a service…and it is working fine…
in our flow there are two types flows 1)outbound 2)inbound
1)outbound:- inthis flow we will send our date time to clients format[convert our jvm format(UTC) to Client needs(EST )…For this flow it working fine.
2)Inbound :- in this flow we want to convert Client sended format(EST) to our format (UTC).For this flow above created service is not working…
ex: client sends 2012-17-10 12:00:00 EST timezone(yyyy-dd-MM HH:mm:ss)…
Input:I mapped time string and format to java service which i had as input…
Output: it gave the date object as 2012-17-10 12:00:00 UTC.(but i am expecting 2012-17-10 7:00:00(EST means UTC+5))…it is frustating …Please can you clarify this.
In the formatDate service did you gave the input timezone as GMT? and so it should output as GMT timezone (note you are in the US Eastern Day light savings mode UTC+4)…you can check here to make sure wM is outputing correctly or not for GMT/UTC