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


 
Herramientas
  #1  
Viejo 21/03/12, 17:50:16
Avatar de gohan0189
gohan0189 gohan0189 no está en línea
Miembro del foro
Mensajes: 190
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL
Mencionado: 0 comentarios
Tagged: 0 hilos
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
Avatar de gohan0189
gohan0189 gohan0189 no está en línea
Miembro del foro
Mensajes: 190
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL
Mencionado: 0 comentarios
Tagged: 0 hilos
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
Avatar de gohan0189
gohan0189 gohan0189 no está en línea
Miembro del foro
Mensajes: 190
 
Fecha de registro: feb 2012
Mensajes: 190
Tu operador: TELCEL
Mencionado: 0 comentarios
Tagged: 0 hilos
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   HTCMania > Todo sobre Android > Programación y Desarrollo para Android


Reglas de Mensajes
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Las caritas están On
Código [IMG] está On
Código HTML está Off

Saltar a Foro



Hora actual: 00:22:32 (GMT +2)

Cookies settings
Powered by vBulletin™
Copyright © vBulletin Solutions, Inc. All rights reserved.
 
HTCMania: líderes desde el 2007