BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-13-2008, 02:02 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2008
Model: 8310
PIN: N/A
Carrier: Informatico
Posts: 56
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default pass parameters ksoap web service

Please Login to Remove!

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();
}
}
Offline  
Old 04-13-2008, 05:15 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Posts: 181
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you trying to run this from your blackberry? You've got the IP address 192.168.0.3 in your code, which is an internal network address and obviously your blackberry isn't on your internal network.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Vintage RCA Vacuum Tube RF Signal Generator Model WR-50B - Very Clean Condition
$39.99
Vintage RCA Vacuum Tube RF Signal Generator Model WR-50B - Very Clean Condition picture4 heads pneumatic Perfume vacuum filling machine for Liquid
$1669.0
4 heads pneumatic Perfume vacuum filling machine for Liquid pictureNice Slim Anti-aging 8 in1 Cavitation Vacuum Multipolar RF BIO Hot Cold Hammmer
$434.35
Nice Slim Anti-aging 8 in1 Cavitation Vacuum Multipolar RF BIO Hot Cold Hammmer pictureRF BIO 8 in1 40K Body Slim Cavitation Vacuum Multipolar Hot Cold Hammmer System
$440.0
RF BIO 8 in1 40K Body Slim Cavitation Vacuum Multipolar Hot Cold Hammmer  System pictureVintage NRI Professional Vacuum Tube Signal Generator Model 88
$24.99
Vintage NRI Professional Vacuum Tube Signal Generator Model 88 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.