aspose file tools*
The moose likes Web Services and the fly likes typeMapping  examples Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "typeMapping  examples" Watch "typeMapping  examples" New topic
Author

typeMapping examples

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Where can I find typeMapping examples for Apache Axis? I want to know how to write them.

Also, could someone please explain me different types of handlers -Transport, global etc.

Thanks


Groovy
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Axis website is the best place for this kind of questions..

A sample typeMapping would look like..
<typeMapping xmlns:ns="http://soapinterop.org/xsd"
qname="ns:ArrayOfString"
type="java:java.lang.String[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
..Yes i got it from WSDD reference,

also using java2wsdl will help you develop sample wsdd's...


Spritle Software Blogs
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks. Balaji, I wanted to know how to write the (de)serializer classes.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Pradeep Bhat:
Thanks. Balaji, I wanted to know how to write the (de)serializer classes.


Do you want to how to write generic classes like org.apache.axis.encoding.ser.BeanSerializerFactory or the client side serializers and deserializers.. ??

For the client side..the best idea could be to let WSDL2Java to generate the stub classes first and then modify the serializers according to your needs.
If you want to know or do from scratch.....digging axis source is the best start.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

No Suppose I have a class Customer which is not a java bean, how do I generate the XML type for the same. I think I will have put the typeMapping tag in the wsdd file and also write the class for marshaling and unmarshalling purpose, right?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Pradeep Bhat:
I think I will have put the typeMapping tag in the wsdd file and also write the class for marshaling and unmarshalling purpose, right?

No..
You dont need to write them.
Either with typemapping or beanmapping tag you just need to specify the "type" or "languageSpecificType" attribute values, the rest will be taken care by Axis..
A working example is available in Axis under samples/userguide/example5
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

A working example is available in Axis under samples/userguide/example5


The example is for BeanMapping. Is there one for typeMapping?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Pradeep Bhat:

The example is for BeanMapping. Is there one for typeMapping?

See my post above.
The style is more or less same like beanmapping just try to play with it
Jeff Zamora
Greenhorn

Joined: Jan 25, 2006
Posts: 1
Hi

If there is a class, for example HashMap, and is passed on as a parameter in SOAP, multiRefs are generated for the XML document. in getting the data from the XML request to a HashMap class, what do i do? I assume to use deserializers but I've no idea how to use them.

Thanks,
Jeff
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Jeff,
Welcome to Javaranch.

Please open a new thread for new questions to get quick replies.

Have a look at this specific example listed in Apache Axis. Its shows how to use deserializer and serializer for the exchanging the class Order via SOAP.
 
 
subject: typeMapping examples