×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    8

    pass parameters ksoap web service

    The problema is that The web service don't recognize any parameter, I don't know if the code is correct,
    but the web service ever answer me " - False", How can I pass parameters to my web service correctly?

    This is the code of the web service and the J2ME code:

    <WebMethod()> _
    Public Function Validarusuario(ByVal usuario As String, ByVal password As String) As String
    Dim ConSQL As System.Data.OleDb.OleDbConnection, cmd_tmp As System.Data.OleDb.OleDbCommand
    Dim sql As String
    Try
    ConSQL = New System.Data.OleDb.OleDbConnection(CadenaConexion)
    ConSQL.Open()
    sql = "SELECT COUNT(*) FROM VALIDACION WHERE USUARIO = '" & usuario & "' AND PASSWORD = '" & password & "'"
    cmd_tmp = New System.Data.OleDb.OleDbCommand(sql, ConSQL)
    If cmd_tmp.ExecuteScalar > 0 Then Return usuario + " - True" Else Return usuario + " - False"
    ConSQL.Close()
    Catch ex As Exception
    Return "False"
    End Try
    End Function

    public void ProcesarRespuesta() {
    try {
    String soapAction = "http://tempuri.org/Validarusuario";
    String serviceUrl = "http://192.168.0.3/Web_Service/service.asmx";
    String serviceNamespace ="http://tempuri.org/Web_Service/Validarusuario";

    HttpTransport transport = null;
    //SoapObject soap = new SoapObject(serviceNamespace, "HelloWorld");
    SoapObject soap = new SoapObject(serviceNamespace, "Validarusuario");
    soap.addProperty("usuario", "1");
    soap.addProperty("password", "1");

    transport = new HttpTransport(serviceUrl, soapAction);
    transport.debug = true;
    Object result = transport.call(soap);

    StringItem item = new StringItem("Resultado: ", result.toString());
    formulario.append(item);
    } catch (Exception e) {
    formulario.append(e.toString());
    e.printStackTrace();
    }
    }

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    Re: pass parameters ksoap web service

    Hi,

    You just have a look at one developing simple tool at http://sourceforge.net/projects/ksoap2genstub/. The tool helps you to generate code in J2ME from the WSDL document so that you can easily invoke web services in J2ME.

    Cheers

Similar Threads

  1. pass parameters to web service with ksoap
    By racsus in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-04-11, 08:06
  2. Web service, need a help
    By JTOne in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-10-17, 08:01
  3. KErrSenNotInitialized error while accessing web service, what am I doing wrong?
    By RaimondasL in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2007-06-14, 21:28
  4. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24
  5. Web Service / Soap
    By corradoME in forum Mobile Java General
    Replies: 0
    Last Post: 2004-11-25, 11:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×