• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

typeMapping examples

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Balaji, I wanted to know how to write the (de)serializer classes.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic