beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryoush Mehrtash <>
Subject Re: wsdl/schema generation and custom type mapping
Date Sun, 07 Aug 2005 18:03:17 GMT

Beehive supports three different types in a Web Service.

   1. POJO 
   2. XMLBean types 
   3. Axis types

If you use a POJO as your type, beehive would introspect the class and 
create its type mappings. It makes your life easier since the introspection 
walks up the class hierarchy and is smart enough to recognise other Axis or 
XMLBean types along the way. In this case if you use a same type in two 
different web services (with different default namespace) you would get 
different schema. Which is not what you want.

The other two alternative (Axis types, and XMLBeans) on the other hand 
expect the types to do their own serializations. In both of these cases you 
would be able to get your desired effect, i.e. to reuse the type and still 
get the same schema. 

XMLBean types are always generated from schema. They would be an ideal case 
if you want to start the web service development by defining the schema of 
the types. You would write your schema and use XMLBean tools to generate the 
types and then use the types in your web services. You can also take this 
one step further by using an XML editor to first write the complete WSDL 
(types, messages, port, binding..) then use beehive to generate your types 
and the annotated web service class. (see samples/wsm-addressbook-fromWSDL).

Your other Alternative is to use Axis types. You would need this if you are 
using RPC style, or if you want to have fine grain control over the 
serialization process. You can either write them by hand or use Axis tools 
to generate the types. This is documented here:

Note that you would only need the data types that are generated. To write 
them by hand you would need to implement the three public static methods 
(getTypeDesc, getSerailizer, and getDeserailizer) for each type. I attached 
an example for StateType class that was generated by Axis tools, it should 
give you an idea what you would need to implement. You can drop this class 
in any JWS, and you should see the type being serialized to 
http://byXmlBeanNS (just a name i used when i created the type) namespace. 
Axis also has tools to generate the Helper classes that do serialization 
(see Axis documentation for more on this).

To summarize.... If you are doing RPC style, then use the Axis types (either 
generated or by hand). If you are using Document style then use XMLBeans if 
you know the schema of the types, or use Axis types if you want to start 
from Java and write your own serialization.

Hope this helps.


On 8/7/05, Martin Grotzke <> wrote:
> hello,
> what would you think of an additional annotation for the
> webservice class like @TypeMapping that provides properties
> like the wsdd-typemapping?
> i know that this has nothing to do with jsr181 but with axis,
> but this would be a way to achive more flexibility (concerning
> things that normally would be done via wsdd)...
> would this be possible from a technical point of view, and would
> you integrate things like this into beehive?
> or what would be the way for customization?
> cheers,
> martin
> On Sun, 2005-08-07 at 14:17 +0200, Martin Grotzke wrote:
> > hello,
> >
> > i'm using beehive for writing some webservices, and like it very
> > much!
> >
> > now i want to have a custom type mapping for one class that is used
> > by more that one webservice in common, but i do not know how to do
> > this.
> >
> > what i have is the following:
> >
> >
> > (this is a class that provides information about the webservice
> > consumer, this is expected by all webservices)
> >
> >
> > (associates WSConsumerInfo)
> >
> >
> > (associates WSConsumerInfo)
> >
> > both webservices define their own targetNamespace, e.g.
> > "" and "".
> >
> > when the wsdl for a service is generated, the serializer creates
> > only the namespace for the service, and the WSConsumerInfo is
> > created in the same namespace. so, each webservice gets it's own
> > WSConsumerInfo, what is not desired, because the client's shall
> > get the WSConsumerInfo as a shared concept, too.
> > i'd like to have the WSConsumerInfo generated in a common namespace
> > "".
> >
> > is there any way to achieve this with beehive?
> >
> > thanx for your help,
> > cheers,
> > martin
> >
> >
> --
> Martin Grotzke
> Hohenesch 38, 22765 Hamburg
> Tel. +49 (0) 40.39905668
> Mobil +49 (0) 170.9365656
> E-Mail
> Online
> Version: GnuPG v1.4.1 (GNU/Linux)
> iD8DBQBC9jSS7FvOl7Te+pYRAuBCAJwPkUSm+dw1h7k++srrivAfxwIEPACgncgv
> oVPdxZeypr4wH5Ndf2Yg4FA=
> =xYUK

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