Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/06/2014, 12:47
Avatar de Panshop
Panshop
 
Fecha de Ingreso: abril-2009
Ubicación: Santiago
Mensajes: 87
Antigüedad: 15 años, 1 mes
Puntos: 0
Problema parametros webservice .net

Buenas,
he tenido mucho tiempo sin entrar, pero tengo una duda.

He creado un servicio web en .net, que retorna un objeto en JSON.
Lo estoy llamando desde mi código en android, y no me está cargandlo las variables. No se si el problema es del android o es del WS.

estoy llamando de la siguiente manera:
Código PHP:

Llamado WS desde android:

String req = null;
        SoapObject request = new SoapObject(NAMESPACE, webMethName);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        PropertyInfo prop = new PropertyInfo();
        prop.setNamespace(NAMESPACE);
        prop.setName("usuario");
        prop.setValue(usuario);
        prop.setType(String.class);
        request.addProperty(prop);
        prop.setName("pass");
        prop.setValue(pass);
        prop.setType(String.class);
        request.addProperty(prop);
        envelope.dotNet = true;
        //envelope.setAddAdornments(false);
        //envelope.implicitTypes = true;
        
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {
            // Invole web service
            androidHttpTransport.call(SOAP_ACTION+webMethName, envelope);
            SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
            req = response.toString();
        }
        catch(Exception e){
            Log.d("errorLOL: ", e.getMessage());
            req = "Error occured";
        }
        return req;


WSDL:

<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://androidService.nubix.cl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://androidService.nubix.cl" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:s="http://www.w3.org/2001/XMLSchema">-<wsdl:types>-<s:schema targetNamespace="http://androidService.nubix.cl" elementFormDefault="qualified">-<s:element name="mtdValidaUsuarioLogin">-<s:complexType>-<s:sequence><s:element name="usuario" type="s:string" maxOccurs="1" minOccurs="0"/><s:element name="pass" type="s:string" maxOccurs="1" minOccurs="0"/></s:sequence></s:complexType></s:element>-<s:element name="mtdValidaUsuarioLoginResponse">-<s:complexType>-<s:sequence><s:element name="mtdValidaUsuarioLoginResult" type="s:string" maxOccurs="1" minOccurs="0"/></s:sequence></s:complexType></s:element></s:schema></wsdl:types>-<wsdl:message name="mtdValidaUsuarioLoginSoapIn"><wsdl:part name="parameters" element="tns:mtdValidaUsuarioLogin"/></wsdl:message>-<wsdl:message name="mtdValidaUsuarioLoginSoapOut"><wsdl:part name="parameters" element="tns:mtdValidaUsuarioLoginResponse"/></wsdl:message>-<wsdl:portType name="ValidacionesSoap">-<wsdl:operation name="mtdValidaUsuarioLogin"><wsdl:input message="tns:mtdValidaUsuarioLoginSoapIn"/><wsdl:output message="tns:mtdValidaUsuarioLoginSoapOut"/></wsdl:operation></wsdl:portType>-<wsdl:binding name="ValidacionesSoap" type="tns:ValidacionesSoap"><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>-<wsdl:operation name="mtdValidaUsuarioLogin"><soap:operation style="document" soapAction="http://androidService.nubix.cl/mtdValidaUsuarioLogin"/>-<wsdl:input><soap:body use="literal"/></wsdl:input>-<wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding>-<wsdl:binding name="ValidacionesSoap12" type="tns:ValidacionesSoap"><soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>-<wsdl:operation name="mtdValidaUsuarioLogin"><soap12:operation style="document" soapAction="http://androidService.nubix.cl/mtdValidaUsuarioLogin"/>-<wsdl:input><soap12:body use="literal"/></wsdl:input>-<wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding>-<wsdl:service name="Validaciones">-<wsdl:port name="ValidacionesSoap" binding="tns:ValidacionesSoap"><soap:address location="http://192.168.1.9/ServiceTest/Validaciones.asmx"/></wsdl:port>-<wsdl:port name="ValidacionesSoap12" binding="tns:ValidacionesSoap12"><soap12:address location="http://192.168.1.9/ServiceTest/Validaciones.asmx"/></wsdl:port></wsdl:service></wsdl:definitions>


dentro del metodo de validación del usuario, pidiendo que me retorne los parámetros ingresados y vienen vacíos.

Cualquier cosa, gracias