please explain a little about the ksoap android objects. I couldn't find any help anywhere.
what is the meaning and purpose of "namespace" when declaring a ksoap object?
what is the purpose of "SoapSerializationEnvelope" object?
what is the purpose of "HttpTransportSE" object?
KSOAP is a SOAP API based on kXML,where kXML is a lightweight Java-based XML parser designed to run on limited, embedded systems such as personal mobile devices
Check this link for details.
Difference Between SOAP and KSOAP
According to this webpage:-
The ksoap2-android project provides a lightweight and efficient SOAP
client library for the Android platform.
It is a fork of the kSOAP2 library that is tested mostly on the
Android platform, but should also work on other platforms using Java
libraries. It is still using Java 1.3 so should work fine on JavaME,
Blackberry and so on.
Related
I have a .net web service, I tried to connect it in java, so I converted wsdl file to java classes and start calling them and it was sussceccful, now I want to know if this methos can be use in android. should I use ksoap2 or I can to this in the same way of java?
We've been using ksoap2 in our Android app for over a year now, with good results. It's quite simple to use, well tested and can be used in commercial projects. Their website: ksoap2-android
You can do it by using SOAP library in java and Ksoap2 is for android.
I have created a Rest Web service using Jersey in a Java EE app. And I was able to create the client in a java app as well. I worked fine.
I'm now trying to consume my Web Service, but this time using Android.
I understood that Jersey libraries are not android oriented (Is that even true ? Please confirm this information ) and I read that Restlet is an alternative to build the Android Client.
How is that possible ? do you have any tutorials or documentation I can read for this purpose ?
"I understood that Jersey libraries are not android oriented (Is that even true ? Please confirm this information )"
This is pretty obvious. If you do the search on the jersey site, nothing shows up.
Also, it's pretty hard to find tutorial about Restlet on Android. I think you have to adapt from Java version. Personally, I use a plain http client to do REST stuff. (I think many people also do that.)
Regarding Restlet, you might find these useful:
http://weblogs.asp.net/uruit/archive/2011/09/13/accessing-odata-from-android-using-restlet.aspx
http://restlet.org/learn/guide/2.1/editions/android/
http://blog.restlet.com/2009/05/06/restlet-available-on-android-phones/
These questions are very helpful if you change your mind and want to do it without a framework.
Restful API service
Need sample Android REST Client project which implements Virgil Dobjanschi REST implementation pattern
I've seen people having trouble with using Jersey on Android before. You have to battle through a lot of exceptions to get it to work. There is a library on github that attempts to provide android support for jersey but I've not used it myself.
Restlet is available on android phones and you will have an easier time integrating it and getting it to work. However, I've personally found that using the HTTP client library on Android coupled with an external library to perform serialization / deserialization ( like gson ) is the easiest route to writing a REST client.
Currently I am working on an iPhone app. But the company also would like to have an android version for this app.
I have programmed all the request by Soap and used for the iPhone the Soap Request Generator of Sudz-C.
I am wondering now if something similar exists for the Android, It would be nice if I don't have to program this all by myself.
Anyone have some experiences or ideas?
You can use
http://easywsdl.com
website to generate all required java classes for your webservice. It uses ksoap2 library and supports many features like objects sent as references (WCF IsReference), complex inheritance, document and rpc style of webservice, all standard data types (including normal enums and IsFlag enums), and much more
ksoap2-android is what you are looking for, it will send/recive soap request's, is easy to use and on MIT license
I go through a lot of solution solution in WSDL 2 android. google don't matter about SOAP service and provide anything for it. wsdl2java won't work in most of case, some library cannot be use by android SDK. I suggest you to use http://easywsdl.com.
you'll see you can edit your own package name, class prefix and many other parameters depends on your need. If you have complex data and your are familiar to use Gson (https://code.google.com/p/google-gson/) to send parameter between your activities don't check "Use JodaDate" that is a great library for using date, but Gson doesn't support it (yet).
If you have few services that don't work (yes that can happen, depend of your WSDL configuration file), report it to contact and they will make the possible to fix your issue like they did for me.
The generator is fast. you will receive all your generated code and the .jar that you'll have to import into your project.
In web-service fundamental, I have heard about "SOAP" and "KSOAP."
What are SOAP and KSOAP?
What is the difference between them?
Why should I use one instead of the other one?
SOAP - SOAP is an XML vocabulary used to describe messaging and
remote procedure calls between distributed components.Any modern
language that works with the Internet is likely to support both XML
and HTTP.
KSOAP - KSOAP is a SOAP API based on kXML,where kXML is a
lightweight Java-based XML parser designed to run on limited, embedded
systems such as personal mobile devices. It is a pull parser which
means it reads a little bit of the document at once
So, KSOAP was specially was designed or developed to deal with small embedded device like mobile devices.
SOAP - Most enterprise-level SOAP toolkits often rely on the use of a Web Services Description Language (WSDL) generated proxy object to make function calls. This is useful if a service has a published description and when the toolkit requires the instantiation of several different client and transport objects.
KSOAP - While kSOAP doesn't support WSDL, it does make calling a service relatively painless. Only two objects are required: the SOAPObject and Http-Transport.
CONCLUSION - SOAP can be a very complex realm to explore, especially the XML mechanisms used to transfer data between disparate systems, languages, and toolkits. The wireless world requires tools of small stature and great power. Luckily when it comes to SOAP, the kSOAP toolkit provides not only small size and great functionality, but also relative simplicity and ease of use for the developer. Using kSOAP, a developer can develop complex SOAP Web services clients in a remarkably short time.
KSOAP is a "lightweight and efficient SOAP library for the Android platform."
SOAP is a protocol used for building web services, and which defines a format used for the exchange of messages that uses XML as base.
You cannot use one instead of the other, as they are two different things: The first is the library necessary to use a protocol, and the second is the protocol used from the first.
i am using a WSClient++ Java for Android project to generate the classes of my webservice but the version is the trial soo the program only generate two methods. My webservice have only one but miss some classes after generating. Anyone knows other software like this?
thanks
I think you can use DOM t generate your xml from WS. (http://www.w3schools.com/dom/default.asp)
Also, generate the Web service using simple java program with the help of Apache tomcat and Axis2. (http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/BottomUpWebService/BottomUpWebService.html)
Then call these Web Service in Android using kSAOP library.
Regards,
Sneha