Dropwizard and EJB integration - glassfish

G'Day mates,
I want to use Dropwizard to access my business logic which is encapsulated in EJB layer hosted on Glassfish.
From Dropwizard website, Dropwizard uses Jetty as a built-in application server. Which as far as I know is not EJB compatible.
How can I build a webservice layer that can consume my business layer and at the same time I can utilize the run any where .jar services?
Regards,

Consuming an EJB web service does not require to use EJB. Its just SOAP over HTTP, so you can do it with a simple HTTP client application.
Normally you would generate proxy code from the wsdl to use with JAVA, check out apache cxf or the jaxws-maven-plugin.

Related

Exposing external services in Mule API gateway

I have a query on a design hope you guys can clarify my doubt.
I have a specific requirement in which Mule is used just to expose the back end services in API gateway, backend services are written in Spring boot and other technology, all these services needs to be exposed in API gateway.
Is this a good practice to do that and if yes how can we do that?
I saw that in API manager we can create proxy layer on top of the services developed in Mule but is it possible to create proxies for the services developed in different technologies?
Absolutely ... For creating proxy service, it doesn't matter what type of technology does the backend service have.
It can create a proxy layer for any kind of backend service available either locally, in cloud or other remote location till the service url is accessible.
This proxy will create an additional layer hiding the actual url to the external world.
it doesn't matter what technology you are using for development as long as those are REST services and accessible to the cloudhub application. You can deploy those on-premise and can integrate your local runtime with cloudhub. Also, mule supports spring projects and you can directly configure your spring project/details inside mule.

Developed JAVA2Wsdl Application using APAche CXF. Need help in adding Security to Soap service

Developed the SOAP Service with APache CXF in Spring Java2WSDL - Bottom-up approach/Code first approach.
I wanna to Secure the SOAP service using APache CXF. or Spring OAuth.
I had come-accross blogs which were implemented wsdl2java.I was really messed up and fed-up with it.
Im new to this Apache CXF stack. So Explanation in brief are most supportive.

Using Swagger for documenting RESTful services in Mule

I want to use swagger for documenting our RESTful APIs. Our Jersey classes will be consumed from the mule flow. To use swagger for documenting my API I need to use the servlet configuration as mentioned in here - https://github.com/wordnik/swagger-core/wiki/Java-JAXRS-Quickstart
As the Jersey classes are deployed in mule, there is no web.XML.
If you know how to configure swagger with Mule please let me know how to do that. I truly appreciate your feedback and suggestions.
I see two possible options, the latter being the one with the highest chance of success:
Run a Servlet container inside Mule, as demonstrated by the bookstore example provided with the standalone distribution, configuring web.xml as indicated and making sure you're using servlet not http inbound endpoints in your Mule configuration.
Generate at build time a static Swagger configuration using https://github.com/ryankennedy/swagger-jaxrs-doclet and serve it using the static resource message processor from the HTTP transport.

If I create a web service using JAX-RS (on netbeans), it is essentially an API to the web service?

If I create a web service using JAX-RS (on netbeans), it is essentially an API to the web service?
The web service would be REST or SOAP based.
I realize that the API provides the interface to the web service's functions, but does JAX-RS expose the interface?
Actually, include the library for JAX-RS depends of the Application Server. If you use a application server in netbeans which is Java EE6 Certified, you don't need any additional libraries.
However, if you use netbeans and also Tomcat o a Java EE 5 server, netbeans automatically add the JAX-RS libraries, in this case, the reference implementation.
The user can also choose to do it by hand.
Read more:
Getting Started with RESTful Web Services
Developing RESTful Web Services with JAX-RS, Netbeans, Glassfish

axis2 vs spring-ws vs jersey

My friend asked to explain me what's the difference between Spring, axis2 and Jersey. Here I listed down a few differences that I'm aware of. Please comment/respond if you know more differences
Spring webservices:
A java web application with a servlet configured in
web.xml(org.springframework.ws.transport.http.MessageDispatcherServlet).
You can use spring annotated POJOs for creating web services
Supports both RESTful and SOAP based web services.
Since it’s a web application you can use http authentication mechanisms
for enabling security
Axis2:
The webservice application is a .aar file that will be deployed in
axis2.war
Use AXIOM for using non-primitive type arguments to web service calls
You can use JSR181 annotations to create webservices
You can use spring-dependency injection using axis2 extensions.
Supports both RESTful and SOAP based web services.
I guess you have to use ws-security implementation for
providing security
to your web services>
They claim hot deployment of webservices works but I haven’t seen
it working.
Jersey:
A regular web application with a servlet configured in web.xml.
Write custom message readers/writers for using
non-primitive type arguments to web
service calls
Since it’s a web application you can use http authentication mechanisms
for enabling security
Supports only RESTful implementation of web services
I have seen hot deployment working may be because it’s a web application
and the container can do hot
deployment
I'm not familiar with Jersey and Axis, but I can tell you something about Spring-WS.
You cannot use Spring-WS for restful webservices. Spring-WS is intended to be used for contract first webservices. You can however use the features of Spring 3.x and Spring-MVC for REST services.
As for authorization, you can easily wire in any sort of security (with Spring-Security for instance).
I'm a big fan of the 'automatic' (de) marshalling features of Spring-WS. Just annotate your methods with the correct types and it'll know what to do.