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 Alex Bond <aj...@hotmail.com> on 2003/11/27 16:38:48 UTC
Exception: org.xml.sax.SAXException: No deserializer defined for array type {htt
Hi,
I am implementing a connector to the KEGGAPI web service using JAVA and
APACHE AXIS 1.1. However I am getting the following error when I get back
data other than a String eg, SSDBResult object or GENESResult object.
Exception:
org.xml.sax.SAXException: No deserializer defined for array type
{http://xml.apache.org/xml-soap}SOAPStruct
at
org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)
at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:428)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
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
org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:186)
at $Proxy0.get_all_neighbors_by_gene(Unknown Source)
at
KEGG.KEGGConnector.get_all_neighbors_by_gene(KEGGConnector.java:75)
at KEGG.KEGGConnectorTest.main(KEGGConnectorTest.java:87)
; nested exception is:
org.xml.sax.SAXException: No deserializer defined for array type
{http://xml.apache.org/xml-soap}SOAPStruct
I was wondering if you know what is causing this error. The code
implementation is below.
KEGGConnector class:
public class KEGGConnector implements KEGGPortType{
private KEGGPortType dynamicProxy;
/** Creates a new instance of KEGGConnector */
public KEGGConnector()
{
dynamicProxy = createDynamicProxy();
}
private KEGGPortType createDynamicProxy()
{
String urlString;
String nameSpaceURI;
String serviceName;
String portName;
URL keggWSDLURL;
ServiceFactory serviceFactory;
Service keggService;
KEGGPortType proxy;
urlString = "http://soap.genome.ad.jp/KEGG.wsdl";
nameSpaceURI = "SOAP/KEGG";
serviceName = "KEGG";
portName = "KEGGPort";
keggWSDLURL = null;
serviceFactory = null;
keggService = null;
proxy = null;
try
{
keggWSDLURL = new URL(urlString);
serviceFactory = serviceFactory.newInstance();
keggService = serviceFactory.createService
(keggWSDLURL, new QName(nameSpaceURI, serviceName));
proxy = (KEGGPortType) keggService.getPort
(new QName(nameSpaceURI, portName), KEGGPortType.class);
}
catch (MalformedURLException murle)
{
System.out.println(murle.getMessage());
}
catch (ServiceException se)
{
System.out.println(se.getMessage());
}
return proxy;
}
public SSDBResult[] get_all_neighbors_by_gene
(String kid, int threshold, String[] orgs) throws RemoteException
{
return dynamicProxy.get_all_neighbors_by_gene(kid, threshold, orgs);
}
}
KEGGConnectorTest class:
public class KEGGConnectorTest {
/** Creates a new instance of KEGGMain */
public KEGGConnectorTest()
{
}
static private void printSSDBResults(SSDBResult[] ssdbResults)
{
for (int i = 0; i < ssdbResults.length; i++)
{
System.out.println("SSDB Result " + i + ":\tkid1 -\t" +
ssdbResults[i].getKid1());
System.out.println(" \tkid2 -\t" +
ssdbResults[i].getKid2());
System.out.println(" \tsw_score -\t" +
ssdbResults[i].getSw_score());
System.out.println(" \tident -\t" +
ssdbResults[i].getIdent());
System.out.println(" \toverlap -\t" +
ssdbResults[i].getOverlap());
System.out.println(" \ts1_start -\t" +
ssdbResults[i].getS1_start());
System.out.println(" \ts1_end -\t" +
ssdbResults[i].getS1_end());
System.out.println(" \ts2_start -\t" +
ssdbResults[i].getS2_start());
System.out.println(" \ts2_end -\t" +
ssdbResults[i].getS2_end());
System.out.println(" \tb1 -\t" +
ssdbResults[i].getB1());
System.out.println(" \tb2 -\t" +
ssdbResults[i].getB2());
System.out.println(" \tdefinition1 -\t" +
ssdbResults[i].getDefinition1());
System.out.println(" \tdefinition2 -\t" +
ssdbResults[i].getDefinition2());
System.out.println(" \tlength1 -\t" +
ssdbResults[i].getLength1());
System.out.println(" \tlength2 -\t" +
ssdbResults[i].getLength2());
}
}
public static void main(String[] args)
{
KEGGConnector keggConnector;
SSDBResult[] ssdbResults;
String databases;
String dbinfo;
String[] genes;
String[] enzymes;
String[] pathways;
String[] organisms;
keggConnector = new KEGGConnector();
try
{
System.out.println("TEST :");
System.out.println("Search all the homologous genes for E. coli
gene 'b0002', over the default threshold score 100.");
System.out.println("keggConnector.get_all_neighbors_by_gene(\"eco:b0002\",
100, null)\n");
System.out.println("RESULTS:");
organisms = new String[2];
organisms[0] = "ece";
organisms[1] = "hin";
ssdbResults =
keggConnector.get_all_neighbors_by_gene("eco:b0002", 500, organisms);
printSSDBResults(ssdbResults);
I would be grateful if you could give me some help on this.
Thanks,
Alex Bond
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger