BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-19-2009, 07:08 AM   #41
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

Please Login to Remove!

Quote:
Originally Posted by joshi.rajnikant@gmail.com View Post
can you please tell me what is this soapaction in this case.
Ok, here is one thought.
If you look into wsdl file you'll find tag 'soap:operation' with property 'soapAction'.
Basically, it's targetNamespace+'function name'.
Unfortunatly, in my case this did not help either, - I keep on getting this error:
org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT Not authorized...
which is different from the one without soapAction:
org.xmlpull.v1.XmlPullParserException: attr value delimiter missing! (position:START_TAG <html dir='null'>

...
P.S. This is about preverification. In addition to what was said
you have to put jar.exe and jli.dll into the "...\BlackBerry JDE 4.7.0\bin\" folder.

Last edited by koic; 06-19-2009 at 08:39 AM..
Offline  
Old 06-19-2009, 10:42 AM   #42
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

OK,
this thing works now.
Example is extremly simple 'though.
Service (ServiceHello.asmx.cs):
PHP Code:
xxx91;WebMethodxxx93;
public 
string HelloWorld()
{
       return 
"HelloWorld!";

Method to use it BlackBerry:
PHP Code:
String serviceNamespace "http://tempuri.org/";
String serviceAsmx "ServiceHello.asmx";
String serviceURL serviceNamespace serviceAsmx;
String serviceMethod "HelloWorld";
String soapAction serviceNamespace serviceMethod;
                            
HttpTransport ht = new HttpTransport(serviceURL);
ht.debug true;
                                
SoapObject request = new SoapObject(serviceNamespaceserviceMethod);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut request;
                        
ht.call(soapActionenvelope);
                                
String getRsp envelope.getResponse().toString(); 
Important things were (IMHO):
1. Use asmx file instead of wsdl in HttpTransport call.
Maybe because that was MS Web service (?)
2. To set soapAction.
3. Direct use of toString() instead of
PHP Code:
SoapObject result = (SoapObject)envelope.getResponse();
String getResp result.toString(); 
which caused (for me) that ClassCastException.

Last edited by koic; 06-19-2009 at 10:45 AM..
Offline  
Old 06-19-2009, 01:15 PM   #43
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

P.S. To be able to pass parameters to (ASP.NET) web service this line must be added:
PHP Code:
envelope.dotNet true
Offline  
Old 06-20-2009, 08:03 AM   #44
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

P.S.S. More notes related to KSoap2 usage.
1. Don't know how it is in Eclipse and others but with JDE (4.7)
I have to 'refresh' simulator as often as possible.
Otherwise that notorious error (XmlPullParserException: unexpected type) will be your best friend ,
even if you use soapAction and all this stuff I mentioned above.
To do this go File -> 'Erase simulator file' and then click all 3 of them. It does help!
2. Found this example very educational :
SourceForge.net: ksoap2 » Stadiums at the World Cup Example
Offline  
Old 06-23-2009, 12:19 PM   #45
isantos
New Member
 
Join Date: Jun 2009
Location: Pachuca | Hidalgo | Mexico
Model: 8200
PIN: N/A
Carrier: Iusacell
Posts: 7
Default

hi...
I can connect to the webservice in my midlet, but to pass it on to the bb, I get a message saying that the application wants to connect to the internet ...
someone knows how to make this stop that message? apparently must be assigned permissions to the midlet .. but do not be like this :( :(
can someone help me?
thanks ..

PS: sorry for my English [google translation of Spanish-English: D]

in spanish :D:D
ya logre conectarme al webservice en mi midlet, pero al pasarlo a la bb me aparece un mensaje que dice que la aplicacion quiere conectarse a internet...
alguien sabe como hacer para que no aparezca ese mensaje??? al parecer hay que asignarle permisos al midlet.. pero no se como hacer eso :(:(
alguien puede ayudarme???
gracias..
Offline  
Old 08-12-2009, 11:26 PM   #46
nirmalsat
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Default

i am using the proper version of eclipse and like many people who have posted - i too am not able to see this- " Blackberry Project dependencies Tag".. Please help
Offline  
Old 11-19-2009, 05:00 AM   #47
monad.gon@gmail.com
New Member
 
Join Date: Nov 2009
Model: 9000
PIN: N/A
Carrier: DOCOMO
Posts: 3
Default to work the Ksoap in your BlackBerry project

Environment
-Eclipse Platform Version: 3.4.1, Build id: M20080911-1700
-BlackBerry JDE Componet Package 4.5.0

To work your Ksoap in BlackBerry.

1. download the ksaopXXX.jar file from here.
sourceforge.net/projects/ksoap2/
- you can download ksoap2-j2me-core-2.1.2.jar, 2009/11/19
- you can also rename the file
- if you want to use the attached file-Ksoap2.jar.txt-,please rename to Ksoap2.jar

2. save the jar file

3. in your eclipse, set the build path to your project.
your project -> Properties > Java Build Path > Libraries > Add External JARs
select the saved jar file
4. in your eclipse, set the jar file as an Export
Java Build Path > Order and Export
Just check in your ksoap jar file.

Good Luck!
Offline  
Old 11-19-2009, 05:02 AM   #48
monad.gon@gmail.com
New Member
 
Join Date: Nov 2009
Model: 9000
PIN: N/A
Carrier: DOCOMO
Posts: 3
Default to work the Ksoap in your BlackBerry project 2

There are images to set build path in your eclipse project.
images are related to #47.
Attached Images
File Type: jpg 001AddExternalJARs.jpg (42.9 KB, 194 views)
File Type: jpg 002ExportTheJar.jpg (48.4 KB, 166 views)

Last edited by monad.gon@gmail.com; 11-19-2009 at 05:03 AM..
Offline  
Old 12-08-2009, 07:43 PM   #49
devon_fritz
New Member
 
Join Date: Dec 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 1
Default

If you use the soap jar file, but want to distribute your app on App World, what do you do? I believe App World only lets you submit COD files.
Offline  
Old 12-18-2009, 12:28 AM   #50
anilarkay
New Member
 
Join Date: Nov 2009
Model: 8900
PIN: N/A
Carrier: Airtel
Posts: 5
Unhappy Stuck on SOAP Application for BlackBerry

Hi All, I've successfully created a standalone java version of a SOAP communication class to enable Web Services data delegation.

But when I try to port to Blackberry device software, I'm having trouble.

1. I cannot find the correct replacement for H**pURLConnection class in Blackberry.

We need to use doOutput=true, so we can output the request/response to the Writer object through the stream.

right now, my coding goes like this:
==========================================
URL u = new URL(server);
URLConnection uc = u.openConnection();
H**pURLConnection connection = (H**pURLConnection) uc;
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("SOAPAction", SOAP_ACTION);
OutputStream out = connection.getOutputStream();
Writer wout = new OutputStreamWriter(out);
wout.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");

..................XML CODE HERE.................

wout.flush();
wout.close();

InputStream in = connection.getInputStream();
int c;
s="";
while ((c = in.read()) != -1)
{
//read and store the response as an XML String
}
in.close();

Can someone please look into this and suggest a solution with H**pTransport than using the H**pURLConnection? with H**pURLConnection, I am sending the SOAP request as an XML and getting the request as an XML. How can I do this with H**pTransport in KSOAPDemo version of the same, so I can get a simple SOAP Client working on blackberry device?
Offline  
Old 03-14-2010, 06:04 AM   #51
amramrhh
New Member
 
Join Date: Mar 2010
Model: 7100
PIN: N/A
Carrier: SA
Posts: 2
Angry Please i need help

has any one solve error expected: START_TAG
my web service over server need windows credential????
Offline  
Old 03-16-2010, 05:08 AM   #52
niranjanvesikar
New Member
 
Join Date: Mar 2010
Model: 9550
PIN: N/A
Carrier: software engineer
Posts: 1
Default Problem in Ksoap

hey I mUsing ksoap2-j2me-core-prev-2.1.2.jar file in BB jde 5.0.0 it give me problem that SoapObject is null what should I do

can anybody help me please

Last edited by niranjanvesikar; 03-16-2010 at 05:10 AM..
Offline  
Old 03-17-2010, 08:59 AM   #53
roshanthecho
New Member
 
Join Date: Mar 2010
Model: 8330
PIN: N/A
Carrier: sprint
Posts: 5
Default

I am trying to call my local web service (h**p://localhost:2715/Service1.asmx) created in .NET from BB application. I am using Eclipse 3.4.1 version. I have created library project and added the reference to the main project. While running in BB Simulator, it doesnot show any error message and also doesnot give the result of Web Method call.
While debugging, after displaying HelloWorld text and Service call button, it says "Source not found" with "Class File Editor" title and it also has a button "Change Attached Source...". What was the error? Please someone help me.

Here is my test code.

package com.fcs.sample;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope ;
import org.ksoap2.transport.HttpTransport;
import org.xmlpull.v1.XmlPullParserException;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;

public class MyWebServiceTest extends UiApplication {
public static void main(String[] args) {
MyWebServiceTest theApp = new MyWebServiceTest();
theApp.enterEventDispatcher();
}

public MyWebServiceTest() {
pushScreen(new HelloWorldScreen());
}
}

final class HelloWorldScreen extends MainScreen {
private RichTextField textField;
private ButtonField srvButton = new ButtonField("Service Call");

public HelloWorldScreen() {
super();
System.out.println("Adding text");
LabelField title = new LabelField("HelloWorld Sample",
LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle(title);
textField = new RichTextField("Hello World!");
add(textField);
System.out.println("Added text");

srvButton.setChangeListener(listenerSrvButton);
add(srvButton);

}

FieldChangeListener listenerSrvButton = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
String serviceUrl = "h**p://localhost:2715/Service1.asmx";
String serviceNamespace = "h**p://tempuri.org/";
String soapAction = "h**p://tempuri.org/HelloWorld";
String serviceMethod = "HelloWorld";

HttpTransport ht = new HttpTransport(serviceUrl);
ht.debug = true;
ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

SoapObject rpc = new SoapObject(serviceNamespace, serviceMethod);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);

// envelope.setOutputSoapObject(rpc);

System.out.println("Created envelope");
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
/*
* envelope.encodingStyle = SoapSerializationEnvelope.ENC;
* envelope.encodingStyle = SoapSerializationEnvelope.XSI;
*/

// rpc.addProperty("Celsius", "12");
String result = "";
try {

ht.call(soapAction, envelope);
result = (envelope.getResponse()).toString();
System.out.println(result);// for debugging
net.rim.device.api.ui.component.Dialog.alert(envel ope
.getResponse().toString());

} catch (XmlPullParserException ex) {
String msg = ex.toString();
System.out.println(msg);
} catch (Exception ex) {
System.out.println("i am here in catch");
System.out.println(ex.getMessage());
// String msg = ex.toString();

}
textField.setText(result);
// ((HelloWorldScreen)this.getActiveScreen()).setScre enTest(result);
}
};

/*
* public void setScreenTest(String text) { textField.setText(text); }
*/

public boolean onClose() {
Dialog.alert("Goodbye!");
System.exit(0);
return true;
}
}
Offline  
Old 03-23-2010, 08:15 AM   #54
brooza
New Member
 
Join Date: Aug 2008
Model: 7100T
PIN: N/A
Carrier: no idea
Posts: 8
Default Ksoap2 tutorial with Eclipse plugin 1.1

Hi, has anyone tried the tutorial with BlackBerry Java Plug-in for Eclipse v1.1? I have Eclipse 3.5 and the 1.1. plugin with component pack 4.5?

Here is what I did:
1) New - Other - BlackBerry project - called Ksoap2, JRE: BB JRE 4.5 - Finish
2) In BB app descriptor window I have changed app type to Library and saved
3) right click on project - New - Folder - called lib
4) right click on folder - import - filesystem - jar provided in this tutorial
5) right click on project - properties - java build path: a) tab source - add folder - check Ksoap2/lib b) tab Libraries - add jars.. - Ksoap2/lib/the jar file c) tab Order and Export - check the jar file ok

And now the testing project:
1) New - Other - BlackBerry project - called Ksoap2Test, JRE: BB JRE 4.5 - Finish
2) right click on Ksoap2Test - properties - Java build path: a) tab Projects - check Ksoap2 b) tab Libraries - add Ksoap2/bin/the jar file c) tab Order and export - check the jar and project Ksoap2
3) right click on KsoapTest - new - class: called Ksoap2Demo, package mypackage - Finish
4) Copy the source code of java file provided in tutorial, change the mistakes in name of classes (StockQuoteDemo>Ksoap2Demo and StockQuoteScreen>Ksoap2DemoScreen), check the package and save
5) Run - Run as - BB simulator


Until running the project, everything seems to be fine but unfortunatelly the app doesnt run, just simulator without the app. In eclipse console I have found this:
Packaging project Ksoap2
C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack4. 5.0_4.5.0.21\components\bin\rapc.exe -quiet library=deliverables\4.5.0\Ksoap2 deliverables\4.5.0\Ksoap2.rapc -sourceroot=C:\Users\JB.s4u\workspace\Ksoap2\src;C: \Users\JB.s4u\workspace\Ksoap2\lib;C:\Users\JB.s4u \workspace\Ksoap2\res -import=C:\Program Files\eclipse\plugins\net.rim.ejde.componentpack4. 5.0_4.5.0.21\components\lib\net_rim_api.jar;C:\Use rs\JB.s4u\workspace\Ksoap2\lib\ksoap2-j2me-core-prev-2.1.2.jar C:\Users\JB.s4u\workspace\Ksoap2\bin
JAR file creation failed with error -1
The preverified classes if any are in tmp8965. See jar log of errors in C:\Users\JB.s4u\AppData\Local\Temp\rapc_191cb4a2.d ir\jarlog.txt
Error!: Error: preverifier failed: C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack4. 5.0_4.5.0.21\components\bin\preverify.ex ...
Packaging project Ksoap2 failed (took 0.464 seconds)

Packaging project Ksoap2Test
C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack4. 5.0_4.5.0.21\components\bin\rapc.exe -quiet codename=deliverables\4.5.0\Ksoap2Test deliverables\4.5.0\Ksoap2Test.rapc -sourceroot=C:\Users\JB.s4u\workspace\Ksoap2Test\sr c;C:\Users\JB.s4u\workspace\Ksoap2Test\res -import=C:\Program Files\eclipse\plugins\net.rim.ejde.componentpack4. 5.0_4.5.0.21\components\lib\net_rim_api.jar;C:\Use rs\JB.s4u\workspace\Ksoap2\bin\ksoap2-j2me-core-prev-2.1.2.jar;..\Ksoap2\deliverables\4.5.0\Ksoap2.jar C:\Users\JB.s4u\workspace\Ksoap2Test\bin
I/O Error: Import file not found: ..\Ksoap2\deliverables\4.5.0\Ksoap2.jar
Packaging project Ksoap2Test failed (took 0.967 seconds)


I do not understand what does the error report say. Could anyone give me a tip where the problem might be or can you try my steps to resolve if this is general or just my configuration problem.
Thank you very much.
Offline  
Old 04-29-2010, 01:24 AM   #55
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default Ksoap Configuration

Hi,

- I am downloaded files from first posted links. but ksoap.jar not contain.
- How to integrate ksoap.jar.
- Please help anybody.

Thanks.
Offline  
Old 04-30-2010, 02:24 AM   #56
baskar
Knows Where the Search Button Is
 
Join Date: May 2009
Model: 8800
PIN: N/A
Carrier: NOT SURE
Posts: 33
Default

Hi,

Please help any one for ksoap.
i have one error
-data handling errorSoapFault - faultcode: 'soap:Client' faultstring: 'Server did not recognize the value of HTTP Header SOAPAction: VerifyUser.'
faultactor: 'null' detail: org.kxml2.kdom.Node@1b731777

Thanks.
Offline  
Old 05-21-2010, 05:54 AM   #57
aka47
New Member
 
Join Date: May 2010
Model: 8320
PIN: N/A
Carrier: JDE 4.3
Posts: 4
Default

im having foolowing exception: XML PARSER EXCEPTION
Offline  
Old 05-25-2010, 12:06 AM   #58
aka47
New Member
 
Join Date: May 2010
Model: 8320
PIN: N/A
Carrier: JDE 4.3
Posts: 4
Default

XML PARSER EXCEPTION

Can AnyBody help?
Offline  
Old 06-29-2010, 04:54 AM   #59
swati
New Member
 
Join Date: Jun 2010
Model: 8520
PIN: N/A
Carrier: mail
Posts: 2
Default

1) Is it compultion to start MDS when we consume web service in eclipse BB and run it???( because my MDS is not working it open and closed automaticaly)

2) When i try to run below code in eclipse and when i put pointer on liabrary code then it gives error "source is not attached n javadoc" and some datagram error
Offline  
Old 08-17-2010, 12:12 AM   #60
Ruchijain
New Member
 
Join Date: Jul 2010
Model: 8900
PIN: N/A
Carrier: developer
Posts: 3
Default Re:XML pull parser exception

I encountered the same problem
but after correcting the port number of tomcat server,my problem was resolved so check the port number in use of tomcat in wsdl of ksoap web service and in your blackberry code
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Crystal Dental Digital RVG Intra Oral Water Resistant Sensor Size 1 picture

Crystal Dental Digital RVG Intra Oral Water Resistant Sensor Size 1

$2564.99



Quartz Single Crystal Wafers AT cut. Double sided polished. picture

Quartz Single Crystal Wafers AT cut. Double sided polished.

$8.95



Dental Glass Quartz Fiber Post Root Canal Pin Straight Screw Restorative 1.0-1.8 picture

Dental Glass Quartz Fiber Post Root Canal Pin Straight Screw Restorative 1.0-1.8

$256.61



Yabangbang USA Dental Fiber Post Resin Screw Thread Quartz & Drills 4 Type Color picture

Yabangbang USA Dental Fiber Post Resin Screw Thread Quartz & Drills 4 Type Color

$316.63



Dental Fiber Post Resin Screw Thread Quartz Drills Yellow/Red USPS CEFDA picture

Dental Fiber Post Resin Screw Thread Quartz Drills Yellow/Red USPS CEFDA

$439.13



Dental Endo Quartz Fiber Post Root Canal Pins 1.0 1.2 1.4 1.6mm Straight Posts picture

Dental Endo Quartz Fiber Post Root Canal Pins 1.0 1.2 1.4 1.6mm Straight Posts

$256.61







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