Web service creation: wscompile changes my Date data types
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ben_Alexander
Posted On:   Thursday, September 9, 2004 08:11 AM

I'm writing a web service, and a client that uses the service. The service creates, and the client consumes, a class called SMessage. Within SMessage there exists the following data access routines that I wrote: public java.util.Date getCreationDate() { return CreationDate; } public void setCreationDate(java.util.Date newCreationDate) { this.CreationDate = newCreationDate; } So good so far, but when I create the web service, it generates some classes for the client to use, and among them are the routines for manipulating CreationDate. The relevent data access routines, however, now look like this: public java.util.Calendar getCreationDate() { return cre   More>>

I'm writing a web service, and a client that uses the service. The service creates, and the client consumes, a class called SMessage. Within SMessage there exists the following data access routines that I wrote:

			
public java.util.Date getCreationDate() {
return CreationDate;
}
public void setCreationDate(java.util.Date newCreationDate) {
this.CreationDate = newCreationDate;
}


So good so far, but when I create the web service, it generates some classes for the client to use, and among them are the routines for manipulating CreationDate. The relevent data access routines, however, now look like this:

			
public java.util.Calendar getCreationDate() {
return creationDate;
}

public void setCreationDate(java.util.Calendar creationDate) {
this.creationDate = creationDate;
}


Why did it change data types for me? All the other data types were preserved by wscompile unchanged. Does anybody have an explanation for this?
Thanks in advance, Ben    <<Less

Re: Web service creation: wscompile changes my Date data types

Posted By:   Balakris_Subramaniam  
Posted On:   Monday, September 27, 2004 09:54 AM


Since JDK 1.1 most of the Date functionality was replaced by the Calendar object.
Moreover the current Date object in JDK ver 1.4.* has an immutable constructor
which only sets the current time internally by default.
Set/Get operations are deprecated.

But all time related operations are available though the Calendar object.
In your example, you can get the Date object back using:

Date date = [SMessage].getCreationDate().getTime();

Re: Web service creation: wscompile changes my Date data types

Posted By:   Balakris_Subramaniam  
Posted On:   Monday, September 27, 2004 09:53 AM


Since JDK 1.1 most of the Date functionality was replaced by the Calendar object.
Moreover the current Date object in JDK ver 1.4.* has an immutable constructor
which only sets the current time internally by default.
Set/Get operations are deprecated.

But all time related operations are available though the Calendar object.
In your example, you can get the Date object back using:

Date date = .getCreationDate().getTime();

Re: Web service creation: wscompile changes my Date data types

Posted By:   Balakris_Subramaniam  
Posted On:   Monday, September 27, 2004 09:52 AM


Since JDK 1.1 most of the Date functionality was replaced by the Calendar object.
Moreover the current Date object in JDK ver 1.4.* has an immutable constructor
which only sets the current time internally by default.
Set/Get operations are deprecated.

But all time related operations are available though the Calendar object.
In your example, you can get the Date object back using:

Date date = .getCreationDate().getTime();
About | Sitemap | Contact