0 Replies Latest reply on Sep 2, 2005 6:10 AM by pledge

    Serialising array of strings

    pledge

      I have been trying to get an array of strings passed to and from my web service. I have been following the wiki guide for creating a bean for my array.

      package com.ccmdigital.samples.ews.types;
      
      public class StringArray {
       private String[] stringArray;
      
       public String[] getStringArray() {
       return stringArray;
       }
      
       public void setStringArray(String[] stringArray) {
       this.stringArray = stringArray;
       }
      }
      


      I have then created a ws4ee deployment descriptor

       <deployment
       xmlns='http://xml.apache.org/axis/wsdd/'
       xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
       xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
       xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
       xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
      
       <typeMapping
       qname='ns2:echoStringArray' xmlns:ns2='http://ews.samples.ccmdigital.com/types/arrays/java/lang'
       type='com.ccmdigital.samples.ews.types.StringArray'
       serializer='org.jboss.axis.encoding.ser.BeanSerializerFactory'
       deserializer='org.jboss.axis.encoding.ser.BeanSerializerFactory'
       encodingStyle=''>
       </typeMapping>
      
       <typeMapping
       qname='ns2:echoStringArrayResponse' xmlns:ns2='http://ews.samples.ccmdigital.com/types/arrays/java/lang'
       type='com.ccmdigital.samples.ews.types.StringArray'
       serializer='org.jboss.axis.encoding.ser.BeanSerializerFactory'
       deserializer='org.jboss.axis.encoding.ser.BeanSerializerFactory'
       encodingStyle=''>
       </typeMapping>
      
       </deployment>


      When I try to deploy this I am getting a class cast exception

      10:54:22,968 ERROR [ServiceDeployer] Cannot startup webservice for: EncryptedWebService.war
      org.jboss.deployment.DeploymentException: Cannot deploy webservice; - nested throwable: (org.jboss.axis.deployment.wsdd.WSDDException: java.lang.ClassCastException: org.jboss.axis.encoding.ser.BeanSerializerFactory
      java.lang.ClassCastException: org.jboss.axis.encoding.ser.BeanSerializerFactory
       at org.jboss.axis.encoding.ser.BaseDeserializerFactory.createFactory(BaseDeserializerFactory.java:269)
       at org.jboss.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:617)
       at org.jboss.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:294)


      Any ideas what I am doing wrong here?