I,ve created a pictures gallery with ios 4.3 and i want download, decode and save my pictures before start my app.
I want use SOAP with Java Server because i think that is more simple but i,ve had some problems with Core Services library, i need this library to communicate both sides.
It´s impossible add this framework.
I need solve this problems or other solutions.
I´ve seen ASIHTTPRequest but it´s so difficult understand from zero.
SOAP is seldom the simple answer.
ASIHTTPRequest is nice for network access, but not a silver bullet for SOAP. It is just as easy/hard to do with the built in classes from Foundation framework.
First of you need to manually build your SOAP request bodies. Typing up template a XML file with placeholders that can be easily replaced is the simplest way to do it.
Then take the constructed XML as the HTML body of a NSMutableURLRequest and send it using NSURLConnection.
The response will be more XML wrapped in a NSData instance. Use NSXMLParser to decode it.
But given that you want to write the server in Java and an easy solution; I would use Hessian over here http://hessian.caucho.com/ to implement the server.
On the iOS side use HessianKit over here https://sourceforge.net/projects/hessiankit/ and do simple RPC calls.
Disclaimer; I am the author of HessianKit.
Related
How can I use ember js without ember-cli with PHP or java? How can I interact with back end data? Any example will be much appreciated.
The first thing you'll need to understand, is that ember-cli is a command line interface. It acts as a blueprint generator and an asset pipeline and glues all the ember stuff together in a wonderful productive package. It's just standard now, and you wouldn't want to use Ember without CLI. They are basically now the same thing unless you were using Ember since pre 1.13 and can't upgrade.
Ember is a JavaScript framework for front-end/client-side user interface. It doesn't deal with server style data storage like a traditional Apache/PHP. In a PHP setup, each page is rendered on the server side and then delivered to the browser in a complete form. Ember is more like a shell that you fill with data from somewhere else, but also has the ability to manipulate that data in the browsers and persist it back to the data-source.
The data source could really be something as simple as local storage. Maybe a simple game that just stores your userScore in the built-in local storage.
The data source could be something like the WordPress API, where ember pulls in posts or page data to display on the screen. Maybe you even have a form that persists new posts back to the server.
You could use parse or firebase for real-time back-end as a service. Or you could build a server of any sort that was able to generate an API that Ember could consume.
Currently, rails is popular for the server. Also, node frameworks like hapi.js and sails. Elixr and Pheonix are gaining interest and have proven to be a powerful backend team with Ember.
Ember uses ember-data and adapters to take in API data and serialize into a simple set of conventions.
If you have API endpoints coming from PHP or Java, you could use them - however, if you are starting a new project - I wouldn't think that would be an ideal route.
You can follow the Ember guides tutorial to learn more about how Ember works. Good luck!.
I want to write a client application for a site (e.g. to read smth from site, add some comments, likes etc). I haven't got access to site sources and there isn't any API for work with it. So at my Android application I decided to parse this site (it has static pages) using : JSOUP Library
And using this library I'm going to write unofficial, but API for my purposes to work with this site, and then use it in my Android application.
Can somebody tell me, is this good practice or there are better ways to do? Is this good idea at all to parse site in Android device.
As I wrote in comment - in general building your own application on top of the third party www service is not a good idea. If you want to do it anyway you have 2 options:
Use jSoup (or any other html parser if exists) and parse third party content on the device
Set up some middleware server to parse content and serve it in some more convenient way.
The second option has a little advantages - you can fix application without forcing users to update it and probably you'll save a bit of device's bandwidth. Of course disadvantage is that you have to pay for server.
General problem with applications like that is that every single change with layout, skin, server configuration can cause your application to stop working, as well as parsing html needs much more work that just connect to existing API.
More over - publishing your application can cause some legal issues (copyright) and is against Google Play's policy:
Do not post an app where the primary functionality is to: Drive
affiliate traffic to a website or Provide a webview of a website not
owned or administered by you (unless you have permission from the
website owner/administrator to do so)
I've been tasked with creating a server which will receive requests for information from an iOS device (iPhone) and then return results based on this request. I've done some research, and it seems that JSON is the way to go for this task. The thing is that I have no idea where to start; how my server should be put together, how it will handle requests etc. Can anyone point me in the right direction and perhaps suggest some reading?
If you are comfortable with Java, I would recommend getting the Eclipse JavaEE version, and then:
Create a new "Dynamic Web Project".
File/New/Other/Web/Dynamic Web Project
Then, in your new project, create a "New Servlet".
File/New/Other/Web/Servlet
This should create a skeleton server, with a doGet and/or doPost method.
You can debug the servlet right away with Eclipse; it helps you get everything set up (comes with Jetty built in, these days)
You can be set up with your first webserver in 20 minutes.
Grab the JSON jar from json.org. Drop it in WebContent/WEB-INF/lib inside your project.
In the doPost of your new servlet, call request.getParameter(...) with the name of your post param that has the json in it.
Pass that to the JSON parser.
To pass JSON back, get the JSON string from a JSONObject, and use response.getWriter().append(...)
Ta-da!
Pretty brief answer, but then again, it's a pretty open question.
If you want to build it in Java and want to use what all the cool cats are using, Dropwizard is the way to go. It's geek factor has increased after its last photo session for Vogue (either that or the newest edition of Thoughtworks technology radar). No, really - it's good and extremely easy to deploy and monitor.
If you just want to get it done and over with, a short PHP script is the way to go.
WARINING: If you don't know PHP, it's fine: you can still use it. If you don't know Java, stay away from it. Learning Java on the go is a big mistake.
You can get started fast using Spring Roo. It can automatically create controllers for your domain objects that return JSON data for Restful requests.
Can somebody specify the step for using web services in a J2ME application`
I have downloaded Eclipse (SOA), have included the wsdl file in my code and have prepared web service in visual studio 2008. I want to use a .net web service in my J2ME application.
Thanks
You can consume webservices in j2me, following would be the architecture look like,
Read More
Here is a quick youtube tutorial
If your phone does not support JSR172, or you want to target every phone in the market, you still can consume webservices manually. That is to say, you need to create an XML to invoke the service, and parse another one to see the results. This can be a lot of work. There is library called kXML2 that may help you in both task. But when I needed to invoke a webservice from j2me I found to be easier to follow this workflow:
1 - Use visual studio to create a simple client application for that webservice in .Net. So I can be sure the service works as expected without relaying in my j2me client, which is still in development.
2 - Use a tracer like http://simile.mit.edu/wiki/HTTPTracer to spy the connection and see what is really happening between client and server...it's kind of fun.
3 - Duplicate this behavior in my own j2me application ...but trying to keep it simple. As an example, I needed to create an XML like
<SOAP>
<data>
<id>
numericID
</id>
</data>
</SOAP>
Since I knew it was going to be a numeric Id, I just create the XML as a String using a stringbuffer.
4 - Be careful about the String encoding and the http headers. You can compare your generated traffic in j2me with the one the client. You need to replicate the exact behavior
I'm trying to write a simple Java desktop app to query Google and get the results. I've read so many articles in the past few days. I know that I have to do it through the GWT (Google Web Toolkit), the API that Google offers to programmatically query its search engine. My problem is that the GWT seems to be useful only to construct AJAX applications. I just want to write a simple desktop app. I am not interested in Javascript, XML or any server side application. Isn't there a way to do it?
Sure, take a look at this approach.
The general idea is that you make an HTTP fetch (using vanilla java.net.HttpUrlConnection or Apache HTTP Client). The magic is in the forming of the URL with the search term, and in the processing of what you get back from Google.
For the exact details on how to do this, see Google's REST search API documentation, including this section.
You can always get a license for the webservice and get the results returned through SOAP, however you did say that you were uninterested in XML. Shame, thats the quickest way. There is always doing a direct request to google through the query URL, since it uses HTTP get.