Android using kSoap with webservices other than .NET - android

I'm trying to make an application that's making a connection to an XML-page that I've built with Progress database. I've tried accessing it with kSoap2, following this tutorial (http://seesharpgears.blogspot.com/2010/10/web-service-that-returns-array-of.html).
It doesn't really go into my Progress Procedure, so I don't get any response, so I'm wondering if this kSoap actually works with other webservices than .NET webservices?
You can find my webservice class over here http://pastebin.com/50rhLCFr.
My domain class is built exactly like the tutorial and the Progresscode works if I save the file to XML.
Thank you very much!

I have worked with a number of web services alongside android and this is my usual debugging process:
Build up a request manually and POST it using some software such as SoapUI to verify it works
once you have successfully constructed a working request you can then simply HTTP POST it from within android
store your own request templates and fill them out using string replace
this technique avoids using Ksoap, which I have found to be quite annoying!

Related

How does android retrieve data from a website?

I'm new to android, I'm trying to build an android app that is a front for a web portal. For example, Airbnb. They have a website, but they also have an android app that, using it's own layout, will show listings from their website.
There are many websites that teach how to or even directly convert your website to android apps. However, this will result in an app that loads too slowly and is unresponsive due to CPU usage.
Could anyone share any tutorial/guide to learn how to do this myself?
Million thanks.
To actually load data from a web server you're gonna need and API which usually delivers the proper date using JSON or XML format so that you can properly parse and display that data. Building this API is in it self a complete course on its own.
But connecting to and requesting data from the API is usually done using some networking libraries. These are some of the better know libraries for this purpose.
OkHttp: A complete library with a set of tools for handling network connections and HTTP requests.
RetroFit:Type-safe HTTP client for Android and Java by Square, Inc. which is built on top of OkHttp.
Async-Http-Client:
The Async Http Client library's purpose is to allow Java applications
to easily execute HTTP requests and asynchronously process the HTTP
responses. The library also supports the WebSocket Protocol. The Async
HTTP Client library is simple to use.
There tons of other good libraries.
its called webservices
Through android you get data in form of json from a web server and then return in custom view as you want.
Follow this link hope it will help
Step by Step Method to Access Webservice from Android
you would have to write an API/Web service or use if already exits to fetch data from web server. Basically the concept is that, the website itself must be pulling data from some database, so write an API which would fetch the data from same API and return JSON data and consume the API from your android app.
If you know PHP refere to this for the help :http://www.codeproject.com/Articles/267023/Send-and-receive-json-between-android-and-php
You can write WebService, in programming it generally refers to a web page(ex. Airbnb), that can be called from your android application which can pass in data to it, or receive data from it.
WebService is basically like a 'method' or 'function' in a normal programming language; except you're calling it over the internet.
The first thing is you have to create a Web Service. The Web Service will be your "bridge" to consume the data from other Website like airbnb or others and return the data to your android through json format for example.
You can create a Web Service using many languages like C#, Java, PHP, etc. I would like to recommend you to use the language that you know the most.
You can try to google this
Cheers

Socket.io and node.js example in android

I am new to socket programming i have to use socket.io and node.js to connect with my server host in android so can anyone please just describe me the programming example of how to connect to server in android. And if possible please give some help regarding node.js and socket.io. As i have searched everywhere on google but not able to find out the proper example.
Thanks
You can just have your web service be REST base.
Your Android application can just talk to your web server via REST and receive data json or xml whatever you fancy.
So with node.js you should set up routes.
An example would of a route would be
www.example.com/users via GET post would return a list of users either in JSON/XML
For your android application you need a library, I believe there's a built in one already, to make request for certain routes such as www.example.com/users via GET method and write the logic to expect JSON or XML and parse that.
I just googled this:
Android: https://github.com/koush/ion
As for node.js you just have to build route...
I think is would be better:
websocket api to replace rest api?
It actually invalidate my answers sorry, REST and websocket api are different.
I have no clue what problem exactly you have. But you should break your problems down to small part. And google and search for answer for each smaller part which would make your life easier to google.
Get your webservice up first so that your android software can consume stuff, build a prototype and then build a prototype of android app that consume data from that webservice.

Using HttpClient to invoke a webservice in an android app

I am new to android & web services.I I want to create an android app which consume a webservice using HttpClient.
Yet i am confused with, how to do this. I'll explain what i've needed to do.
Say,we have a webservice at http://www.w3schools.com/webservices/tempconvert.asmx
WSDL url=http://www.w3schools.com/webservices/tempconvert.asmx?WSDL
What I need is to call the method "FahrenheitToCelsius" & return values from it in an android app.Can't i do this using HttpClient? Since it seems to get only the HTTP methods like GET and POST.
When I search on this ,I found the below site as a more frequent suggestion. But it doesn't contain ,what I need to do.
http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/
(I could call "FahrenheitToCelsius" method & return values using ksoap library.But now i need to do it using HttpClient too)
To clarify- When you connect to a webservice via its WSDL file, you're consuming a very specific kind of webservice— specifically, a SOAP webservice.
The typically way to connect to a SOAP webservice is to either find a library in your language of choice, or find a utility that will use the WSDL to generate code for you that communicates with the webservice.
One popular utility for connecting to SOAP on Android is called ksoap-android.

Basic web service calling in android

I need a tutorial on how to do a basic web service call in android. I currently use ksoap but I and getting an error when I make the call and I need to know what the response from the server was. ksoap wont give me that information because it parses the response in the api where I am getting the error.
I am new to all this web service stuff so please help me out
Well it depends what you want to develop it using
A good tutorial using PHP, MySQL is here
I know you are using KSOAP at the moment but here is a nice tutorial that uses KSOAP and in explained in nice detail.

KSOAP webservice without using WSDL to send and Receive XML files on Android SDK

I am very new to android, I have to made an app which will use web services, which are made in .net.
SOAP and HTML can be used only, no WSDL is available.
I have to Send an XML an Receive an XML in Response.
You can use ksoap2 for android library
please see the link http://code.google.com/p/ksoap2-android/downloads/detail?name=ksoap2-android-assembly-2.4-jar-with-dependencies.jar&can=2&q=
It have the information about ksoap2,it may help you

Categories

Resources