You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stephen Harper <St...@gtnet.com> on 2005/03/22 18:27:43 UTC

Deserialization Problem

Hello All,

I'm generating code stubs using Axis and I have my own dynamically changing
Wsdl files which define their own complex types.  I get  the following
error:

PM org.apache.axis.client.Call invoke
SEVERE: Exception:
org.xml.sax.SAXException: Deserializing parameter 'account':  could not find
deserializer for type {http://www.w3.org/1999/XMLSchema}Account
	at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
	at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:963)
	at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
	at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
722)
	at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
	at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
	at org.apache.axis.client.Call.invoke(Call.java:2272)
	at org.apache.axis.client.Call.invoke(Call.java:2171)
	at org.apache.axis.client.Call.invoke(Call.java:1691)
	at
SoapTest.SoapTestProcessBindingStub.getAccount(SoapTestProcessBindingStub.ja
va:148)
	at
com.gtnet.soapClient.GT_SOAP_CLIENTImpl.getAccount(GT_SOAP_CLIENTImpl.java:6
6)
	at
com.gtnet.soapClient.GT_SOAP_CLIENTBase._getAccount(GT_SOAP_CLIENTBase.java:
70)
	at
com.gtnet.soapClient.GT_SOAP_CLIENTBase.invoke(GT_SOAP_CLIENTBase.java:38)
	at
com.gtnet.api.so.GtDynamicImplementation.run(GtDynamicImplementation.java:48
)
	at java.lang.Thread.run(Unknown Source)

I have seen similar errors to the one above in the forums.  A suggestion to
fix this is to create a mapping for the custom data type. Then do the
method-calls as normal. Suggestion is:

  ----------------------------------------------------
  Call call = (Call) service.createCall();
              QName collectionqn = new QName(DLM_NS,"collection");
              call.registerTypeMapping(Collection.class, collectionqn, new
                BeanSerializerFactory(Collection.class, collectionqn),
                  new
BeanDeserializerFactory(Collection.class,collectionqn));
  -----------------------------------------------------

However, before I run off building in the above, I was wondering if there is
any way to modify the WSDL to avoid having to deserialize objects?  The
reason I ask is because I am working on an existing project which already
works and is deployed and it does not have the above code.  The Wsdl files
it is currently using contains complex types so I was wondering if there are
options in the SOAP encoding that would prevent the above error from
occurring?

I have attached my Wsdl.

Thanks in advance,

Stephen


________________________________________________________________________________
This email (and any attachments) is private and confidential, and is intended
solely for the addressee. If you have received this communication in error
please remove it and inform us via telephone or email.

Although we take all possible steps to ensure mail and attachments are free
from malicious content, malware and viruses, we cannot accept any responsibility
whatsoever for any changes to content outwith our administrative bounds.

The views represented within this mail are solely the view of the
author and do not reflect the views of Graham Technology as a whole.
________________________________________________________________________________

Graham Technology plc                               http://www.gtnet.com
________________________________________________________________________________