BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-17-2008, 07:14 AM   #41
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Default

Please Login to Remove!

Quote:
Originally Posted by mithleshdwivedi View Post
after call it goes to catch and
same exception is thrown
"No stack trace "

wht can i do ....


thanks
mithlesh dwivedi
Mithesh,

try e.getMessage() and see what you get as the exception...
__________________
Smart People ask for Help!!!
Offline  
Old 12-24-2008, 02:08 AM   #42
mithleshdwivedi
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Default Error is Cann't serialize for emailid...

hiiiiiiiiiiiiiiiii everybody i m facing a error my code is written below.....

Last edited by mithleshdwivedi; 12-24-2008 at 02:09 AM..
Offline  
Old 12-24-2008, 02:08 AM   #43
mithleshdwivedi
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Default Error is Cann't serialize for emailid...

public void obtenerArticuloSOAP(EmailAddressEditField emailid,PasswordEditField pass) {
try {

SoapObject request = new SoapObject("http//tempuri.org", "Connect");
String soapAction = "http://tempuri.org/Connect";

request.addProperty("userName", emailid);
request.addProperty("userPassword", pass);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;

HttpTransport ht = new HttpTransport("https://www.homemanageables.com/homeservices/webservice/homeservice.asmx");
ht.debug = true;
System.err.println( ht.requestDump );

ht.call(soapAction,envelope);
SoapObject result = (SoapObject)envelope.getResponse();

}
catch (XmlPullParserException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
System.out.println("ex " + ex.toString());
}
}
Offline  
Old 12-24-2008, 02:11 AM   #44
mithleshdwivedi
New Member
 
Join Date: Dec 2008
Model: 7100T
PIN: N/A
Carrier: nothing
Posts: 14
Default solve the error ...run time error cann't serialise email id

public void obtenerArticuloSOAP(EmailAddressEditField emailid,PasswordEditField pass) {
try {

SoapObject request = new SoapObject("http//tempuri.org", "Connect");
String soapAction = "http://tempuri.org/Connect";

request.addProperty("userName", emailid);
request.addProperty("userPassword", pass);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;

HttpTransport ht = new HttpTransport("https://www.homemanageables.com/homeservices/webservice/homeservice.asmx");
ht.debug = true;
System.err.println( ht.requestDump );

ht.call(soapAction,envelope);
SoapObject result = (SoapObject)envelope.getResponse();

}
catch (XmlPullParserException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
System.out.println("ex " + ex.toString());
}
}
Offline  
Old 12-26-2008, 01:12 AM   #45
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Default

Quote:
Originally Posted by mithleshdwivedi View Post
public void obtenerArticuloSOAP(EmailAddressEditField emailid,PasswordEditField pass) {
try {

SoapObject request = new SoapObject("http//tempuri.org", "Connect");
String soapAction = "http://tempuri.org/Connect";

request.addProperty("userName", emailid);
request.addProperty("userPassword", pass);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;

HttpTransport ht = new HttpTransport("https://www.homemanageables.com/homeservices/webservice/homeservice.asmx");
ht.debug = true;
System.err.println( ht.requestDump );

ht.call(soapAction,envelope);
SoapObject result = (SoapObject)envelope.getResponse();

}
catch (XmlPullParserException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
System.out.println("ex " + ex.toString());
}
}
Instead of emailID and pass I think you need to use emailId.getText() methods to capture text.

Correct me if I am wrong.
__________________
Smart People ask for Help!!!
Offline  
Old 01-08-2009, 09:45 AM   #46
kingshuk_dev
New Member
 
Join Date: Jan 2009
Model: 9500
PIN: N/A
Carrier: dont know
Posts: 1
Default netbeans 6.1 and JDE 4.7.0 and webservice

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
Hi JCSA

How did u make it possible? i am still getting errors. Let u clear about my position.........

i am using netbeans 6.1+jde 4.7.0. I have generated stubs for webservice. But each time when i build and run my project getting errors like "JAXRPCException". My WSDL working fine with other, and i have tested only in emulators 9500. So can u plz help me........ here is the code snippet ...

public String getProviderList() throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
};

Operation op = Operation.newInstance( _qname_operation_getProviderList, _type_getProviderList, _type_getProviderListResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}

return (String )((Object[])resultObj)[0];
}

i got error at bold line..........
Offline  
Old 06-23-2009, 12:19 PM   #47
isantos
New Member
 
Join Date: Jun 2009
Location: Pachuca | Hidalgo | Mexico
Model: 8200
PIN: N/A
Carrier: Iusacell
Posts: 7
Default permission for access to internet

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: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 06-23-2009, 12:29 PM   #48
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

Quote:
Originally Posted by isantos View Post
...the application wants to connect to the internet ...
It's a normal situation. Most likely you used J2ME, didn't you?
Is it a big problem to ask user to answer Yes/No?
Offline  
Old 06-23-2009, 12:41 PM   #49
isantos
New Member
 
Join Date: Jun 2009
Location: Pachuca | Hidalgo | Mexico
Model: 8200
PIN: N/A
Carrier: Iusacell
Posts: 7
Default

thnks to response...

i'm using j2me and eclipse with the plugin for bb...
you know how to remove this msg????
Offline  
Old 06-23-2009, 05:40 PM   #50
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

Well, somehow if you use Blackberry's UiApplication,
it does not ask for permission to use your air time
Offline  
Old 08-18-2009, 01:10 PM   #51
nishi1607
New Member
 
Join Date: Aug 2009
Model: 8800
PIN: N/A
Carrier: airtel
Posts: 1
Default KSoap & XML

Which one is better way to call .net WebServices?
parsing it as an XML or calling WebMethods using KSOAP.

I have added Ksoap in my project, but it is giving following err, even if I set the properties of the added files i.e Ksoap.jar,ksoap.jad,ksoap.cod as Project Dependency only...

org/kobjects/base64/Base64.class): Error!: Duplicate definition for 'org.kobjects.base64.Base64' found in: org.kobjects.base64.Base64
Error while building project

please reply fast,as I hv the deadline

Thanks in advance
Offline  
Old 09-01-2009, 03:33 PM   #52
WAP_Maniac
New Member
 
Join Date: Sep 2009
Model: 8100
PIN: N/A
Carrier: timble
Posts: 2
Smile help me with that too!

hey everettwolf can you help with the connection to a webservice and proving in my blackberry device??

Thanks!
Offline  
Old 01-12-2010, 01:18 PM   #53
cypher109
New Member
 
Join Date: Dec 2009
Model: 8900
PIN: N/A
Carrier: Claro
Posts: 1
Default My soultion to the kSoap2 Problem

People have been having difficulty when attempting to use kSoap2 library either difficulty with attaching the preverified jar or difficulty passing parameters to the web service, so here is my contribution.

Getting the library on the device
The kSoap2 jar file is hell (in my opinion) to add because the environment might not have the options stated in the menus to add the jar also it won't export the library to the phone. So i tried my best to find the source files from some different sites (including one German site) and compiled them in the order they were written but i can't post links here so you probably could email me for it.

Calling a web service that accepts parameters
I haven't really figured out why, but i know there is a problem with kSoap2 and web service parameters so i had to find a workaround. For this I had begin my code as if i was using kSoap2 all the way by setting the serviceUrl and namespace variables like so:

String serviceUrl = "h t t p : / / w w w . y o u r U r l . c o m / y o u r W e b S e r v i c e N a m e . asmx";
String serviceNamespace = "yourNamespace";
String soapAction = "yourNamespace/methodName";
SoapObject rpc = new SoapObject(serviceNamespace, "methodName");


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.encodingStyle = SoapSerializationEnvelope.ENC;


Then i had to hardcode my xml call like this:

String testBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
testBody += "<soap:Envelope xmlns:soap=\"h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / envelope/\" xmlns:xsi=\"h t t p : / / w w w . w 3 . o r g / 2 0 0 1 /XMLSchema-instance\" xmlns:xsd=\"h t t p : / / w w w . w 3 . o r g / 2 0 0 1/XMLSchema\">";
testBody += "<soap:Body>";
testBody += "<methodName xmlns=\"yourNamespace\">";
testBody += "<parameter>120007</parameter >";
testBody += "</methodName>";
testBody += "</soap:Body>";
testBody += "</soap:Envelope>";

then instead of using HttpTransport ht.call(...) method I used:

HttpConnection connection = (HttpConnection) Connector.open(serviceUrl,Connector.READ_WRITE,tru e);

connection.setRequestProperty("SOAPAction", soapAction);
connection.setRequestProperty("Content-Type", "text/xml");
connection.setRequestProperty("Content-Length","" + testBody.getBytes().length);

connection.setRequestProperty("User-Agent", "kSOAP/2.0");

connection.setRequestMethod(HttpConnection.POST);

OutputStream os = connection.openOutputStream();
os.write(testBody.getBytes(), 0, testBody.getBytes().length);
os.close();

testBody = null;

InputStream is = connection.openInputStream();

XmlPullParser xp = new KXmlParser();
xp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESP ACES, true);
xp.setInput (is, null);

envelope.parse(xp);
final String result = (envelope.getResponse()).toString();


Notice how the last two lines call the envelope back into play so that you can make use of it's xml parser, doing it this way alows you to not have to rewrite a lot of the functionality that already exists in the kSoap2 library.

Last edited by cypher109; 01-12-2010 at 01:22 PM..
Offline  
Old 05-25-2010, 12:02 AM   #54
aka47
New Member
 
Join Date: May 2010
Model: 8320
PIN: N/A
Carrier: JDE 4.3
Posts: 4
Default Xml Parser Exception

XML PARSER EXCEPTION



Can Anybody Help?
Offline  
Old 06-21-2010, 01:05 AM   #55
hassan_buttar
New Member
 
Join Date: Jun 2010
Model: 9550
PIN: N/A
Carrier: GSM
Posts: 2
Default

Helo every one.

I copy and paste all the above codes and try to run them after including ksoap jar file but it gives me Pakage verification error can any one please tell me y it is happening to me ..... i m using Eclips with blackberry plugin
Offline  
Old 11-19-2010, 01:21 AM   #56
sriyan983
New Member
 
Join Date: Nov 2010
Model: Bold
PIN: N/A
Carrier: None
Posts: 1
Thumbs up Re: My soultion to the kSoap2 Problem

Quote:
Originally Posted by cypher109 View Post
People have been having difficulty when attempting to use kSoap2 library either difficulty with attaching the preverified jar or difficulty passing parameters to the web service, so here is my contribution.

Getting the library on the device
The kSoap2 jar file is hell (in my opinion) to add because the environment might not have the options stated in the menus to add the jar also it won't export the library to the phone. So i tried my best to find the source files from some different sites (including one German site) and compiled them in the order they were written but i can't post links here so you probably could email me for it.

Calling a web service that accepts parameters
I haven't really figured out why, but i know there is a problem with kSoap2 and web service parameters so i had to find a workaround. For this I had begin my code as if i was using kSoap2 all the way by setting the serviceUrl and namespace variables like so:

String serviceUrl = "h t t p : / / w w w . y o u r U r l . c o m / y o u r W e b S e r v i c e N a m e . asmx";
String serviceNamespace = "yourNamespace";
String soapAction = "yourNamespace/methodName";
SoapObject rpc = new SoapObject(serviceNamespace, "methodName");


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.encodingStyle = SoapSerializationEnvelope.ENC;


Then i had to hardcode my xml call like this:

String testBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
testBody += "<soap:Envelope xmlns:soap=\"h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / envelope/\" xmlnssi=\"h t t p : / / w w w . w 3 . o r g / 2 0 0 1 /XMLSchema-instance\" xmlnssd=\"h t t p : / / w w w . w 3 . o r g / 2 0 0 1/XMLSchema\">";
testBody += "<soap:Body>";
testBody += "<methodName xmlns=\"yourNamespace\">";
testBody += "<parameter>120007</parameter >";
testBody += "</methodName>";
testBody += "</soap:Body>";
testBody += "</soap:Envelope>";

then instead of using HttpTransport ht.call(...) method I used:

HttpConnection connection = (HttpConnection) Connector.open(serviceUrl,Connector.READ_WRITE,tru e);

connection.setRequestProperty("SOAPAction", soapAction);
connection.setRequestProperty("Content-Type", "text/xml");
connection.setRequestProperty("Content-Length","" + testBody.getBytes().length);

connection.setRequestProperty("User-Agent", "kSOAP/2.0");

connection.setRequestMethod(HttpConnection.POST);

OutputStream os = connection.openOutputStream();
os.write(testBody.getBytes(), 0, testBody.getBytes().length);
os.close();

testBody = null;

InputStream is = connection.openInputStream();

XmlPullParser xp = new KXmlParser();
xp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESP ACES, true);
xp.setInput (is, null);

envelope.parse(xp);
final String result = (envelope.getResponse()).toString();


Notice how the last two lines call the envelope back into play so that you can make use of it's xml parser, doing it this way alows you to not have to rewrite a lot of the functionality that already exists in the kSoap2 library.
__________________________________________________ ________________
Hi ,
Great Job!!!!

But

It Throws a null pointer exception.

Does that have some thing to do with the Soap Obj that is left alone. You have not used it.

Can you please post back, i have a task ahead!!!!!!

Thanks
Offline  
Closed Thread



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


ETERFANT Dental LED Flash Photography Oral Cell Phone Camera Filling Light Tools picture

ETERFANT Dental LED Flash Photography Oral Cell Phone Camera Filling Light Tools

$63.89



1 PCS New For Flash relay 5 Pin 24V  JQ608A /215C picture

1 PCS New For Flash relay 5 Pin 24V JQ608A /215C

$18.12



Lot of 100 Brown Pharaoh Coturnix Quail Hatching Eggs - Flash Sale picture

Lot of 100 Brown Pharaoh Coturnix Quail Hatching Eggs - Flash Sale

$54.50



Olympus WS-853 Handheld Digital Voice Recorder 4.1 cm 1.6

Olympus WS-853 Handheld Digital Voice Recorder 4.1 cm 1.6" LCD 8 GB Flash Memory

$48.00



LP Weather Logic Seam And Flashing Tape (boxes) picture

LP Weather Logic Seam And Flashing Tape (boxes)

$200.00



NEW Flash Technology White Xenon Tower Flashtube Lighting:  H18030CF  picture

NEW Flash Technology White Xenon Tower Flashtube Lighting: H18030CF

$120.00







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