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 Felix Kravets <fk...@yahoo.com> on 2005/04/20 18:18:36 UTC

No serializer for byte array

Hi guys,
 
I am using Axic 1_2RC3.
 
I generated Java classes from WSDL. When I am trying to send byte[] I am geting an error 
"No serializer found for class B[.
 
Relevant part of my  original WSDL 
 
<definitions name="SmartConnection" targetNamespace="urn:SmartConnection" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:SmartConnection" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/">
    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
        <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:SmartConnection">

            <complexType name="Attachment">
                <all>
                    <element name="Type" type="xsd:string"/>
                    <element name="Content" type="tns:AttachmentContent"/>
                </all>

            <simpleType name="AttachmentContent">
                <restriction base="base64Binary">
                    <annotation>
                        <appinfo>
                            <content:mediaType value="application/octet-stream"/>
                        </appinfo>
                    </annotation>
                </restriction>
            </simpleType>

>From the above WSDL WSDL2Java generated the following deploy.wsdd
 
      <typeMapping
        xmlns:ns="urn:SmartConnection"
        qname="ns:Attachment"
        type="java:SmartConnection.Attachment"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=""
      />
      <typeMapping
        xmlns:ns="urn:SmartConnection"
        qname="ns:AttachmentContent"
        type="java:byte[]"
        serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
        deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
        encodingStyle=""
      />

And the following in the Attachment.java
// Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(Attachment.class, true);
    static {
         elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("type");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:SmartConnection", "Type"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("content");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:SmartConnection", "Content"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"));
        typeDesc.addFieldDesc(elemField);
    }

After I deployded the service from the above deploy.wsdd Axis generated the following WSDL
  <complexType name="Attachment">
   <sequence>
    <element name="Type" nillable="true" type="xsd:string" /> 

     <element name="Content" nillable="true" type="xsd:base64Binary" /> 

</sequence>
</complexType>




 
Now when I try to send back some binary data Axis can't find deserializer for  class B[ (which is byte[]) I debugged the Axis code, but couldn't figure out what to do in order to fix the problem.
 
Please help.
 
Thanks,
Felix   
 
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com