2 Replies Latest reply on Jun 25, 2009 10:09 AM by joaobmonteiro

    Problem on receiving an object holding datetime

    joaobmonteiro

      Hi guys,

      I have many services that use complex objects holding datetime (java.util.Date) values. The problem is that I always get null for datetime attributes. How can I solve this?
      I'm using JBoss AS 4.2.3-jdk6 and my ws clients are written in Delphi 7.

      My classes:

      public class Document implements Serializable {
      
       private static final long serialVersionUID = 2964445290986713245L;
       private Date date;
       //getters and setters
      }
      


      My ws looks like this:

      @Stateless
      @WebService
      @SOAPBinding(style=Style.RPC)
      public class DateServices {
      
       @WebMethod
       public Date dateNow(){
       return new Date();
       }
       @WebMethod
       public void printDate(@WebParam(name="documento", mode=Mode.IN) Documento documento){
       if(documento.getDate() == null)
       return;
       SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
       String data = dateFormat.format(documento.getDate());
       System.out.println(data);
       }
      }
      


      Regards,




        • 1. Re: Problem on receiving an object holding datetime
          pramod_bs

          One area you might want to look at is if the client is sending the date in the correct format.

          XS:DATETIME FORMAT expects --> 2005-05-27T14:11:00.000
          


          • 2. Re: Problem on receiving an object holding datetime
            joaobmonteiro

            Thanks pramod_bs,

            We've already inspected that. However, we discovered some differences between xml formats when using complex types. The Delphi client generates different patterns when using complex object holding date values and jboss ws is not able to translate that. Maybe later I post the soap envelops for you guys.

            Fortunately, our Delphi Jedi wake up and remake an Soap update code. Now, everything works fine!

            For sure, someone is not following the soap spec...