3 Replies Latest reply on Oct 23, 2003 10:08 AM by crazypalm

    Complex Type - Serialization Error.

    Scott Streit Newbie

      I am trying to return a Complex Type.

      I get the following error:

      ep 19, 2003 10:32:33 PM org.apache.axis.client.Call invoke
      SEVERE: Exception:
      org.xml.sax.SAXException: Deserializing parameter 'increaseReturn': could not find deserializer for type {urn:CountData}CountData
      at org.apache.axis.message.RPC-Handler.onStartChild(RPCHandler.java:276)
      at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:893)


      My webservice.xml is the following:
      <?xml version="1.0" encoding="UTF-8"?>

      <deployment name="Count" targetNamespace="http://www.thestreits.com/count" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      <!--
      this is an extension to the Axis deployment descriptor which allows to
      specify the naming environment for the deployed ws logic
      -->
















      <beanMapping qname="myNS:CountData" xmlns:myNS="urn:CountData" classname="breit.ejb.client.count.CountData" languageSpecificType="java:breit.ejb.client.count.CountData"/>






      My client code contains:
      call.setReturnType(org.apache.axis.Constants.XSD_ANY);

      CountData countData = (CountData) call.invoke( new Object[] { "scott" } );

      What is causing this problem? Is there a problem with my beanMapping?


        • 1. Re: Complex Type - Serialization Error.
          Scott Streit Newbie

          The problem is fixed.

          I was missing a mapping in the client program.

          Here is the web-services.xml.

          <?xml version="1.0" encoding="UTF-8"?>

          <deployment name="Count" targetNamespace="http://www.thestreits.com/count" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
          <!--
          this is an extension to the Axis deployment descriptor which allows to
          specify the naming environment for the deployed ws logic
          -->






















          <beanMapping qname="CountData" xmlns:myNS="CounterService" languageSpecificType="java:breit.ejb.client.count.CountData"/>



          Here is the client program.

          package breit.test.webservice;

          import org.apache.axis.client.Call;
          import org.apache.axis.client.Service;
          import org.apache.axis.encoding.XMLType;
          import javax.xml.rpc.ParameterMode;

          public class Test {

          public static void main(String [] args) {
          try {
          String endpoint =
          "http://localhost:8001/jboss-net/services/CounterService";
          String methodName = "getCountAsString";

          Service service = new Service();
          Call call = (Call) service.createCall();

          call.setTargetEndpointAddress( new java.net.URL(endpoint) );
          call.setOperationName(methodName);


          call.addParameter("page",
          org.apache.axis.Constants.XSD_STRING,
          ParameterMode.IN);
          call.setReturnType(org.apache.axis.Constants.XSD_STRING);

          String ret = (String) call.invoke( new Object[] { "AXIS!" } );

          System.out.println("return is " + ret);
          } catch (Exception e) {
          System.err.println(e.toString());
          }
          }
          }





          • 2. Re: Complex Type - Serialization Error.
            Stephane Nicoll Master

            I am using jboss-net to generate my deployment descriptor. Do you know how I can do the same? I mean my complex type is declared but Axis couldn't find a deserializer for it (same problem)

            Regards,

            Stephane

            • 3. Re: Complex Type - Serialization Error.
              crazypalm Newbie

              Hi,

              Your sencond post does not seem that it is the solution of the first post. The return value is String instead of CallData Object as your first post. I don't why you need do mapping if you don't use Object.

              Any true solution for the first one?

              Thanks