cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siva krishna <guru.sreeni...@gmail.com>
Subject sharing data types between webservices
Date Thu, 20 Jan 2011 13:42:03 GMT
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
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message