Using Jersy API client on appengine - java

I have an existing API which internally calls some external API using jersy api client library. I am planning to deploy my API on appengine using with java8, but it seems this jersy library is not functioning on appengine platform, as per google docs either I need to use java.net.URLConnection or urlfetch methods to make http(s) calls from within appengine. Is there a way to make my existing jersy based code work as it is?

The same jersy code worked on appengine platform after adding urlfetch as below in appengine-web.xml
<url-stream-handler>urlfetch</url-stream-handler>

Related

Android and JAX-RS

I have a REST Client written on Jersey. It uses JAXB and JAX-RS. But when I try to add jar file with client to my Android application it crushes with error like this:
java.lang.NoClassDefFoundError: javax.ws.rs.client.ClientBuilder
Seams that Android actually doesn't support JAX-RS. Or maybe I'm wrong?
You can use android library like volley to make http requests to the jax-rs based api.
There is no need for a Jax-rs client and the need for android to support JAX-RS in perticular. REST-ful api's are supposed to be platform independent. So there is no requirement for client or the consumer of this api to support any perticular api or framework like Jax-rs.
speaking further,
Android uses ART/Dalvik virtual machine rather than JVM, therefore in that case it might not be able to compile a java based library? unless that library is also made available separately for android platform.

Possible to include Client JAVA API libraries in Web-services?

We want to develop a Java based Web-services (since the API's we want to use are Java based)
I would like to know if it's possible to use the IBM Rational Team Concert Plain Java API's (https://jazz.net/downloads/rational-team-concert/releases/5.0/RTC-Client-plainJavaLib-5.0.zip) as part of the Web-servicesand deploy them in the server?
Basically we use these API's on a client based Java applications. What I am looking at is more like a services which can be consumed by many applications
Anyone has any experience in deploying the client based API in the server as Web-services?
After multiple tries, it is possible to use the RTC Plain Java API's as Webservices.
How I did:
Followed the simple Webs Service creation tutorial (http://wiki.eclipse.org/Creating_a_Bottom-Up_Java_Web_Service)
Adapted to my needs
First added the "RTC plain Java API's (JAR's)" to the Eclipse build path
Then added the "RTC plain Java API's (JAR's)" to the "WebContent/Lib/" folder of my Dynamic web project
Created a new Web service & Web service client
I was able to login to RTC via this for starters

IBM FileNet P8 Java APIs integration with Android?

IBM FileNet P8 provides Java APIs to deal with the content engine (CE)
http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/index.jsp?topic=%2Fcom.ibm.p8.ce.dev.cews.doc%2Fconcepts%2Fintroduction.htm
my question is: are these APIs compatible with Android? can I use these APIs within my Android application ? if not, are there any alternatives ?
You can try to use CEWS API.
You cat try to use CMIS interface (if CMIS can cover your requirements and if you find the impelemntations of CMIS cliet for Android)
You can use ready Content Navigator application from Google Play to work with P8 repository.
You can customize ICN and use it in mobile browser or embeded via JavaScript in your application.
You have another option. Build a webservices layer over Filenet API and consume those webservices from your Android app
Sorry, i can't put comments to answers.
Sherif Ayad, FN have full WS API, it calls WSI. WS API is additional layer on EJB API. When you use CE Java API it depends on connection URL which transport will be used for communication (if protocol section of URL contains http(s) web services over http will be used, if iiop CE Java API will use CORBA(RMI) protocol for comminication) but it is the same api. WSI translate all methods to EJB layer. CE always have WS Interface. CE .NET API just generated stubs for WSI.
Development of additional layer of WS it is additional costs and source of errors.
Mina Samy. If you need just add comments to documents, look for the JavaScript API of ICN, or try to use ICN mobile application instead of custom application. You can try to change ICN mobile application by WebSphere Worklight technology (see license agreement for IBM Content Navigator).
mbonaci, FN Java API conatin some classes from Java EE stack, it use JAAS, RMI (IIOP) to work with EJB, it use some extensions of WS (WS-Security and WS-MTOM), it supports of transactions and others.
For example you need additional classes from javax.*** and some proprietary classes from WebSphere client to use CE Java API from remote host.
So, i'm not sure that CE API will be works under Android JDK.
I don't see why that wouldn't work.
Have you tried?
The alternative could be to use phonegap and browser (like modified Workplace), but under the cover it would stll be using CE API.
What kind of client app do you have in mind?

Heroku REST api Call in java

can we connect to heroku using webservices or anything else . i want to set up an integration in java which should login in ito heroku and run my application.?
There is an out-dated doc on the Heroku REST APIs that will give you the basic idea. Unfortunately the most up-to-date reference is the Heroku command-line client source code - which is in Ruby.
If you want to build an HTTP client in Java, Jersey (Oracle's JAX-RS Reference implementation) is a good choice. It's client library is very similar to the client library that will be in standardized in JAX-RS 2.0.
With Jersey, you are also not limited to Java's build in HTTP connector but can plug in the (much better) Apache HTTP client connector. (All described in the Jersey docs)
http://jersey.java.net/

Possible to access gdata api when using Java App Engine?

I have a dilemma where I want to create an application that manipulates google contacts information. The problem comes down to the fact that Python only supports version 1.0 of the api whilst Java supports 3.0.
I also want it to be web-based so I'm having a look at google app engine, but it seems that only the python version of app engine supports the import of gdata apis whilst java does not.
So its either web based and version 1.0 of the api or non-web based and version 3.0 of the api.
I actually need version 3.0 to get access to the extra fields provided by google contacts.
So my question is, is there a way to get access to the gdata api under Google App Engine using Java?
If not is there an ETA on when version 3.0 of the gdata api will be released for python?
Cheers.
I'm having a look into the google data api protocol which seems to solve the problem.
Google Data API Java Client : link1
Getting Started with the Google Data Java Client Library link2
I guess this is what you were looking for.
I use GDATA apis for my JAVA appengine webapp. So GDATA can be used with JAVA runtime.
From http://code.google.com/appengine/kb/java.html
Yes, the Google Data Java client library can be used in App Engine, but you need to set a configuration option to avoid a runtime permissions error. Add the following to your appengine-web.xml file:
<system-properties>
<property name="com.google.gdata.DisableCookieHandler" value="true"/>
</system-properties>
If the following is not included, you
may see the following exception:
java.security.AccessControlException:
access denied (java.net.NetPermission
getCookieHandler)

Categories