Android and Webservice - android

I am working on android project that connects to a database,
while I'm looking for tutorial I found ones that creates .php files and connect them with the android app using HttpClient and HttpPost,
and then exchange data with json.
this one is clear.
I found also other toturials that confuses me!
they are talking about using SOAP and wsdl files??
the links they were using for connecting to web service was with .wsdl extension!
Can someone explain to me what are they?
Thank you.

SOAP EN WSDL have something to do with xml, I dont recommend you to use xml either.
I recommend you to use json, because performance of json is better than xml.
I highly to recommend you to use volley https://developers.google.com/events/io/sessions/325304728
There are enough examples on the internet to make it work very well with your application!
However if you want to make a webservice see the question here > Android WSDL/SOAP service client
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
source:http://www.w3.org/TR/wsdl

Related

web service to alter from endpoints on android

im wondering the easiest way to go about this. I've used retrofit for java before to post and get from endpoints in web service my friend wrote in python.. However I've never wrote server side stuff. I have phpmyadmin running on a vitural server... Havnt used it yet however. I just need people to be able to like or dislike a poem they get from the server. Is there anything on the web I could set up like database I can alter from its endpoint? Or am I going to have to learn php and python now? Thanks guys!
To develop a web service is not necessary use php or python. If you are used to programming in Java I recommend you to use Jersey (https://jersey.java.net/) which offers an easy way to define your endpoints. You can also use jackson (http://jackson.codehaus.org/) to process the json info between client and server. Jackson helps you to transform a collection of object form JSON and vice versa.

Representational state transfer and Simple Object Access Protocol (ANDROID)

Ok i am not sure if this question has been asked before on SO.. I am confused with SOAP and REST.. I know that SOAP is formatted in XML and is send over HTTP whereas REST can be send over XML, JSON etc.. Representational state transfer (REST) and Simple Object Access Protocol (SOAP) makes a pretty good point.
But does that mean that SOAP cannot be send using JSON????..
I am asking the above question in reference to android.
I know this is a pretty stupid question, but i am really confused on this one.
Any help is appreciated!!...
Thanks.
But does that mean that SOAP cannot be send using JSON?
Correct. Quoting Wikipedia:
SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on XML Information Set for its message format...
And note that this has nothing to do with Android.
Actually SOAP or Simple Object Access Protocol is an envelop format for exchanging WebService request and response information. REST is a special kind of WebService that must be designed with a set of constraints. For example in a RESTful WebService method information must be placed in the HTTP method and scoping information must be placed in the URI.
For understanding the architecture of web services and for a good introduction to RESTful web services i highly recommend you to read the following book:
http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/0596529260

What type of web service should I use for consumption by iOS/Android apps?

I have to write some web services to support some mobile apps (Android and iOS) that our company will be producing. Because we use Windows/IIS servers the services will be based on WCF/.NET 4. I'm wondering what format will be the easiest to use on the mobile end. I know there's JSON, SOAP, and others, I just don't know which has the best support within a mobile environment. Suggestions?
I intend to have a single set of WCF services which are consumed by both mobile platforms.
Since you're using the .NET-platform on the server, WCF supports sending/receiving XML or JSON messages pretty easily using WebHttpBindings and WebServiceHostFactory to build RESTful services.
For the client platforms - you just need an HTTP Client capable of sending JSON or XML formatted messages to a URL and retrieving a response. There are many libraries that will make this easier to manage, but it depends on the complexities involved in your service.
I would avoid SOAP, but you can easily support it using WCF by adding BasicHttpBinding and a ServiceHostFactory.
For my experience, working with JSON is the best way for iOS and Android.
The server... I would use Java (struts or similar).
Hope this helps
I used the Slim framework (PHP) to serve JSON via RESTish URLs, and the GSON library to convert the data, it was pretty straight forward in my case.
I use apache Camel CXF (web service) & to parse the data I use JAXB.
note: about cxf http://camel.apache.org/cxf.html

Android ReST based client and SOAP server. Is it possible?

I'm writing a web-service for Android. The client side will be coded in JAVA and we are planning on using ReST. But, the server supports SOAP, JMS( Java Messaging Service) and Remote Method Invocation (only these). I just want to know if it is possible to return response for a ReST based client from this server.
As far as I know, ReST is not a protocol like SOAP, but I just want to be sure that it can be done before I get started.
Any link to video/tutorial/code will also do.
Thanks in advance.
REST is really just an elegant way to use HTTP for resource access.
HTTP is the protocol.
So if you can process HTTP requests on that server, it's doable.
In a Java EE environment a servlet container is perfect: you can create a WAR based on the Jersey framework.

I want to implement a RESTful webservice do i need something om my server running to handle requests , like with SOAP

I want to implement a RESTful webservice for an Android App using JSON. Do i need something om my server running to make for example a GET request work , like with SOAP is the case. I have read something on servlets but i don't know if this is neccesary or not.
If you will be using PHP on the server then you can write a RESTful service with a PHP application framework like Kohana, CodeIgniter, CakePHP etc. There are quite a few.
These frameworks have built in functions for encoding results in JSON format and they support the REST approach out of the box.
If you prefer I'm sure there are also similar IIS and .NET based approaches too.
If you query your own server, then you need to first program your server to handle requests. On the other hand, if you query a 3rd party RESTful server, then all you need is create the appropriate http request, send it and handle the response.
Servlets are used for Java EE based implementations of servers. You can implement your server in any programming language or framework you want.

Categories

Resources