BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-23-2008, 07:26 AM   #21 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please Login to Remove!

I have the same problem.

What I don't understand is that the code work fine until last Friday.

And now no.

Has anyone got an idea???
Offline  
Old 06-23-2008, 09:15 AM   #22 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 8310
PIN: N/A
Carrier: Developper
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the MDS started ?
Offline  
Old 06-23-2008, 09:19 AM   #23 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes of course.

I'm sure that the pb comes from ksoap2
Offline  
Old 07-07-2008, 01:59 AM   #24 (permalink)
New Member
 
Join Date: Jul 2008
Location: Bangalore
Model: 8800
OS: Xp
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you please help me in showing how do i access web service from Blackberry JDE using KSOAP 2 .
Offline  
Old 07-07-2008, 03:05 AM   #25 (permalink)
New Member
 
Join Date: Jul 2008
Location: Bangalore
Model: 8800
OS: Xp
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Request to help access web service using ksoap

Quote:
Originally Posted by itnwc View Post
hi, i got it work, the world is so wonderful, when i see the output, great!

Hi itnwc,
How did you do it? Can you please help me too ? I need to access web services from JDE using ksoap . Can you please show me how ? Can you send a sample as well ?
Offline  
Old 07-07-2008, 03:48 AM   #26 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
//I create the transport
transport = new HttpTransport("UrlWS");
transport.debug = true;

//Object I want to send                
SoapObject myObject = new SoapObject("namespace", "name");
myObject.addProperty("double",new SoapPrimitive( "http://www.w3.org/2001/XMLSchema","double","3.16542)));
myObject.addProperty("string", "test"));

//Envelope for serialization
SoapSerializationEnvelope envelope = new  SoapSerializationEnvelope(SoapEnvelope.VER11);

//Add the object to the enveloppe               
envelope.setOutputSoapObject(myObject);         

//Execute the transport with the envelope                
transport.call("fonction",envelope);

//Recover the response
Object obj = envelope.getResponse();
Hope it's helpfull

Last edited by goulamass : 07-07-2008 at 03:51 AM.
Offline  
Old 10-21-2008, 11:52 PM   #27 (permalink)
New Member
 
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: Claro
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation impossible to connect to web service using ksoap and jsr 172

Hello everybody!

I am using Netbeans 6.1 IDE with JDE 4.6 platform integrated. I have developed a J2ME MIDP application to connect to web service using jsr 172 specification and i had success. The same success using ksoap 1.2. In those cases using Sun Java Wireless Toolkit simulator.

The problem is when I try the same application in BlackBerry 9000 Bold simulator. I obviously changed the code.

It never connect to web service neither using jsr 172 or ksoap.

The exception in both cases is: "Local connection timed out after ~ 120000"

Somebody have any idea what is happend?. Did I forget do any else configuration?

thanks in advance

jcsa
Offline  
Old 10-22-2008, 12:52 AM   #28 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jcsa View Post
Hello everybody!

I am using Netbeans 6.1 IDE with JDE 4.6 platform integrated. I have developed a J2ME MIDP application to connect to web service using jsr 172 specification and i had success. The same success using ksoap 1.2. In those cases using Sun Java Wireless Toolkit simulator.

The problem is when I try the same application in BlackBerry 9000 Bold simulator. I obviously changed the code.

It never connect to web service neither using jsr 172 or ksoap.

The exception in both cases is: "Local connection timed out after ~ 120000"

Somebody have any idea what is happend?. Did I forget do any else configuration?

thanks in advance

jcsa

Check the connectivity, if simulator you are using has a browser try to load one of your favourite web pages like your local newspaper.

With kSoap I get "Local connection timed out after ~ 120000" from network problems or incorrect URLs.

The simulator I use has no internet connectivity (and I could not get the MDS Studio to work) so I debug on the actual Blackberry.


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-22-2008, 10:33 AM   #29 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

**** BlackBerry and Ksoap2 Tutorial *****
Offline  
Old 10-22-2008, 10:35 AM   #30 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

repeat post.
Offline  
Old 10-24-2008, 12:06 AM   #31 (permalink)
New Member
 
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: Claro
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation

to RR or everybody,
I see the connections available in my simulator: mobile network and wi-fi, and those are simulated like "In coverage". Anyway I cotinue having the same exception "Local connection timed out after ~ 120000". in my blackberry application. I post my code. Please somebody to give me an advice.
===========================================
package org.ts.sl.wsclient;

import java.io.IOException;
import java.util.Date;

import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.Menu;
import net.rim.device.api.ui.container.MainScreen;

import org.ksoap.ClassMap;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;

import org.ts.sl.entity.SystemAlert;

/**
* @author jcsa
*/
public class AlertClient extends UiApplication {

public static void main(String[] args){
AlertClient app = new AlertClient();
app.enterEventDispatcher();
}

public AlertClient(){
pushScreen(new MainInfoScreen());
doSoap();
}

final class MainInfoScreen extends MainScreen{

public MainInfoScreen(){
super();
LabelField titulo = new LabelField("Prueba de cliente WS en BlackBerry"
,LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle(titulo);
EditField ef = new EditField("Aler: ", "");

}

public boolean onClose(){
Dialog.alert("Bye!!");
System.exit(0);
return true;
}

private MenuItem _closeItem = new MenuItem("Cerrar aplicacion", 200000, 10){
public void run() {
onClose();
}
};

//sobreescribir makeMenu
protected void makeMenu(Menu menu, int instance){
menu.add(_closeItem);
}

}

public void doSoap(){
try{
String serviceUrl = "h t t p : / / localhost : 8085 / kSoapWS / AlertServlet";
ClassMap classMap = new ClassMap();
classMap.addMapping("org.teamsoft.sicel.entidad", "SystemAlert", new SystemAlert().getClass() );
SoapObject request = new SoapObject("urn : xmethods-AlertService", "getNextSystemAlert" );

HttpTransport tx = new HttpTransport(serviceUrl + "?service=AlertService", "urn : xmethods-AlertService");
tx.setClassMap( classMap );
tx.debug = true;

SystemAlert nextAlert = (SystemAlert) tx.call(request);
System.out.println( tx.responseDump );
System.out.println(nextAlert.getMessage() + " \nat " + new Date(nextAlert.getTimeStamp()));

}catch(IOException ioe){
ioe.printStackTrace();
}
}
}
===========================================

The data Class:
===========================================
package org.ts.sl.entity;

import org.kobjects.serialization.PropertyInfo;
import org.kobjects.serialization.ElementType;


public class SystemAlert implements org.kobjects.serialization.KvmSerializable {

private long timeStamp = -1;
private String message = null;

/*
* Used by KSOAP Implementation methods
*/
private static int PROP_COUNT = 2;
private static PropertyInfo PI_timeStamp = new PropertyInfo("timeStamp",ElementType.LONG_CLASS);
private static PropertyInfo PI_message = new PropertyInfo("message",ElementType.STRING_CLASS);
private static PropertyInfo[] PI_PROP_ARRAY = {PI_timeStamp,PI_message};

public SystemAlert() {
}

public java.lang.String getMessage() {
return message;
}

public void setMessage(java.lang.String message) {
this.message = message;
}

public long getTimeStamp() {
return timeStamp;
}

public void setTimeStamp(long timeStamp) {
this.timeStamp = timeStamp;
}

/*
* Implementation Logic for KSOAP
*/
public Object getProperty(int param) {
if ( param == 0 ) {
return new Long(getTimeStamp());
} else if ( param == 1 ) {
return getMessage();
} else {
return null;
}
}

public void setProperty(int param, Object obj) {
if ( param == 0 ) {
long l = ((Long) obj).longValue();
setTimeStamp( l );
} else if ( param == 1 ) {
setMessage( (String) obj );
} else {

}
}

public int getPropertyCount() {
return PI_PROP_ARRAY.length;
}

public void getPropertyInfo(int param, org.kobjects.serialization.PropertyInfo propertyInfo) {
propertyInfo.name = PI_PROP_ARRAY[param].name;
propertyInfo.nonpermanent = PI_PROP_ARRAY[param].nonpermanent;
propertyInfo.copy(PI_PROP_ARRAY[param]);
}
}
===========================================

This code in a MIDLET version had success, but in BlackBerry dont.
Any idea?

Thanks in advance!

jcsa
Offline  
Old 10-24-2008, 03:58 AM   #32 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is your MDS running???

Because the error you got means that the simulator is waiting for a connexion.

To check a web connexion try to navigate on the web with your simulator
Offline  
Old 11-24-2008, 04:54 AM   #33 (permalink)
New Member
 
Join Date: Nov 2008
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Parsing Exception

hi frndz

i am parsing my xml file by kxml package.
it is working fine in j2me but with BB it throws exception
"unexpected parseevent type=128
text=not authorized to access localhost:80@ -1:1"


please help me to solve this problem
Offline  
Old 11-24-2008, 06:40 AM   #34 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ajay_kumar View Post
hi frndz

i am parsing my xml file by kxml package.
it is working fine in j2me but with BB it throws exception
"unexpected parseevent type=128
text=not authorized to access localhost:80@ -1:1"


please help me to solve this problem
Hello Ajay,

You might find it strange, but try replacing the localhost with the current IP you have of ur sytem. I am sure that won't be 127.0.0.1 as you are connected to network, try it, it worked for me while communicating with a web service once.
__________________
Smart People ask for Help!!!
Offline  
Old 12-15-2008, 05:39 AM   #35 (permalink)
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default request

sir will u do me a favour i m also struggling with blackberry JDE with eclips and wants to use ksoap bt donn't know how to use iit ...
could u tell me the nessecessay steps ..ie compltee details of the steps .

thanks in advance

mithlesh dwivedi
Offline  
Old 12-17-2008, 06:51 AM   #36 (permalink)
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question struggling with same problem budy

}
================================================
my output is
i am here 1
i am here 2
i am here in catch
No stack trace
Can anyone solve thsi ...plz
Offline  
Old 12-17-2008, 07:00 AM   #37 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

where is the code...i can't see anything
__________________
Smart People ask for Help!!!
Offline  
Old 12-17-2008, 07:00 AM   #38 (permalink)
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post error comming----

HttpTransport ht = new HttpTransport ("url");
ht.debug = true;
System.out.println("i am here 2");
ht.call("test/HelloWorld",envelope);
System.out.println("i am here 3");
System.out.println("ok:" + envelope.toString());
System.out.println("Result of BB:" + envelope.getResult());

}

catch (Exception e)
{
System.out.println("i am here in catch");
e.printStackTrace ();

}
}
}
================================================
my output is

i am here 1
i am here 2


i am here in catch
No stack trace

what should do.plz reply the answer.thanks in advance
Offline  
Old 12-17-2008, 07:02 AM   #39 (permalink)
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

after call it goes to catch and
same exception is thrown
"No stack trace "

wht can i do ....


thanks
mithlesh dwivedi
Offline  
Old 12-17-2008, 07:06 AM   #40 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mithleshdwivedi View Post
HttpTransport ht = new HttpTransport ("url");
ht.debug = true;
System.out.println("i am here 2");
ht.call("test/HelloWorld",envelope);
System.out.println("i am here 3");
System.out.println("ok:" + envelope.toString());
System.out.println("Result of BB:" + envelope.getResult());

}

catch (Exception e)
{
System.out.println("i am here in catch");
e.printStackTrace ();

}
}
}
================================================
my output is

i am here 1
i am here 2


i am here in catch
No stack trace

what should do.plz reply the answer.thanks in advance

ht.call("test/HelloWorld",envelope);

Please verify your soapAction
__________________
Smart People ask for Help!!!
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





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