|
|
|
10-22-2008, 09:31 AM
|
#1
|
Knows Where the Search Button Is
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
|
**** BlackBerry and Ksoap2 Tutorial *****
Please Login to Remove!
I was very, very sick trying to make work the ksoap2's libraries at a BlackBerry app and now I get it, Im gonna make a tutorial for all the people at the forum that have the same problem I had.
Ive used Eclipse and the Blackberry JDE plugin.
First of all, download the ksoap2 library preverified. I've uploaded it in this post.
Then, follow the steps:
- Create a Blackberry library project in your workspace, Ksoap2. (Create a new project->Right click->Project Properties-> Blackberry Project Properties-> Application->Project type->Library
- Create a folder called "lib" at this new library project.
- Copy the ksoap2 preverified at this post to the lib folder. Right click at Eclipse and select "Add to build path".
- Right click on the project->Add file to Blackberry Project-> Select the ksoap2 jar from the "lib" folder.
Now, into your project, in which you wanna use ksoap, do the next:
- Right click on the project -> Properties -> Java Build Path -> Libraries -> Add Jars... select Ksoap2.jar (Project's jar NOT LIBRARY JAR).. ->Ok
- Right click on the project -> Properties -> BlackBerry Project Dependencies -> Select "Ksoap2".
WARNING!!
Sometimes when you add a new library or change something in the build path, you must repeat the last step, because this checkbox get unchecked.
Now, you're ready to write your code.
I've uploaded a simple code sample calling a web service.
I hope this could be useful.
Change: I've re-uploaded the file, because it looks like be corrupted.
Last edited by sickned; 11-19-2008 at 11:06 AM..
|
Offline
|
|
10-22-2008, 06:13 PM
|
#2
|
New Member
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: TELCEL
Posts: 11
|
Quote:
Originally Posted by sickned
I was very, very sick trying to make work the ksoap2's libraries at a BlackBerry app and now I get it, Im gonna make a tutorial for all the people at the forum that have the same problem I had.
Ive used Eclipse and the Blackberry JDE plugin.
First of all, download the ksoap2 library preverified. I've uploaded it in this post.
Then, follow the steps:
- Create a Blackberry library project in your workspace, Ksoap2.
- Create a folder called "lib" at this new library project.
- Copy the ksoap2 preverified to this post. Right click at Eclipse and select "Add to build path".
Now, into your project, in which you wanna use ksoap, do the next:
- Right click on the project -> Properties -> Java Build Path -> Libraries -> Add Jars... select Ksoap2.jar. ->Ok
- Right click on the project -> Properties -> BlackBerry Project Dependencies -> Select "Ksoap2".
WARNING!!
Sometimes when you add a new library or change something in the build path, you must repeat the last step, because this checkbox get unchecked.
Now, you're ready to write your code.
I've uploaded a simple code sample calling a web service.
I hope this could be useful.
|
Great Example, just what I needed and I think many people need right now!
Thanks for your contribution
|
Offline
|
|
10-27-2008, 09:07 AM
|
#3
|
New Member
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: telefonica
Posts: 4
|
can't see the tag BB project dependencies
i followed the instructions, but i can't see the tag BlackBerry Project Dependencies. I'm using eclipse 3.4, jde 4.6 and your ksoap2 library.
Pls Help :(
|
Offline
|
|
11-13-2008, 10:59 PM
|
#4
|
New Member
Join Date: Feb 2008
Model: 8703e
PIN: N/A
Carrier: Rogers
Posts: 5
|
great jobs!
|
Offline
|
|
11-19-2008, 04:33 AM
|
#5
|
Thumbs Must Hurt
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: Globe
Posts: 52
|
Hi,
I'm using ksoap2 library and i want to use the class HttpTransportBasicAuth.
I understand that this class is not included in the preverified core ksoap2 library provided above.
It is in a separate file called ksoap-extras-2.1.2.jar or something like that, that i downloaded from sourceforge.net
I want to use this class in order to authenticate the user trying to access the web service by providing a username and password. I tried to verify this library but it always fails.
Can somebody help me on what i should do? Please help!
Thanks,
Jaclyn
|
Offline
|
|
11-19-2008, 11:01 AM
|
#6
|
Knows Where the Search Button Is
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
|
Quote:
Originally Posted by jacytan
Hi,
I'm using ksoap2 library and i want to use the class HttpTransportBasicAuth.
I understand that this class is not included in the preverified core ksoap2 library provided above.
It is in a separate file called ksoap-extras-2.1.2.jar or something like that, that i downloaded from sourceforge.net
I want to use this class in order to authenticate the user trying to access the web service by providing a username and password. I tried to verify this library but it always fails.
Can somebody help me on what i should do? Please help!
Thanks,
Jaclyn
|
Just open the JAR I posted with WinRar and add the HttpTransportBasicAuth.class on the right package. It worked for me!
Last edited by sickned; 11-19-2008 at 11:06 AM..
|
Offline
|
|
11-22-2008, 12:40 AM
|
#7
|
Thumbs Must Hurt
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: Globe
Posts: 52
|
Quote:
Originally Posted by sickned
Just open the JAR I posted with WinRar and add the HttpTransportBasicAuth.class on the right package. It worked for me!
|
Thanks so much for the reply! it really helped!
I was able to run my application already!
|
Offline
|
|
11-25-2008, 05:31 PM
|
#8
|
New Member
Join Date: Nov 2008
Model: 8800
PIN: N/A
Carrier: att
Posts: 4
|
Still no luck
First of all, thanks for the tutorial and it gives us a starting point. I have been looking at this for a week now and I still can not get it to work. I can not see "Blackberry project dependencies" and "Add file to project" options. Am I doing something wrong?
Quote:
Originally Posted by sickned
I was very, very sick trying to make work the ksoap2's libraries at a BlackBerry app and now I get it, Im gonna make a tutorial for all the people at the forum that have the same problem I had.
Ive used Eclipse and the Blackberry JDE plugin.
First of all, download the ksoap2 library preverified. I've uploaded it in this post.
Then, follow the steps:
- Create a Blackberry library project in your workspace, Ksoap2. (Create a new project->Right click->Project Properties-> Blackberry Project Properties-> Application->Project type->Library
- Create a folder called "lib" at this new library project.
- Copy the ksoap2 preverified at this post to the lib folder. Right click at Eclipse and select "Add to build path".
- Right click on the project->Add file to Blackberry Project-> Select the ksoap2 jar from the "lib" folder.
Now, into your project, in which you wanna use ksoap, do the next:
- Right click on the project -> Properties -> Java Build Path -> Libraries -> Add Jars... select Ksoap2.jar (Project's jar NOT LIBRARY JAR).. ->Ok
- Right click on the project -> Properties -> BlackBerry Project Dependencies -> Select "Ksoap2".
WARNING!!
Sometimes when you add a new library or change something in the build path, you must repeat the last step, because this checkbox get unchecked.
Now, you're ready to write your code.
I've uploaded a simple code sample calling a web service.
I hope this could be useful.
Change: I've re-uploaded the file, because it looks like be corrupted.
|
|
Offline
|
|
12-01-2008, 07:21 AM
|
#9
|
Knows Where the Search Button Is
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
|
Quote:
Originally Posted by bharath001
First of all, thanks for the tutorial and it gives us a starting point. I have been looking at this for a week now and I still can not get it to work. I can not see "Blackberry project dependencies" and "Add file to project" options. Am I doing something wrong?
|
Are you using Eclipse or JDE? This tutorial is for Eclipse, I dont know how to do some steps at JDE.
|
Offline
|
|
12-05-2008, 01:03 AM
|
#10
|
New Member
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
|
hey sorry to say m new in this using Ksoap bt i have to do a project in this .
m using ksoap jar file and eclips bt cann't do that ...the library is not supported ...
could u explain me ...previously i have wrked on banking project so m totally blank in using ksoap with blackberry IDE ....
plz give me some detail of this .....i used eclips earlier bt can't understand how to relate IDE and eclips plugin .......thanks in advance
|
Offline
|
|
12-05-2008, 01:22 AM
|
#11
|
Thumbs Must Hurt
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
|
Quote:
Originally Posted by mithleshdwivedi
m using ksoap jar file and eclips bt cann't do that ...the library is not supported ...
could u explain me ...previously i have wrked on banking project so m totally blank in using ksoap with blackberry IDE ....
plz give me some detail of this .....i used eclips earlier bt can't understand how to relate IDE and eclips plugin .......thanks in advance
|
Please confirm if the jar u are using is ksoap or ksoap2. You need to have a preverified version of ksoap2 jar file.
__________________
Smart People ask for Help!!!
|
Offline
|
|
12-05-2008, 01:38 AM
|
#12
|
New Member
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
|
hi
ksoap2-j2me-core-prev-2.1.2
sir m using ksoap2 preverified jar....kindly help
and thanks for ur post
|
Offline
|
|
12-05-2008, 01:40 AM
|
#13
|
Thumbs Must Hurt
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
|
Quote:
Originally Posted by mithleshdwivedi
ksoap2-j2me-core-prev-2.1.2
sir m using ksoap2 preverified jar....kindly help
and thanks for ur post
|
I have sent you an email with the basic environment configuration steps ..let me know if you need further assistance.
__________________
Smart People ask for Help!!!
Last edited by baran_khan; 12-05-2008 at 01:54 AM..
|
Offline
|
|
12-05-2008, 02:05 AM
|
#14
|
New Member
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
|
hi
thanku sir yes m working in qbit systems in jaipur ...
m reading the link provided by u ..thanks once again sir
|
Offline
|
|
12-05-2008, 05:36 AM
|
#15
|
New Member
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: Smart
Posts: 14
|
KSOAP problem
i had tried KSOAP2 to run on a Blackberry JDE4.6 but it didnt work fine for me,
i have this code:
SoapObject myObject = new SoapObject("http:--ws.test.net", "stringConcat");
HttpTransport transport = new HttpTransport("http:--localhost: 8080-BlackberryWS-BlackberryService");
myObject.addProperty("fname", "my");
myObject.addProperty("lname", "test");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(myObject);
transport.debug = true;
transport.call("stringConcat", envelope);
String data = envelope.getResponse().toString();
but
DataGramProtocol(ConnectionBase).recieve(DataGram) Source not found problem pops up upon Debug. and as i look at the variables this._connectionHandlerName = "httpc"
and this._name = //localhost:8080/BlackberryWS/BlackberryService;ConnectionHandler=httpc
but with KSOAP2 SE:
the code works fine changing
HttpTransport transport = new HttpTransport("http:--localhost: 8080/ BlackberryWS/ BlackberryService");
to
HttpTransportSE transport = new HttpTransportSE("http:--localhost:8080/BlackberryWS/BlackberryService");
meaning with blackberry it changes http to httpc.. how can i make it maintain in http?
can anybody help? please..
|
Offline
|
|
12-11-2008, 02:51 AM
|
#16
|
New Member
Join Date: Dec 2008
Model: 9500
PIN: N/A
Carrier: Verizon
Posts: 2
|
I am running into the same problem with not seeing "Blackberry project dependencies" under the project options. Anybody have any ideas?
|
Offline
|
|
12-11-2008, 04:17 AM
|
#17
|
Thumbs Must Hurt
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
|
Quote:
Originally Posted by manyguns
I am running into the same problem with not seeing "Blackberry project dependencies" under the project options. Anybody have any ideas?
|
Under the blackberry Project Properties section, click on "Application" tab and change your project type to Library.
__________________
Smart People ask for Help!!!
|
Offline
|
|
12-11-2008, 09:40 AM
|
#18
|
New Member
Join Date: Dec 2008
Model: 9500
PIN: N/A
Carrier: Verizon
Posts: 2
|
Quote:
Originally Posted by baran_khan
Under the blackberry Project Properties section, click on "Application" tab and change your project type to Library.
|
I'm assuming you mean to do that for the project that I made as instructed by the tutorial and not for the actual project that shows the UI. I have done that. The problem is I do not see "Blackberry project dependencies" at all in the properties list for either of the projects. I see...
Resources
Blackberry Project Properties
Builders
Java Build Path
etc...
|
Offline
|
|
12-13-2008, 03:31 AM
|
#19
|
Thumbs Must Hurt
Join Date: Jan 2007
Location: India
Model: 8700g
Carrier: Airtel
Posts: 117
|
testing webservice on simulator
Hi All,
I have developed a client on BB using ksoap2.
I have tried using the MDS simulator along with the device simulator (as mentioned in some post), but whenever i send a request, i get the following Exception:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{http://www.w3.org/2003/05/soap-envelope}soap:Envelope>@1:205 in java.io.InputStreamReader@2bdcc2b0)
I dunno whats going wrong or how to go about it. Please help.
I am developing using the following components:
BB OS: 4.1.0
JDE: 4.1.0
ksoap2: lib\ksoap2-j2me-core-prev-2.1.2.jar
PS: I can access it through http demo application, but not through my web service. I am pasting my code below:
Code:
private String IPorHostname = "http://192.168.1.33";
private String path = "/xyzs/service.asmx";
public MXYZ_Main() {
SoapObject request = new SoapObject("http://tempuri.org/", "DealerOutstanding");
request.addProperty("dlr_code", "1177");
System.out.println(request.toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;
HttpTransport ht = new HttpTransport(IPorHostname + path);
ht.debug = true;
try {
ht.call("", envelope);
SoapObject result = (SoapObject) envelope.getResponse();
System.out.println(result.toString());
String str = result.getProperty("DealerOutstandingResult").toString();
System.out.println("Soap: " + str);
} catch (XmlPullParserException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
System.out.println("ex " + ex.toString());
}
__________________
Thanks
Meenal
Last edited by Meenal; 12-13-2008 at 04:26 AM..
|
Offline
|
|
12-13-2008, 06:35 AM
|
#20
|
Thumbs Must Hurt
Join Date: Jan 2007
Location: India
Model: 8700g
Carrier: Airtel
Posts: 117
|
Hi all,
I have solved the above problem.
__________________
Thanks
Meenal
Last edited by Meenal; 12-13-2008 at 06:44 AM..
|
Offline
|
|
|
|