I want to fetch data from server side to my application which is in j2me. The data fetch from server is username and mobile no. which is already stored in server. In our project we have implemented the functionality of add, delete, view the contacts which are present on server. So now we have to implement the "Save" function so that all that server data (user name and mobile nos.) will get stored and displayed on that mobile emulator. Do I need to use XML parsing for this? If yes then how can I use it? If no then what should I use? Help me with code examples.
The steps would be to fetch the data from server using one of the webservices methodology and store it in the device. Each step below has the reference links
FETCH DATA FROM SERVER
My Answer To Other Post
Designing a mobile web server and client for traffic compression
JSON
Using JavaScript Object Notation (JSON) in Java ME for Data
Interchange
RESTful Web Service Upload/Download Large Data With
JSON
XML
Add XML parsing to your J2ME
applications
Parsing XML in
J2ME
SOAP
Determining methods available in a web service by examining the
WSDL
file
.
STORE DATA IN DEVICE
FileSystem
Getting Started with the FileConnection
APIs
RecordStore
save data from servlet to recordstore in
j2me
Related
So i want to develop a simple web application, which will basically be a basic form which on submission will allow to make an external api request. So are there any application designers that can allow to do that with minimalistic code. Appian for example has an interface/application designer that lets you drag and drop a UI interface and build a workflow, make api calls externally or to a database. So like that are there any other apps that allow to do something similar (make api calls/build ui easily/store in databse)? Any other suggestions are also welcome!
It heavily depends on the API as well as the kind of task you´re trying to achieve.
Here´s just a few examples and considerations. (All the below supposes that we´re talking about Web-Based APIs).
If the API requires authentication of some sort and the user authenticates himself: A simple HTTP file with JavaScript to send the request will do the job
If the API requires authentication but you authenticate for all the users: You will need a backend application that does the API request since you need something secure where you can put your Auth-Details for the API. Classic PHP or NodeJS in combination with a served HTTP file for the form itself would work without any JavaScript (depends on the API definitions)
If the API does not require authentication maybe a simple HTML form would work
If you want to write to a database you can have a look at something like https://directus.io/. They allow building a database with a UI and they automatically generate a Web-API which you can then feed by your forms. If the end-user is known to you Directus actually allows users to log in and fill the database with forms that you can visually design but this is rather for employees entering data into an internal database than customers submitting their contact data to you
From my personal experience, all the UI-Tools that promise to integrate with REST APIs make it really hard to do so since every API is different and there is no real standard for them.
I hope I use the propper terminology. Please correct me if not.
How to access an .nsf file with PHP ? I need to get some field values of tables for clients login purposes around the globe. Let`s say I need to validate if a client is registered and that value is stored in an xyz.nsf file. How to connect and how access it ?
Access your data with http/https request per URL.
You have several choices:
use out-of-the-box Domino URL commands like URL commands for opening documents by key
use IBM Domino Access Services (DAS)
create your own REST service based on ExtLib REST Service
create an XAgent which delivers the data as JSON (see example)
create your own Domino REST service using DAS
Choice #1 returns HTML. All others return JSON data which is probably best to handle with PHP. I'd go for choice #3 ExtLib REST Service.
Im working with a PHP script that POSTs to a GPService Toolbox (written in python), the first parameter is supposed to be a GPDataFile. From the documentation, it looks like I can set the value of this parameter to a json formatted string literal, {"url", "http://localhost/export/1234567890.kml"}, and the arcpy.GetParameter(0) should handle this object correctly.
Unfortunately I am receiving an error, saying 'Please check your parameters', there are two other parameters on the toolbox but they are just strings and are working correctly. I am working in ArcGIS 10.0.
The overall goal of this interaction is to send a KML file from our SWF/ActionScript to the PHP, which saves the KML to our database and subsequently sends it to the GPService to translate it into a GDB and then to individual shapefile objects that are stored in the database for rendering back to the SWF/Actionscript.
Any help our thoughts on how to get the Toolbox to accept the JSON structure would be greatly appreciated, I would like to avoid having to send the KML contents as a string object to the Toolbox.
Answer can be what maniksundaram wrote in ESRI forum (https://community.esri.com/thread/107738):
ArcGIS server will not support direct GPDataFile upload. You have to upload the file using upload task and give the item id for the GP service.
Here is the high level idea to get it work for any GP service which needs file upload,
-Publish the Geoprocessing service with upload option
Refer : ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Operations allowed: Uploads: This capability controls whether a client can upload a file to your GIS server that the tasks within the geoprocessing service would eventually use. The upload operation is mainly used by web clients that need a way to send a file to the server for processing. The upload operation returns a unique ID for the file after the upload completes, which the web application could pass to the geoprocessing service. You may need to modify the maximum file size and timeouts depending on how large an upload you want your server to accept. Check the local REST SDK documentation installed on your ArcGIS Server machine for information on using an uploaded file with a geoprocessing service. This option is off by default. Allowing uploads to your service could possibly pose a security risk. Only turn this on if you need it.
-Upload the file using the upload url that is generated in the geoprocessing service . It will give you the itemID of the uploaded file in response.
http://<servername>:6080/arcgis/rest/services/GP/ConvertKMLToLayer/GPServer/uploads/upload
Response Json:
{"success":true,"item":{"itemID":"ie84b9b8a-5007-4337-8b6f-2477c79cde58","itemName":"SStation.csv","description":null,"date":1409942441508,"committed":true}}
-Invoke the geoprocessing service with the item id as the GPDataFile input ,
For Ex: KMLInput value would be {"itemID":"ie84b9b8a-5007-4337-8b6f-2477c79cde58"}
-The result will be added to map service with job id if you have configured the view the GP results in a map service. Or you can read the response as it returns.
I read in an article that odata can be used for different combination of clients/servers.
Say I would like to develop a web application where i store data(say information about all mobile products on market) using mongoDB and use python as backend with Bottle framework to access data through browser as GET.
Then i decide to extend web app as android app. i can extend it to android without any code change on server side.
My doubt is does using odata here helps in any way? Say if i want to extend it to other clients?
Yes, you are right, you don't need to change even a single line of code on the server side if you change a client app. OData defines many conventions for the communications between the client and the server. such as:
What the URL looks like if you want to query some data
http://services.odata.org/V4/OData/OData.svc/Products?$filter=ID gt 2&$select=ID,Name,Rating,Price&$orderby=Price desc
Which http method should be used to Create/Retrieve/Update/Delete an entity
Generally speaking, Post for Create, Get for Retrieve, Patch/Put for Update, Delete for Delete.
What the payload looks like.
How to invoke a function/action
As long as the requests conform to these conventions, the server side always returns the predictable responsese regardless whether the clients is a browser or a mobile device.
I also find the examples for the odata:
https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/OData/v4/ .
Hope this helps you.
I have a Windows Phone 8 app. My app needs to POST some data to a web page that I have on my server. Please note, I am trying to POST to a web page, not a web service. The reason that I need to POST to a web page is because 1) I'm trying to render some contents in a web page that is currently launched via a WebBrowserTask 2) I am passing a large amount of data to the web page.
From what I can tell, the WebBrowserTask only allows "GET". Now, I'm totally lost in regards to what to do. Is there a was to POST data via a WebBrowserTask? If not, is there a way to serialize my data as JSON and cram it into the query string? I know that's ugly. At the same time, I'm not sure what else to do.
Thank you
Try adding a WebBrowser control then make your request through either WebClient or HttpWebRequest. Once you get the html response use the NavigateToString(string) method to display the result.
But you can simply use the Navigate(uri) method if you only need to specify some query string params.