Versioning of Web Services using Interfaces

classic Classic list List threaded Threaded
3 messages Options
jp4
Reply | Threaded
Open this post in threaded view
|

Versioning of Web Services using Interfaces

jp4
We have deployed CXF throughout our organization with a great degree of success.  That being said, we've not done a very good job of versioning any of our services.  We've been stuck on version 1.0.0 of all of our services (making changes to the xsds and wsdls), forcing our clients to rebuild before deploying a new release.  This isn't ideal.

That being said, I'd like to create a pure POJO service layer that my web services delegate to without passing in the JAXB generated Request objects.  Ideally, I would like my JAXB Request objects to implement an interface that my POJO service tier could use.  I was wondering if anyone can point me to some good documentation on how to achieve this.

Thanks,

John
Reply | Threaded
Open this post in threaded view
|

Re: Versioning of Web Services using Interfaces

Daniel Kulp
Administrator
On Friday 25 June 2010 2:17:43 pm johnpfeifer4 wrote:

> We have deployed CXF throughout our organization with a great degree of
> success.  That being said, we've not done a very good job of versioning any
> of our services.  We've been stuck on version 1.0.0 of all of our services
> (making changes to the xsds and wsdls), forcing our clients to rebuild
> before deploying a new release.  This isn't ideal.
>
> That being said, I'd like to create a pure POJO service layer that my web
> services delegate to without passing in the JAXB generated Request objects.
> Ideally, I would like my JAXB Request objects to implement an interface
> that my POJO service tier could use.  I was wondering if anyone can point
> me to some good documentation on how to achieve this.

Using interfaces with JAXB can be quite difficult.   For each interface, you
need to create the concrete implementations (which get output to the WSDL) as
well as type mappers that would bind the two together.   Then various
@XmlSeeAlso's and @XmlJavaTypeAdapter things, etc....  

As a starting point, look at the java_first_jaxws sample in the distro.  It
shows using an interface for an web method.


--
Daniel Kulp
[hidden email]
http://dankulp.com/blog
Reply | Threaded
Open this post in threaded view
|

RE: Versioning of Web Services using Interfaces

Oliver Wulff-3
Maybe the following document gives you some ideas:
http://blogs.iona.com/sos/20070410-WSDL-Versioning-Best-Practise.pdf

IMHO, I'd have an unversioned business logic layer where you have versioned jaxb classes where you semantically adapt the jaxb classes to your business logic layer which is decoupled from the communication technology.

Thanks
Oliver

________________________________________
From: Daniel Kulp [[hidden email]]
Sent: 30 June 2010 19:24
To: [hidden email]
Cc: johnpfeifer4
Subject: Re: Versioning of Web Services using Interfaces

On Friday 25 June 2010 2:17:43 pm johnpfeifer4 wrote:

> We have deployed CXF throughout our organization with a great degree of
> success.  That being said, we've not done a very good job of versioning any
> of our services.  We've been stuck on version 1.0.0 of all of our services
> (making changes to the xsds and wsdls), forcing our clients to rebuild
> before deploying a new release.  This isn't ideal.
>
> That being said, I'd like to create a pure POJO service layer that my web
> services delegate to without passing in the JAXB generated Request objects.
> Ideally, I would like my JAXB Request objects to implement an interface
> that my POJO service tier could use.  I was wondering if anyone can point
> me to some good documentation on how to achieve this.

Using interfaces with JAXB can be quite difficult.   For each interface, you
need to create the concrete implementations (which get output to the WSDL) as
well as type mappers that would bind the two together.   Then various
@XmlSeeAlso's and @XmlJavaTypeAdapter things, etc....

As a starting point, look at the java_first_jaxws sample in the distro.  It
shows using an interface for an web method.


--
Daniel Kulp
[hidden email]
http://dankulp.com/blog