title: Sending custom objects with kSOAP
body: <p>i am using <strong>ksoap2</strong> (ksoap2-android-assembly-3.0.0-RC.1-jar-with-dependencies.jar) to communicate my <strong>android</strong> app with soap service which is set up on <strong>jboss 7</strong> (jboss-as-7.1.1_Final &amp; jbossws-cxf-4.0.2.GA) with <strong>jaxws</strong>-2.2.6-2-20120518.</p>
  
  <p>I am able to fetch any data (any means my custom objects) but i am not able to send them through. I have followed <a href="http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html" rel="nofollow">this</a> article. My object (named "Frame") is implementing org.ksoap2.serialization.KvmSerializable.</p>
  
  <p>My request wrapper class looks like:</p>
  
  <pre><code>@XmlRootElement(name = "addFrame", namespace = "http://frame.service.server.android.i2.eu/")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "addFrame", namespace = "http://frame.service.server.android.i2.eu/")
  public class AddFrame {
  
      @XmlElement(name = "arg0")
      private Frame frame;
  
      public Frame getFrame() {
          return frame;
      }
  
      public void setFrame(Frame frame) {
          this.frame = frame;
      }
  }
  </code></pre>
  
  <p>When i try to send object (not inside android) using java se methods (javax.xml.namespace.QName &amp; javax.xml.ws.Service) object is persisted in my mssql database, so i think there is some problem with my android client implementation.</p>
  
  <pre><code>String namespace = "http://frame.service.server.android.i2.eu/";
  String wsdl = "http://localhost:8080/AndroidServer/AndreyServices/FrameService?wsdl";
  String action = "addFrame";
  String method = "http://frame.service.server.android.i2.eu/addFrame";
  
  SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  
  SoapObject request = new SoapObject(namespace, action)
  
  PropertyInfo info = new PropertyInfo();
  info.setType(Frame.class);
  info.setValue(frame);//frame as a java method parameter
  info.setName("arg0");
  request.addProperty(info);
  
  envelope.setOutputSoapObject(request);
  
  HttpTransportSE soapCall = new HttpTransportSE(wsdl);
  soapCall.call(action, envelope);
  </code></pre>
  
  <p>After this i receive:</p>
  
  <ul>
  <li>android log:</li>
  </ul>
  
  <pre>
  07-22 16:48:51.256: E/FRAME(1013): eu.i2.android.delegate.exception.DelegateException: SoapFault - faultcode: 'soap:Client' faultstring: 'Unmarshalling Error: null ' faultactor: 'null' detail: null
  07-22 16:48:51.256: E/FRAME(1013): eu.i2.android.interfaces.exceptions.CommunicationException: eu.i2.android.delegate.exception.DelegateException: SoapFault - faultcode: 'soap:Client' faultstring: 'Unmarshalling Error: null ' faultactor: 'null' detail: null
  07-22 16:48:51.256: E/FRAME(1013):  at eu.i2.android.communication.Communication.addFrame(Communication.java:81)
  07-22 16:48:51.256: E/FRAME(1013):  at eu.u2.android.client.Client.onCreate(Client.java:54)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  07-22 16:48:51.256: E/FRAME(1013):  at android.os.Handler.dispatchMessage(Handler.java:99)
  07-22 16:48:51.256: E/FRAME(1013):  at android.os.Looper.loop(Looper.java:123)
  07-22 16:48:51.256: E/FRAME(1013):  at android.app.ActivityThread.main(ActivityThread.java:4627)
  07-22 16:48:51.256: E/FRAME(1013):  at java.lang.reflect.Method.invokeNative(Native Method)
  07-22 16:48:51.256: E/FRAME(1013):  at java.lang.reflect.Method.invoke(Method.java:521)
  07-22 16:48:51.256: E/FRAME(1013):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  07-22 16:48:51.256: E/FRAME(1013):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  07-22 16:48:51.256: E/FRAME(1013):  at dalvik.system.NativeStart.main(Native Method)
  07-22 16:48:51.256: E/FRAME(1013): Caused by: eu.i2.android.delegate.exception.DelegateException: SoapFault - faultcode: 'soap:Client' faultstring: 'Unmarshalling Error: null ' faultactor: 'null' detail: null
  07-22 16:48:51.256: E/FRAME(1013):  at eu.i2.android.delegate.delegates.FrameDelegate.addFrame(FrameDelegate.java:152)
  07-22 16:48:51.256: E/FRAME(1013):  at eu.i2.android.communication.Communication.addFrame(Communication.java:79)
  07-22 16:48:51.256: E/FRAME(1013):  ... 14 more
  07-22 16:48:51.256: E/FRAME(1013): Caused by: SoapFault - faultcode: 'soap:Client' faultstring: 'Unmarshalling Error: null ' faultactor: 'null' detail: null
  07-22 16:48:51.256: E/FRAME(1013):  at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:141)
  07-22 16:48:51.256: E/FRAME(1013):  at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140)
  07-22 16:48:51.256: E/FRAME(1013):  at org.ksoap2.transport.Transport.parseResponse(Transport.java:116)
  07-22 16:48:51.256: E/FRAME(1013):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:235)
  07-22 16:48:51.256: E/FRAME(1013):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:114)
  07-22 16:48:51.256: E/FRAME(1013):  at eu.i2.android.delegate.AbstractDelegate$SoapCall.call(AbstractDelegate.java:219)
  07-22 16:48:51.256: E/FRAME(1013):  at eu.i2.android.delegate.delegates.FrameDelegate.addFrame(FrameDelegate.java:141)
  07-22 16:48:51.256: E/FRAME(1013):  ... 15 more
  </pre>
  
  <ul>
  <li>server log:</li>
  </ul>
  
  <pre>
  18:48:52,057 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-localhost-127.0.0.1-8080-2) Interceptor for {http://frame.service.server.android.i2.eu/}AndreyServices#{http://frame.service.server.android.i2.eu/}addFrame has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Unmarshalling Error: null 
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:808)
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:642)
      at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:156)
      at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:109)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
      at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
      at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)
      at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
      at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi.jar:2.0.3.GA]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
      at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
  Caused by: java.lang.NullPointerException
      at org.apache.cxf.jaxb.io.DataReaderImpl$WSUIDValidationHandler.handleEvent(DataReaderImpl.java:69)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:655)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:691)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:687)
      at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.handleParseConversionException(Loader.java:271)
      at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:69)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:514)
      at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:339)
      at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:217)
      at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:186)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:369)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:348)
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:778)
      ... 29 more
  </pre>
  
  <p>I did not install any jar from <a href="http://code.google.com/p/ksoap2-android/source/browse/#svn/m2-repo/com/google/code/ksoap2-android" rel="nofollow">here</a> in jboss modules.</p>
  
  <p>Thank You in advance!</p>