Weihong, here an example:
request = (SalaryDeclarationRequestType) AxisUtil.deserializeFromInputStream(i, new QName("http://www.abc.com/sd/20040701/SDC","SDeclarationRequestType"), SDeclarationRequestType.class); It seems that in your case the QName element is missing the classname thus the deserializer can't find any appropriate class. Yves On Wed, 2004-07-21 at 01:43, wei zhu wrote: > Thanks Yves and Aoife. > I made code compiled, but when I run it, I got exception "No > deserializer for {http://www.opengis.net/xls}". My code is attached > here. Do you have any suggestion about this issue? > > thanks a lot > Weihong > > > Yves Langisch <[EMAIL PROTECTED]> wrote: > Wei, > > this was my own class but you are right that there is also an > AxisUtil > class in the axis.jar. The two classes are independent, so > just give it > another name. > > Yves > > On Tue, 2004-07-20 at 09:21, [EMAIL PROTECTED] > wrote: > > Hi Wei, > > > > There is an AxisUtil class in wss4j jar. However that didn't > appear > > to contain the methods named so I just copied the required > methods in > > to my own class. > > > > Aoife > > > > > > > > > > wei zhu > > > > > > 19/07/2004 23:41 > > Please respond to > > axis-user > > > > To: > > [EMAIL PROTECTED] > > cc: > > Subject: > > Re: Deseralize XML > > > > > > Yves, > > I couldn't find java class AxisUtil. Do you know which jar > AxisUtil is > > in? > > ; > > thanks a lot > > Wei > > > > > > > > /////////////////////////////////////////////////////////////////////////////////////// > > Tom, Noel, Aoife, > > > > Try this with 1.2beta: > > > > /** > > * Deserializes an InputStream (i.e. a XML file) to the > appropriate > > Java Class > > * generated by Axis. > > * > > * @param is is the InputStream for deserializing (without > SOAP > > elements) > > * @param qname is the qualified name of the namespace of the > XML > > Type > > of clazz > > * @param clazz is the Java Type representation of the XML > stream is > > * @return Object which has to be casted to the specified > Java Class > > (clazz) > > * @throws Exception > > * @throws AxisFault > > */ > > public static Object deserializeFromInputStream(InputStream > is, QName > > qname, Class clazz) throws Exception, AxisFault { > > > > // Wrap the InputStream up into a SOAP Bo dy and Envelope > since the > > parser > > // expects a SOAP Envelope > > SOAPEnvelope env1 = new SOAPEnvelope(); > > env1.addBodyElement(new SOAPBodyElement(is)); > > > > return AxisUtil.deserializeFromSOAPReader(new > BufferedReader(new > > StringReader(env1.toString())), > > qname, > > clazz); > > } > > > > /** > > * Deserializes a SOAP Reader (i.e. a XML file) to the > appropriate > > Java Class > > * generated by Axis. > > * > > * @param reader is the Reader for deserializing (a SOAP > envelope) > > * @param qname is the qualified name of the namespace of the > XML > > Type > > of clazz > > * @param clazz is the Java Type representation of the XML > stream is > > * @return Object which has to be casted to the specified > Java Class > > (clazz) > > * @throws Exception > > * @throws AxisFault > > */ > > public static Object deserializeFromSOAPReader(Reader > reader, QName > > qname , Class clazz) throws Exception, AxisFault { > > > > MessageContext msgContext = new MessageContext(new > AxisServer()); > > > > DeserializationContext dser = new > DeserializationContextImpl( > > new InputSource(reader), msgContext, > > org.apache.axis.Message.REQUEST); > > > > // parse the InputSource > > dser.parse(); > > > > SOAPEnvelope env = dser.getEnvelope(); > > RPCElement rpcElem = (RPCElement)env.getFirstBody(); > > Object result = rpcElem.getValueAsType(qname, clazz); > > return result; > > } > > > > Regards, > > Yves > > > > On Thu, 2004-07-15 at 11:58, [EMAIL PROTECTED] > wrote: > > > Hi, > > > This is exactly what I need also. Has anybody found a > solution for > > > this? > > > Thanks, > > > Aoife > > > > > > >Hi, > > > >I've been looking to do the same thing. If I can find out > how to > > call > > > the a xis > > > >serialize / deserialize routines by hand, I can do away > with using > > > castor - > > > >which to be honest is a bit of a pain to integrate with > axis. > > > > > > > >So, please, anyone got an answer for this? > > > >ta > > > >Noel > > > > > > > > > On Thursday 06 November 2003 08:54, tom ONeill wrote: > > > > Hi all, > > > > > > > > Some existing mails seem to touch on this subject but Im > still not > > > clear on > > > > the issue so here goes. > > > > I have used wsdl2java to create my stubs and also a > number of > > > complex types > > > > defined within the wsdl file. > > > > > > > > Before I invoke my web service I am receiving an XML > stream, the > > > structure > > > > of which I want to map directly to a data class that I > am passing > > as > > > a > &g t; > > parameter to the web service operation call. What I > am wondering > > is > > > if Axis > > > > has some method of allowing me to marshall this XML into > the > > > corresponding > > > > data class/Bean. I cannot seem to find a method within > the > > > Deserializer API > > > > that would allow me to do this. > > > > > > > > All help appreciated, > > > > > > > > Tom > > > > > > > > > > > ______________________________________________________________________ > > Do you Yahoo!? > > Vote for the stars of Yahoo!'s next ad campaign! > > > > ______________________________________________________________________ > Do you Yahoo!? > Yahoo! Mail is new and improved - Check it out!