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

DELL 725-BBBQ / P82J5 Lamp manufactured by DELL
$162.69
DELL 725-BBBQ / P82J5 Lamp manufactured by DELL pictureNEW GENUINE - DELL 4G9HP BLACK Toner Cartridge - For C1660 - SEALED OEM
$29.99
NEW GENUINE - DELL 4G9HP BLACK Toner Cartridge - For C1660 - SEALED OEM pictureOriginal OEM Dell Optiplex 380 Full Height PCI Blanking Blank Insert P/N: 35FNF
$5.44
Original OEM Dell Optiplex 380 Full Height PCI Blanking Blank Insert P/N: 35FNF pictureOEM Dell Sound Bar Power Supply Hon-Kwang Model D12-1500-950 12VDC 1500mA
$9.24
OEM Dell Sound Bar Power Supply Hon-Kwang Model D12-1500-950 12VDC 1500mA pictureGenuine OEM Dell Latitude 2100 2120 Motherboard NR 0F593P
$19.95
Genuine OEM Dell Latitude 2100 2120 Motherboard NR 0F593P picture






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