Programación y Desarrollo para Android Subforo exclusivo para temas de programación de software para PDAs y desarrollo de aplicaciones, interfaces, etc bajo Android

Respuesta
 
Herramientas
  #1  
Viejo 21/03/12, 17:50:16
Array

[xs_avatar]
gohan0189 gohan0189 no está en línea
Miembro del foro
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL

Problema WS

bueno lo que pasa es que tengo mi web service que me manda lo siguiente:

Código:
{"Id":958521,"Poliza":{"Id":958520,"Folio":"958520","Derechos":0,"ComisionImporte":1234.5,"ComisionPct":10,"RecargosImporte":0,"RecargosPct":0,"Estatus":0,"Gastos":0,"Aseguradora":{"Id":2778,"NombreCompleto":"AXA SEGUROS SA DE CV","Clave":"AXA","DeshabilitaCalculos":false,"CalculoComisionIncluyeRecargo":false,"CalculoRecargoIncluyeDerechos":false},"Impuesto":{"Clave":"IVA-16","Nombre":"NUEVO IVA","Porcentaje":16},"Impuesto":{"Id":2189,"Clave":"IVA-16","Nombre":"NUEVO IVA","Porcentaje":16},"Ramo":{"Clave":"AUT","Nombre":"AUTOS","Id":2569,"Xtype":"pol.aut","DivisionOperativa":0},"SubRamo":{"Clave":"AUT","Nombre":"AUTOS IND","Id":2570,"Flotilla":false}},"Serie":"12345","Motor":"12345","Placas":null,"ConductorHabitual":null,"Contacto":null,"CoberturaAuto":0,"Marca":{"Id":2447,"Clave":"DEF","Descripcion":"DEFAULT","Ubicacion":{"Id":2185,"Path":"1","Nombre":"GAB STA FE"},"CentroDeBeneficio":{"Id":4,"Path":"1.1","Nombre":"Loader"},"Propietario":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"Permiso":2,"UsuarioAdd":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"FechaAdd":"\/Date(1273271245000-0500)\/","UsuarioUMod":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"FechaUMod":"\/Date(1273271245000-0500)\/","UsuarioDel":null,"FechaDel":null,"Estatus":1,"RefWinsef":null,"RequiereAutorizacionFlujo":false},"Modelo":"2010","Version":"version","Descripcion":"DEFAULT 2010 version","EndosoAlta":null,"EndosoBaja":null,"GrupoAsegurados":null,"Inciso":"12345","Estatus":1,"Prima":0,"BeneficiarioPreferente":null,"Identificador":null,"Empleado":null,"TarjetaBancaria":null,"Ubicacion":{"Id":2185,"Path":"1","Nombre":"GAB STA FE"},"CentroDeBeneficio":{"Id":2213,"Path":"1.1.2.1.1","Nombre":"TI y Sistemas"},"Propietario":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"Permiso":2,"UsuarioAdd":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"FechaAdd":"\/Date(1331255081000-0600)\/","UsuarioUMod":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"FechaUMod":"\/Date(1331255081000-0600)\/","UsuarioDel":null,"FechaDel":null,"RefWinsef":null,"RequiereAutorizacionFlujo":false}
y en mi app tengo el siguiente codigo



Código:
private static final String namespace = "http://tempuri.org/";
    private static String url="http://xxx.xxx.xxx.xxx/carpeta/namews/name.asmx";  
        private static final String Metodo = "GetIncisoByPolizaAndInciso";
    private static final String accionSoap ="http://tempuri.or/GetIncisoByPolizaAndInciso"; 
       private String JSONString;
        private String resultString;
        private JSONArray jObject;
        private JSONArray jArray;  

SoapObject solicitud = new SoapObject(namespace, Metodo);
          SoapSerializationEnvelope envoltorio = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envoltorio.dotNet = true;
          envoltorio.setOutputSoapObject(solicitud);
          HttpTransportSE transporte = new HttpTransportSE(url);
          
          try {         
               transporte.call(accionSoap, envoltorio);               
              Object result = (Object) envoltorio.getResponse();                             
               JSONString=result.toString();
al correrlo en debug llega hasta
Código:
transporte.call(accionSoap,envoltorio);
y cuando pasa a
Código:
Object result = (Object) envoltorio.getResponse();
se salta al catch (Exception e)

en la linea de Object result = (Object) envoltorio.getResponse(); ya probe tambien cambiandole a SoapPrimitive y tampoco alguien sabe que estoy haciendo mal???
Responder Con Cita


  #2  
Viejo 21/03/12, 19:18:20
Array

[xs_avatar]
gohan0189 gohan0189 no está en línea
Miembro del foro
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL

y la exception me manda lo siguiente

Código:
System.web.services.protocols.soapexception:El servidor no puede procesar la solicitud.__>System.indexoutofrangeexception:indice fuera de los limites de la matriz.
y me dice la ruta de mi archivo (ws)

esto que significa y como podria solucionarlo??
Responder Con Cita
  #3  
Viejo 22/03/12, 02:56:29
Array

[xs_avatar]
gohan0189 gohan0189 no está en línea
Miembro del foro
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL

ok ya lo solucione pero ahora solo me sale "error" eso es lo q contiene mi variable result, alguien sabe porque???

al cambiar el error ahora este es mi resultado del web service

Código:
{"Id":958521,"Poliza":{"Id":958520,"Folio":"958520","Derechos":0,"ComisionImporte":1234.5,"ComisionPct":10,"RecargosImporte":0,"RecargosPct":0,"Estatus":0,"Gastos":0,"Aseguradora":{"Id":2778,"NombreCompleto":"AXA SEGUROS SA DE CV","Clave":"AXA","DeshabilitaCalculos":false,"CalculoComisionIncluyeRecargo":false,"CalculoRecargoIncluyeDerechos":false},"Impuesto":{"Clave":"IVA-16","Nombre":"NUEVO IVA","Porcentaje":16},"Impuesto":{"Id":2189,"Clave":"IVA-16","Nombre":"NUEVO IVA","Porcentaje":16},"Ramo":{"Clave":"AUT","Nombre":"AUTOS","Id":2569,"Xtype":"pol.aut","DivisionOperativa":0},"SubRamo":{"Clave":"AUT","Nombre":"AUTOS IND","Id":2570,"Flotilla":false}},"Serie":"12345","Motor":"12345","Placas":null,"ConductorHabitual":null,"Contacto":null,"CoberturaAuto":0,"Marca":{"Id":2447,"Clave":"DEF","Descripcion":"DEFAULT","Ubicacion":{"Id":2185,"Path":"1","Nombre":"GAB STA FE"},"CentroDeBeneficio":{"Id":4,"Path":"1.1","Nombre":"Loader"},"Propietario":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"Permiso":2,"UsuarioAdd":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"FechaAdd":"\/Date(1273271245000-0500)\/","UsuarioUMod":{"Id":1,"Email":"[email protected]","Nombre":"Usuario Loader","Username":"loader"},"FechaUMod":"\/Date(1273271245000-0500)\/","UsuarioDel":null,"FechaDel":null,"Estatus":1,"RefWinsef":null,"RequiereAutorizacionFlujo":false},"Modelo":"2010","Version":"version","Descripcion":"DEFAULT 2010 version","EndosoAlta":null,"EndosoBaja":null,"GrupoAsegurados":null,"Inciso":"12345","Estatus":1,"Prima":0,"BeneficiarioPreferente":null,"Identificador":null,"Empleado":null,"TarjetaBancaria":null,"Ubicacion":{"Id":2185,"Path":"1","Nombre":"GAB STA FE"},"CentroDeBeneficio":{"Id":2213,"Path":"1.1.2.1.1","Nombre":"TI y Sistemas"},"Propietario":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"Permiso":2,"UsuarioAdd":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"FechaAdd":"\/Date(1331255081000-0600)\/","UsuarioUMod":{"Id":2343,"Email":"[email protected]","Nombre":"José Carlos Guzmán","Username":"cguzman"},"FechaUMod":"\/Date(1331255081000-0600)\/","UsuarioDel":null,"FechaDel":null,"RefWinsef":null,"RequiereAutorizacionFlujo":false}
Responder Con Cita
Respuesta

Estás aquí
Regresar   Portal | Indice > Todo sobre Android > Programación y Desarrollo para Android



Hora actual: 20:15:59 (GMT +2)



User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.

Contactar por correo / Contact by mail / 邮件联系 /