I've coded a Web Service that provides a service returning a String[]
When it is called by a client that uses code generated by WSDL2Java, I got an exception
org.xml.sax.SAXException: Found character data inside an array element while deserializing
at org.apache.axis.encoding.ser.ArrayDeserializer.characters(ArrayDeserializer.java:518)
at org.apache.axis.encoding.DeserializationContextImpl.characters(DeserializationContextImpl.java:894)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:210)
....


In attachment : the file deploy.wsdd and the interface generated by WSDL2Java


Here is the response sent by the server :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<soapenv:Body>
<getAnswersReturn soapenc:arrayType="xsd:string[7]" xmlns="http://www.relevancellc.com/demos/MagicBall"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
<item xmlns="">No</item>
<item xmlns="">Yes</item>
<item xmlns="">Maybe</item>
<item xmlns="">Only on the Eclipse platform</item>
<item xmlns="">Why not?</item>
<item xmlns="">Someday</item>
<item xmlns="">Not too likely</item>
</getAnswersReturn>
</soapenv:Body>
</soapenv:Envelope>


What happened ? Did WSDL2Java generate a wrong code ? Should I modify the generated code ?
/**
 * MagicBall.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package com.relevancellc.demos.mball.wsdl;

public interface MagicBall extends java.rmi.Remote {
    public java.lang.String askQuestion(java.lang.String question) throws 
java.rmi.RemoteException;
    public java.lang.String[] getAnswers() throws java.rmi.RemoteException;
    public void addAnswer(java.lang.String[] newAnswers) throws 
java.rmi.RemoteException;
}

Reply via email to