Mobilefirst 6.3 using java spring on serverside - java

is it possible to use java spring api's (rest api) on java server side code in mobilefirst 6.3 server. Thanks....

In MobileFirst 6.3 (and previous versions) the server side Java code has two purposes:
Custom login modules and authenticators
Custom Java code that can be invoked from a MobileFirst adapter (written in JavaScript)
MobileFirst 6.3 does not officially support exposing spring REST services using this custom Java code
However,
In MobileFirst 7.0 or above, it is possible to use Java adapters. Java adapters expose REST service implemented with JAX-RS standard (not spring REST). Even though JAX-RS isn't spring REST, it is quite similar and should not be a big problem to migrate from spring REST to JAX-RS.

Related

Is JAX-RS compiled for JAVA 1.5 ..I am trying for a REST Client here..If so what would be the version which is compatible for the same?

I am currently working on migration work from SOAP to Rest consumption. I want to know
what is the best api for rest client (in my case there is no spring and Java version is 1.5)
Does JAX-RS or Apache CXF supports Java 1.5 if so what would be the version of those for dependency??
If you haven't worked so far with any REST-API, I would suggest to start with Jackson and JAX-RS. They are pretty much de facto standard.
JAX-RS was introduced in Java EE 6. (Java API for RESTful Web Services). Hence, JAX-RS is not part of Java 1.5. About Apache CXF, it is compatible with Java 1.5. CanCXFrunwithJDK1.5

Rest Web service in JAVA

What is the most common and standardized way to create a ReST Java Web service ?
For now, I just use a Perl program to invoke my Java application but I think it's not the most efficient way.
Use JAX-RS for creating RESTful webservices as it is officially part of java EE 6 specification, previously JAX-RPC was used which has now been replaced by JAX-RS, wikipedia states:
JAX-RS: Java API for RESTful Web Services (JAX-RS) is a Java programming language API that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern.[1] JAX-RS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints.
From version 1.1 on, JAX-RS is an official part of Java EE 6

Migrate contract-first SOAP-RPC service to Java

we currently have a problem with supporting a legacy API offered via SOAP-RPC. The current service is exposed via a PHP extension and now we would like to offer it via Java. Switching to a Java implementation would mean a SOAP-WS service since we could not find a way to expose SOAP-RPC in Java.
The facts:
Our Java application runs as a servlet in Tomcat
document style "rpc" is not supported in Apache CXF, leads to arrays described differently
Apache CXF only supports JAX-B and not JAX-RPC.
Is there any way / tutorial to explain the writing of a SOAP-RPC service with current technology like Spring-WS or Apache CXF?

using jax-ws in jboss

I am trying to call a web service from java. I am using JBoss as the client application server. The Web server is written in jax-ws and is running in some other server (which i dont know).
My requirement is to call the web service from my application running in JBoss. After doing enough search, I found that, jax-ws is a Standard and now included in jdk. Metro is a reference implementation of jax-ws and is provided in the Glassfish App server.
My Question is: -
Is there any other jax-ws implementation present in the market?
Just like each container provides its own implementation of Servlet API, do all of them provide implementation of Jax-ws?
Do I need to copy the Metro api to my Jboss application?
Where does JBossWS comes into play here?
A sample code provided by the Web Service host specifies that, the client needs to have to add a authentication token to the SOAPHeader, and in the sample code they have used com.sun.xml.ws package.
When I used MessageFactory to create a new SOAPMessage, will it use the Metro RI or JbossWS?
If Metro is glassfish's implementation of Jax-ws, then will it run in other app servers?
Added to that, my application exposes another Web service also (although it uses Axis 1).
I am getting a bit confused regarding this.
Can someone help me with some details regarding jax-ws, Metro, JbossWS. And where do each of them stand.
JBossWS is the Web-Service stack provided by the JBoss Application Server, and yes, it is also an implementation of the JAX-WS standard. As far as I know, JBossWS is based on Apache CXF.
Glassfish uses another implemetation of JAX-WS, Metro.
In order to communicate with a remote WebService (the implementation is not important, as long as it uses standards), you can simply use JAX-WS api and any Application Server which provides an implementation for it. JBoss does, so you have just to write your client following the JAX-WS api (and it should run on both JBoss and Glassfish or any other JAX-WS compliant container).
About the authentication, you should provide some more information, since there are a lot of options in the standards here.

First Java EE Project using REST

I've been going off of http://www.oracle.com/technetwork/articles/javase/index-137171.html and downloaded the files but I'm a little lost since I've never done this before.
I've installed Tomcat and Eclipse Java EE IDE but I don't know what kind of project to use to create a webservice and how to load and compile the code to the service.
Am I going about this the right way in using eclipse?
That article is old. Since then, the Java standards committee created a new API named JAX-RS (The REST counterpart to JAX-WS). Like JAX-WS, this is meant to standardize REST web service layers.
Its reference implementation is Jersey, which supports JAX-RS 0.8, 1.0, and 1.1.
I understand that Apache CXF has support for JAX-RS 0.8, but it is unclear about 1.0/1.1 support.
JBoss has RESTEasy. However, it is not immediately clear which versions of JAX-RS are supported by RESTEasy.
Another popular JAX-RS framework is Restlet. Unfortunately, I can't open their site from here to say which versions of JAX-RS they support.
Here is an REST (JAX-RS) example I put together. You will probably find part 4 the most helpful:
Part 1 - The Database
Part 2 - Mapping the Database to JPA Entities
Part 3 - Mapping JPA entities to XML (using JAXB)
Part 4 - The RESTful Service
Part 5 - The Client
If all you're creating is a lightweight RESTful service you can also look at GlassFish which provides a simple http server for REST.
You'll create a web project to deploy a web service of any kind. It'll be packaged in a WAR and deployed on Tomcat.

Categories