java service

i want to write a java service for the following conditions
to compare 2 dates to check wheather they are greater or less

Hi Sunil,

You can get many versions of code for your requirement on internet, jus google.
download wMSample package from advantage site, and see how java services are written using developer.

Let me know if you have any specific question.

Puneet Saxena

entered Date should not be greater than today date

for this hw to write java service in webmethods

Use a flow logic, if you are not equipped with java…

look at the com.util.Date java api. and it has all inbuilt methods that you can use.

I would code some thing like this…

assume today and myDate are objects of type Date…

boolean isafter = today.after(myDate);
boolean isbefore = myDate.after(today);
if (isafter)
idc.insertAfter(“result”, “1”); //Yesterday or lower
else if (isbefore)
idc.insertAfter(“result”, “-1”); //Tomarrow or higher
idc.insertAfter(“result”, “0”); // Today

Hope this helps…