axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Souther <bsout...@fwdco.com>
Subject Re: Serializing / Deserializing
Date Fri, 15 Nov 2002 17:53:33 GMT
Are you calling:  call.registerTypeMapping(args...) anywhere in your code?
Is the class file for you javabean available to your client?














On Friday 15 November 2002 12:46 pm, Russell Brown wrote:
> Cheers ben,
>
> That is pretty much line for line what I have, except that the service
> provider is java:EJB and maybe that is where my problem is. It migt be the
> marshalling at the EJB end that is returning the wrong type. I just don't
> know enough about this to debug it. I have got the Axis source code and am
> reading through the stack trace trying to figure out why this works in the
> client
>
> TypeMapping tm = call.getTypeMapping();
> DeserializerFactory dsf =
> (org.apache.axis.encoding.DeserializerFactory)tm.getDeserializer(qn);
> if(dsf != null) {
>  FSDeserializer fsd =
> (com.freeserve.fsmap.encoding.FSDeserializer)dsf.getDeserializerAs(Constant
>s.AXIS_SAX); }
>
> but not in the RPCHandler class ( where the error is being thrown )
>
> if (dser == null) {
> //hack this to get our deserializer:
> //*****************************************************
>
> TypeMapping tmfs = context.getTypeMapping();
> DeserializerFactory dsf =
> (org.apache.axis.encoding.DeserializerFactory)tmfs.getDeserializer(qname);
> if(dsf != null) {
> 	dser =
> (org.apache.axis.encoding.Deserializer)dsf.getDeserializerAs(Constants.AXIS
>_SAX); } else {
> 	System.out.println("Still couldn't find it!!!");
> throw new SAXException(Messages.getMessage("noDeser01", localName,"" +
> type)); }
>
> //*****************************************************
>  //end hack
> }
>
>
> So, thanks for your help, I'll post to the list if I can find out what is
> going wrong with my code .
>
> Regards
>
> Russell
>
> -----Original Message-----
> From: Ben Souther [mailto:bsouther@fwdco.com]
> Sent: 15 November 2002 17:39
> To: axis-user@xml.apache.org
> Subject: Re: Serializing / Deserializing
>
>
>
> This is up and working with Axis 1.0. on tomcat 4.1.12.
> I'm sorry if it's sloppy.
> Good luck.
>
>
>
>
> From the WSDD:
>
>  <service name="PayrollSummaryService" provider="java:RPC">
>      <parameter name="className"          
> value="com.someone.somwhere.service.PayrollSummaryService"/> <parameter
> name="allowedMethods" value="*" />
>
>      <beanMapping qname="ns1:PayrollSummaryDataBean"
>                   xmlns:ns1="com.someone.somewhere.payrollsummary.shared"
>                  
> languageSpecificType="java:com.someone.somewhere.payrollsummary.shared.Payr
>ollSummaryDataBean" />
>
>      <beanMapping qname="ns1:EmployeeListDataBean"
>                   xmlns:ns1="com.someone.somewhere.payrollsummary.shared"
>                  
> languageSpecificType="java:com.someone.somewhere.payrollsummary.shared.Empl
>oyeeListDataBean" /> </service>
>
>
>
>
> From the client:
>
>
>                   try{
>     112             Service service = new Service();
>     113             Call    call    = (Call)service.createCall();
>     114             call.setTargetEndpointAddress(
>     115                 new URL(_payrollSummaryServiceURL));
>     116
>     117             QName qName = new QName(
>     118                 "PayrollSummaryService",
>     119                 "getPayrollSummaryData"
>     120             );
>     121             call.setOperationName(qName);
>     122
>     123             //
>     124             // The QName for mapping the PayrollSummaryDataBean
>     125             // to the return value from the web service.
>     126             //
>     127             QName returnQName = new QName(
>     128                 "com.someone.somewhere.payrollsummary.shared",
>     129                 "PayrollSummaryDataBean"
>     130             );
>     131
>     132             call.registerTypeMapping(
>     133                 PayrollSummaryDataBean.class,
>     134                 returnQName,
>     135                 new BeanSerializerFactory(
>     136                     PayrollSummaryDataBean.class,
>     137                     returnQName
>     138                 ),
>     139                 new BeanDeserializerFactory(
>     140                     PayrollSummaryDataBean.class,
>     141                     returnQName
>     142                 )
>     143             );
>     144
>     145             call.setReturnType(
>     146                 returnQName,
>     147                 PayrollSummaryDataBean.class
>     148             );
>     149
>     150             System.out.println("period: " + _period);
>     151
>     152             _dataBean = (PayrollSummaryDataBean)call.invoke(
>     153                 new Object[]{
>     154                         _clientID,
>     155                         _employeeID,
>     156                         _period,
>     157                         _year
>     158                 }
>     159             );
>     160         }catch(Exception e){
>     161             System.out.println(
>     162                 "Error in PayrollSummaryBean: "
>     163                 + e
>     164             );
>     165         }
>     16
>
> On Friday 15 November 2002 11:42 am, Russell Brown wrote:
> > Hi,
> >
> > Has anyone on this list managed to serialize AND deserialize a bean with
> > Axis's bean serializer or there own custom serializer / deserializer ever
> > ?
> >
> > Just to know that it has been done once will fill me with a renewed hope.
> > If you can tell me how you side stepped the ubiquitous error (Error :
> > org.xml.sax.SAXException: Deserializing parameter 'arg1':  could not find
> > deserializer for type ANYTYPEWHATSOEVEREXCEPTPRIMATIVES) as well I may
> > very well weep with joy.
> >
> > Many thanks
> >
> > Russell
> >
> > PS check this out:
> >
> >  call.registerTypeMapping(ArgumentSet.class, qn,
> > FSSerializerFactory.class, FSDeserializerFactory.class, t);
> >
> >  TypeMapping tm = call.getTypeMapping();
> >  boolean isit = tm.isRegistered(ArgumentSet.class, qn);
> >
> >  System.out.println("Well isit ? : "+isit);
> >
> > DeserializerFactory dsf =
> > (org.apache.axis.encoding.DeserializerFactory)tm.getDeserializer(qn);
> >
> > if(dsf != null) {
> > 	FSDeserializer fsd =
> > (com.freeserve.fsmap.encoding.FSDeserializer)dsf.getDeserializerAs(Consta
> >nt s.AXIS_SAX); }
> >
> > all works, yes I can find the f***** deserializer but AxisEngine cannot:
> > anyone, anyone ??
> >
> > RB


Mime
View raw message