Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservices and the Timestamp class

 
Hernan Thiers
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings.
Currently I'm working on a SOA system where the persistence is based on ORM and all dates (datetime) are recognized as java.sql.Timestamp objects. The issue comes up when I try to build web services under the JAX-RPC 1.1 specifications that doesn't allow this class.
My question is what would be the best solution: to try a different attribute type from my Entity Relationship Model and so in the ORM class diagram or to develop web services with a newer specification??

Thanks in advance! Hope that I can explain myself in English well
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
There are two approaches I would consider:
1. Use JAX-WS instead of JAX-RPC.
JAXB, which is the API responsible for marshalling and unmarshalling of XML data with JAX-WS, allows for custom mappings.
If possible, I would immediately replace JAX-RPC with JAX-WS even though I opted for the option below. There are many other benefits with JAX-WS.
2. Use some kind of intermediary beans.
Web service invocations result in intermediary beans. When data is to be persisted, a persistent entity is populated with data from one or more intermediary beans.
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic