does anyone know a JSON decoder für Cache 2008 (native Cache) - intersystems-cache

I have to decode the response of a rest service (only JSON response). Does anyone know how to do this in Cache 2008.2?

2008 version does not natively support JSON.
Try these libraries.
https://openexchange.intersystems.com/package/Cogs-JSON-Class
https://github.com/PlanetCache/CacheJSON

Related

How to upload binary file(Photos etc ) with Meta Data using REST

One way of doing is to convert the binary data to Base64 and send it along with meta data as MediaType.APPLICATION_JSON.
The problem with this is client has to convert the binary data into Base64 before sending.
I also tried sending using MediaType.APPLICATION_OCTET_STREAM format through REST. This works fine for binary data only.
One option is to send meta data in headers while using MediaType.APPLICATION_OCTET_STREAM.
Is there any better way?
Thanks
Use multipart/form-data. This is what it's meant for. Not sure which Jersey version you are using, but here is the link for the Jersey 2.x documentation for Multipart support. Here's for 1.x (not really much information). You will need to do some searching for using multipart with Javascript clients (there is a bunch of information out there)
Here is a good example of using Jersey 2.x with both the server side and the client API.
Here is an example with Jersey 1.x. You can see the API it not much different.

How to use WSDL file, parse SOAP message?

This is my first post here(pardon me if I'm vague).
Actually I've got a wsdl file (which have soap requests, schema, generates pojo) and my task is to
1) Integrate that with eclipse .
2) Send the request to the server.
3) get the response back.
4) And parse the response in Java.
And I'm not at all aware of where to start. Someone suggested of using Apache axis with eclipse (I'm not aware of that too).
Thank you for your help, And also please suggest what is the best way of parsing and how to parse a SOAP message that way in JAVA.
A demo will be so much appreciated.
Thank You.... and sorry if I'm expecting too much, I'm newbie :)
Create auto generated classes from WSDL. You can use various tools that help in generate classes from WSDL file ex: JAVAtoWSDL or ApacheAxis.
Once classes has been generated then you can parse request and create response with JAXB, that is marshall and unmarshall.

Jasper-reports and Dart

So I've been searching for 1 hour on Google and this website if I can generate reports using Jasper reports in Dart.
Anyone know if it is possible?
Is there any plug-in?
Thanks in advance
You can make a request from the browser (might be Dart) to the server (probably in Dart according to your question) and the server has to forward the request to a service running in Java or an application built in Java which generates the PDF file and returns the file (or the path to the file) to the Dart server which itself serves it to the browser.
You can make a Java service that accepts HTTP requests directly and skip the Dart server. The Browser can then directly access the Java service that generates the PDF and receive it from there.
It all depends how your infrastructure looks like.
(I don't know Jasper Reports, it might offer some functionality that makes this easier. This is just a generic answer).
You might take a look at this site
http://community.jaspersoft.com/questions/818313/which-best-way-use-jasperreport-php-application
I suppose this will apply mostly to Dart as well.
I found that Jasper Reports offers a standalone server which allows both above described scenarios
http://community.jaspersoft.com/project/jasperreports-server
There seems not to be a dedicated Dart client available (like this one for PHP) but Dart is quite capable of accessing a REST API. It's just a bit more manual labor to access the server than with customized a client library.

Uploading a larg document to CMIS-based servers using opencmis

I want to upload a large file maybe 500MB. on CMIS based servers. Alfresco, Documentum and Microsoft SharePoint
Would I face problems ?, if yes, are there suggestion to handle that ?
edit
I am still searching to build a java client using opencmis. I think I will face such problem and I want to know is there a possible handling using this lib
Use OpenCMIS to upload your content it is the most advanced CMIS client implementation.
As stated by Florian Müller (Apache Chemistry Chair, CMIS Committee
Member) OpenCMIS is tested to handle 2GB, so your 500MB documents are
supported without problems.
There are two bindings for CMIS which are REST/ATOM and SOAP
Webservices. There might be differences in performance between the
two, with SOAP most likely being slower. This is something you should
test if performance is an issue.
Use the OpenCMIS Workbench Desktop Client to easily try out the
transfer to your target repositories. This is the best way the see
how your content repositories work together with OpenCMIS.

Which json library to use on iphone to consume gson/jackson generated json

I need to build a java based JSON data API that will be accessed from mobile devices: Android, Iphone... I have narrowed down to these:
Server side data api - gson/jackson lib (pojo to json)
Android side - gson/jackson lib (json to pojo)
Iphone side - I googled & found that there are a bunch of frameworks Jsonkit, json-framework, touch json etc etc.
Question:
Can someone make a recommendation on the iphone side json library? The gson/jackson generated json output of the data api, must be consumable from iphone without any special tweaks to json structure
Is there any java Collection type that I should stay away from(on server side) to ensure the json is directly convertible to objective c objects?
Any other gotchas?
Note: I am aware of PhoneGap, titanuim & some equivalents - but not interested in them. Json is meant to be a universal format, but I have had cross-library issues earlier - hence this attempt to understand from people with prior experiance on the subject
Thanks!
I've been using RestKit Library in an iPhone App Project.
It is a nice framework that supports HTTP request/response handling with (mostly REST) servers, JSON/XML parsers to help you with data translation and a JSON <-> Object Mapping system.
It may supply your iPhone server communication needs (making requests to the server and receiving JSON responses from server and converting each of them into objective-c objects).
For RestKit, it only matters the objects of your JSON file. So you are free to use any class or collection in your server as far as you generate a valid JSON file as response.
It took me some time to learn how to use RestKit properly in my applications. But when you get used to it, it definitely saves you time, because it hides you the complexity of parsing JSON files for every request made to server. You are right in trying to pick a good JSON data handling API for your application.
Another good thing about RestKit is its community. It has a GitHub, a Google Groups and an IRC channel. If you plan to use it as a framework, assigning to its mailing list is definitely a good idea.
Have a nice coding! ;P
One of the best libraries to parse JSON in swift is EVReflection.
It offers a very easy installation using CocoaPods or you can just download it and add to your project.
Usage is very easy and it works like GSON or Jackson in Android/Java.
Example using Alamofire:
class User : EVObject{
// EVReflection does not support optionals!
// So you have to not declare any optional vars
var name = ""
var surname = ""
}
Alamofire.request("Your API URL").responseString{
response in
let resString = response.result.value
// assuming that resString = "{'name' : 'john', 'surname' : 'Doe'}"
let user = User(json : resString)
}
Personally I've been using the json-framework by Stig for my iOS development and works great. you can download it here.
OCMapper is similar to GSON, it has the ability to automatically map all fields and is simple to use. It supports both objective C and Swift:
let request = Manager.sharedInstance.request(requestWithPath("example.com/users/5", method: .GET, parameters: nil))
request.responseObject(User.self) { request, response, user, error in
println(user.firstName)
}