cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: share data types between services
Date Mon, 24 Jan 2011 12:28:21 GMT
You may think about add some annotation on your common data module 
classes and you can generate a schema for this common data module with 
the help of JAXB.
I'm not sure why your services WSDL data modules are not share with each 
other, maybe you should think about use WSDL first developer module to 
create the service in this way.


Just my 2 cents.

Willem
On 1/21/11 2:39 AM, Siva krishna wrote:
> Hello Everybody,
>
> I am new to this forum as well as to the Webservice world. I have a problem
> with code first webservice implementation with CXF. Please bear with me if
> the solution is so obvious.
>
> We already have a  client server application - both client and server in
> java and server is backed by spring framework and we use spring HttpInvoker
>   remoting approach to communicate between client and server.
>
> We now need to support a .NET client. So we chose web-service approach and
> enabled the interfaces as webservices using CXF framework and JAXB
> databinding as a default option.
>
> The problem is, we have several services and each share a bunch datamodel
> classes. but once we enable each service as a seperate webservice all the
> datamodel classes endup as a seperate type when imported the WSDL file in
> .NET Visual studio IDE. How can we share the data model objects between
> webservices. just to give an example
>
> Service 1:
> --------------
> @Webservice
> public class Service1 {
>
> A getA();
>
> }
>
> Service 2:
> -------------
> @Webservice
> public class Service2 {
>
> String getDetails(A a);
>
> }
>
>
> class A {
> int a;
> float x;
> }
>
> A is datamodel class that is shared between to services. However when WSDL
> are references in .NET they end up as to different types and service2 could
> not take the object A that is received from Service1.
>
> Please throw some light on what am I missing. How can I put all the
> datamodel classes into same namespace so that the generated WSDL files also
> referes them as same data types. Let me know if I am not clear.
>
> Thank you all in advance.
>
> /Kalyan
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Mime
View raw message