axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Created: (AXIS-1569) Problems with Deserialzing Arrays by the Axis Servlet and the Axis Client for a Doc/Literal service
Date Wed, 22 Sep 2004 21:51:34 GMT

  A new issue has been created in JIRA.

View the issue:

Here is an overview of the issue:
        Key: AXIS-1569
    Summary: Problems with Deserialzing Arrays by the Axis Servlet and the Axis Client for
a Doc/Literal service
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis

   Reporter: Kachra Patti

    Created: Wed, 22 Sep 2004 2:50 PM
    Updated: Wed, 22 Sep 2004 2:50 PM
Environment: axis-1_2beta3, Java 1.4.2, Tomcat 5.0.27, WindowsXP(Professional)

Some Background
STEP1: Created a very simple class TestService, which contains a method hello(), that merely
returns the input
public class TestService {
    public Bean hello(Bean input) {return input; }

STEP 2: The input is a Bean instance, that has properties of types String, Integer, Date and
public class Bean {
    private String stringField;
    private Integer integerField;
    private java.util.Date dateField;
    private String[] stringArray;

STEP 3: TestService.wsdl was then created manually, to expose the above method as a webservice.
The following fragment shows the description of the Bean in the WSDL.
    <schema xmlns="" elementFormDefault="qualified" targetNamespace="">
      <complexType name="Bean">
          <element name="stringField" nillable="true" type="xsd:string"/>
          <element name="integerField" nillable="true" type="xsd:int"/>
          <element name="dateField" nillable="true" type="xsd:dateTime"/>
          <element name="stringArray" nillable="true" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>

STEP 4: Used the axis-wsdl2java task to generate deployment descriptors and test stubs from
the WSDL. Used the following code in the test class to invoke the webservice
        Bean input = new Bean();
        input.setStringField("TEST STRING");
        input.setIntegerField(new Integer(1001));
        input.setDateField(new java.util.GregorianCalendar());
        input.setStringArray(new String[] {"aa", "bb", "cc"});
        Bean output = binding.hello(input);

1- Only the last object in the StringArray property is made available to the TestService by
the Axis Servlet. Eg. For the above test code, only the String "cc" is available to the hello()

2- The client throws the following error, when deserializing the output from the webservice
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected,
in something it was trying to deserialize.
        at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(
        at org.apache.axis.encoding.DeserializationContext.startElement(
        at org.apache.axis.message.SAX2EventRecorder.replay(
        at org.apache.axis.message.MessageElement.publishToHandler(
        at org.apache.axis.message.RPCElement.deserialize(
        at org.apache.axis.message.RPCElement.getParams(
        at org.apache.axis.client.Call.invoke(
        at org.apache.axis.client.Call.invoke(
        at org.apache.axis.client.Call.invoke(
        at com.example.TestServiceSoapBindingStub.hello(
        at com.example.TestServiceServiceTestCase.test1TestServiceHello(

3- Invoked the webservice from the .NET WebService Studio. Again, only the last element in
the StringArray property is made available to the TestService by the Axis Servlet
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi=""
    <helloInput xmlns="">
      <stringField>TEST STRING</stringField>

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd=""
    <helloReturn xmlns="">
        <item xmlns="">cc</item>
      <stringField>TEST STRING</stringField>

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message