title: sending Java Serializable Object to Byte Array to webservice java.lang.classnotfoundexception
body: <p>I have a custom object that implements serializable, defined in the client project and in the webservice project. I want to pass that object as byte array through soap message, but when i try to do this, the method in the webservice in rebuilding the object have a class not found exception as in the follow stack:</p>
  
  <pre><code>java.lang.ClassNotFoundException: com.myproject.biosign.client.vo.Istante
  </code></pre>
  
  <p>Note that the path referenced in exception is the path of the object in the client and rightly that's not found in webservice. How i can rebuild the object with the definition of the same object in webservice?</p>
  
  <p>Following the code of converting, sending and deconverting object.</p>
  
  <p>In client method:</p>
  
  <pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  
      try {
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          ObjectOutput out = null;
  
            out = new ObjectOutputStream(bos);   
            out.writeObject(istanti.get(0));
            byte[] yourBytes = bos.toByteArray();
  
            out.close();
            bos.close();
  
          request.addProperty("lista", yourBytes);                
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  
          envelope.dotNet = false;
          envelope.setOutputSoapObject(request);
  
          Marshal floatMarshal = new MarshalFloat();
          floatMarshal.register(envelope);
          new MarshalBase64().register(envelope);
          HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
          androidHttpTransport.debug = true;
  
          androidHttpTransport.call(SOAP_ACTION, envelope);
  </code></pre>
  
  <p>In WS method:</p>
  
  <pre><code>ByteArrayInputStream bis = new ByteArrayInputStream(lista);
            ObjectInput in = null;
            try {
              in = new ObjectInputStream(bis);
              Object o = in.readObject(); 
              Istante ist = (Istante) o;
              System.out.println("eccoci" + ist.getXCoord());
              bis.close();
              in.close();
  </code></pre>