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

high voltage 450 amp fuses
$425.0
high voltage 450 amp fuses pictureDAYTON 2ZWR9 PUMP CENTRIFUGAL , 1 HP , 1 Phase, 115/230 Voltage , BRONZE & BRASS
$358.95
DAYTON 2ZWR9 PUMP CENTRIFUGAL , 1 HP , 1 Phase, 115/230 Voltage , BRONZE & BRASS picture10PCS MOTOROLA MC7812CP VOLTAGE REGULATOR
$12.95
10PCS MOTOROLA MC7812CP VOLTAGE REGULATOR picture dc dc buck voltage converter, 10-75v to 0-60v 12a adjustable output numerical
$49.57
 dc dc buck voltage converter, 10-75v to 0-60v 12a adjustable output numerical picture18 16TC 3239 20KVDC High Voltage Wire 150C AWM Wall: .050 Charcoal 500+ft spool
$180.0
18 16TC 3239 20KVDC High Voltage Wire 150C AWM Wall: .050 Charcoal 500+ft spool picture






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