Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

datatype mappings in Axis to java

Thread view: 
kalpesh.mahadik@wipro.com - 28 Aug 2006 16:14 GMT
I want to know about the mappings of datatypes from XSD datatypes to
java datatypes.

Suppose I am calling a web service method using axis and if that
method's return type is xsd:gYear or something that is not supported in
java, what  call.invoke() method of axis will return me back?will it
return axis's custom class (org.apache.axis.types.Year) object?

if yes, then in case of xsd:short, which has corresponding datatype
java.lang.Short, what will axis return?

pls provide links to related documents, If possible.

Thanks in advance
Kalpesh
vahan - 29 Aug 2006 10:40 GMT
You  need to register your  Type Mapping before e.c.:
        Class cls = null;
        Service service = new Service();
        Call  call = (Call) service.createCall();
        QName qName;
        //for java bean
        Class beansf = BeanSerializerFactory.class;;
       Class  beandf = BeanDeserializerFactory.class;
       //for simple type
         Class simplesf = SimpleSerializerFactory.class;
         Class  simpledf = SimpleDeserializerFactory.class;
         // for java bean
          qName = new javax.xml.namespace.QName(
                   "http://www.w3.org/2001/XMLSchema",
                   "anyType");
           call.registerTypeMapping(cls, qName, beansf, beandf);

       //for simple type , you can register int type as java String or
something other
java simple  type

          qName = new javax.xml.namespace.QName(
                   "http://www.w3.org/2001/XMLSchema",
                   "int");
           call.registerTypeMapping(String.class, qName, simplesf,
                                    simpledf);

        //after that you need to poit your expected return type before
call.invoke
       call.setReturnType(new javax.xml.namespace.QName("someURL  ",
               "MyReturnType"));
        // and ivoke  call
        MyReturnType ret = (MyReturnType) call.invoke(new Object[]
{instanceMySendObject });
You can define you return type yourself
Best Vahan

> I want to know about the mappings of datatypes from XSD datatypes to
> java datatypes.
[quoted text clipped - 11 lines]
> Thanks in advance
> Kalpesh


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.