Search code examples
javablackberryksoap2

ksoap2 sending an abstract class with attribute type


I'm having a problem creating a request from Ksoap2 on BlackBerry, I have to create the following XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pol="http://osde.com.ar/services/binaria/personas/poliza" xmlns:bin="http://binaria.entities.osde.com.ar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header/>
   <soapenv:Body>
      <pol:getPoliza>
         <!--Optional:-->
         <pol:polizaVinculada i:type="bin:PolizaVinculadaVIT">
            <bin:idPoliza>49116</bin:idPoliza>
            <bin:idSolicitud>30261352</bin:idSolicitud>
         </pol:polizaVinculada>
      </pol:getPoliza>
   </soapenv:Body>
</soapenv:Envelope>

With the i:type="bin:PolizaVinculadaVIT", being polizaVinculada an abstract class and PolizaVinculadaVIT a subclass of PolizaVinculada

Does anybody know how to do this ?

Thanks


Solution

  • I think the problem is about sending complex objects.

    You can find more info about it on the following site: http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html

    In summary your PolizaVinculada must implement the KvmSerializable interface and then add the mapping to the Soap envelope.

    Saludos.