IBM Websphere Integration Developer - Using JAX-RS - rest

I know this isn't the best place to put this question but here it goes...
I'm using IBM Websphere Integration Developer...
I used JAX-WS runtime to create webservices from a Java test class, that instantiates severall other classes.
I did this by:
Right clicking on the Java test
class
Web Services -> Create Web Service
Service: Webshpere Process Manager v7.0 Web Service Runtime: IBM
Websphere JAX-WS
Checking "Publish the Web Service" -> Next -> Document Wrapped
Checking "Generate WSDL file into the project"
Checking "Configure WSDL service name" -> Finish
This resulted on the creating of a Delegate Java class on the same package of the test class
The creation of a WSDL file and an XSD file.
The Web Service is working great an this is solved...
No I need to have a similar process to generate a REST web service, and found out the JAX-RS API.
In order to have this I installed the "Websphere Application Server Feature Pack for Web 2.0" and thought that by doing this I would have the abilitty to use no only JAX-WS, JAX-RPC, but also JAX-RS, but this doesn't work.
I need the ability to generate REST Web Services automatically from a Java text class so is or isnt this possible?
Regards

As it turns out the automatization supplied by the usage of JAX-WS and JAX-RPC is not possible at this moment for JAX-RS API.
Despite of this, you can do this quite easily using Rational Application Developer, but not as easily on Websphere Integration Develloper.
Regards

Related

How call Rest API in Eclipse RCP application?

I have one Eclipse RCP3 project.Now I need to call a rest api|(java) and Post some information using that API. Need Help.
Being a Java application, an Eclipse RCP app can use most existing Java REST client libraries. My opinion is that the easiest way is to use the ECF JAX-RS Jersey Client. I recently wrote an article about how to incorporate this into an Eclipse RCP application:
https://www.modumind.com/2020/05/19/eclipse-rcp-and-rest-an-introduction/
In short, the JAX-RS Jersey Client is an OSGi Remote Services client created as part of the Eclipse Communications Framework (ECF) project. It embeds a Jersey/Jackson JAX-RS implementation that allows you to create REST clients as annotated interfaces that are made available as OSGi services locally. Jackson is used to data bind the REST responses to Java POJOs which require little or no annotation.
This solution allows you to skip most of the scaffolding code that usually has to be written to make REST calls in a Java application. But of course, you can also use Jersey and Jackson directly, those plugins are made available via Eclipse Orbit project.
http://www.eclipse.org/orbit
The GitHub repository for the ECF JAX-RS Jersey Client can be found here:
https://github.com/ECF/JaxRSProviders

Tomcat restful web service database (JPA) with Netbeans does not work

I have been able to create Restful web services with JAX-RS for Tomcat. Using the Netbeans Restful web service from patterns wizard.
But I am not able to create Restfull web servicer from database with Netbeans wizard.
It miss some libraries. I add openJPA and Java EE web api 6 (over the added by the wizard). But it continues not working.
I added javaEE-TomEE 8.0 but did not work, either!
Does anybody know what have I to add to Tomcat to get JPA-Database Restful service working?
Moving to GlassFish is not an answer valid... I want to keep on Tomcat (adding the minimal)
I have made some advances...
With EclipseLink(JPA 2.0) I was able to connect MySQL in a desktop application...
Then I switched to Apache OpenJPA and I was no able to get an EntityManagerFactory...
So it seems I choose a library incomplete...
I imagine, in Tomcat, I have to choose other library than OpenJPA.

OSGi bundles as SOAP web services in a plugin architecture

I would like to expose OSGi bundles as SOAP web services or in other words publish web service endpoints which are provided by OSGi bundles.
The architectural model/idea is that there is a host web application which is a normal war file deployed on JBoss (5.1.0 GA) offering a SOAP web service interface (JAX-WS).This host application starts the OSGi framework embedded (via ServletContextListener - currently Equinox) and loads a number of OSGi bundles which function as plugins.
The plugin bundles have a dependency to the host application as part of the request processing is delegated to them via internally defined interfaces.At the same time the plugin bundles should also be able to contribute an own public SOAP web service interface (endpoint implementations and the respective WSDL files to be published and made available by the application server).
The first approach we followed was that the host web application deploys a dispatcher/proxy servlet which delegates the processing to the relevant endpoints provided by the OSGi bundles.
There is the servlet bridge solution in OSGi/Equinox (BridgeServlet/HTTPServiceServlet) which enables the programmatic registration of servlets (for ex. in BundleActivators of the plugin bundles) using the HTTP Service specification.
The problem is that I have SOAP-based web service endpoints and would need to be able to wrap them in a javax.servlet.Servlet implementation.
That's usually an interna of the WS stack implementations of Java EE 5 servers which follow the servlet–based web services approach (endpoints defined as servlets in web.xml) and internally use to install native endpoint servlets for web service endpoints.
I did not find such a public endpoint servlet implementation which could be registered with the HTTP Service (maybe something similar like com.sun.jersey.spi.container.servlet.ServletContainer which can be used to publish REST-based services for JAX-RS applications in OSGi)
I am a little surprised that I did not find as much about registering SOAP-based WS endpoints with the OSGi HTTP Service or may be I do not see the obvious.
I have found something similar, JAX-WS-Commons/Spring (spring support for configuring JAX-WS, http://jax-ws-commons.java.net/spring/), which internally uses the class WSServletDelegate of the JAX-WS RI (metro) to process web requests for the endpoints.
But I am not sure about it, it seems kind of deprecated and I need to provide the metro WS stack jars to JBoss (or in the war file) in order to make it work on JBoss 5.1.0 GA.
Another approach seems to be distributed OSGI, which allows to publish OSGi services for remote access.
However, I could not find clear information about how to provide these services as web services on JBoss.
Other realisation aspects are:
we are bound to JBoss 5.1.0 GA and changes to the JBoss configuration should be as minimal as possible (in order to have minimal constraints to the setup of our customers)
All web services are developed contract-first which means that the original WSDL's are to be used by the providing container.
the plugin components should be as simple as possible concerning dependencies or technologies (in order to have minimal requirements to the skill of the plugin developers)
we use Spring 3 and Gemini Blueprint.
Finally, there are some ambiguities and unclear aspects and unfortunately I could not find reports on projects with similar requirements.
So, I would be eager to hear some suggestions or comments of the experts.
Maybe there are options I don't see, or maybe somebody has realised similar projects before and likes to share experiences.
Thanks a lot.
I am not an expert but another approach I have seen is to put the whole app server with an application into the OSGi container. It is an option in Sling launchpad http://sling.apache.org/documentation/the-sling-engine/architecture.html#launchpad
HTH

JAX-WS Web Service and environment entitys

Fist off all I'm quit new to this stuff, so sorry if I don't describe my problem properly.
I've built a simple Jax-WS Web Service for Tomcat 6 by using the Eclipse Juno wizard (dynamic web project --> add class --> new Web Service --> create WAR) and AXIS 2.
Everything works fine, but now i want to store some environment entities in the web.xml file and make them accessible from the service.
If I were using a servlet, I would call ServletConfigurator.getinitparam("name"), but how do i do it with a web service?
you might want to take a look at this website for RESTful Web Services API using Java and MySQL.It's pretty informative.

Applet Web service client, with Eclipse Indigo using Apache CXF,

I'm trying to consume a web service within an applet.
For that objective i've tried Apache and Apache2, both with good results
but the problem is that the jar dependencies are far too fat for my application
(the jar for axis or axis2 are over 1.5MB, and the applet is less than 200KB)
So i will try consuming the web service with Apache CXF, hoping that the jars
are at least a bit smaller.
Using eclipse one creates an empty project and in the main classes implements
the applet and blah blah, but to create the web service one must use the web service
wizard.
I've used this wizard before, to consume the web service using Axis, but the moment i choose other options i get this message:
****The Apache CXF 2.x Web service runtime in Tomcat v7.0 Server does not support the client project****
What i´m missing?
I've already installed, CXF 2.x runtime, and the Tomcat 7 Server, and of course the Eclipse Web Tools.
This question How to generate web service client with Apache CXF in Eclipse Helios?
shows a very hard solution and it´s one year old!
is there any other way to consume webservices within an applet?
ksoap2 has no documentation on complex webservices, and ksoap2-android
neither
Sorry for a boring question, but any help is greatly apreciated
Apache CXF 2-x Web service runtime Tomcat Server not support client
The Apache CXF 2.x Web service runtime in Tomcat v7.0 Server does not support the client project
Answer: If you see above error during creating web service client in eclipse using Apache CXF means you are using java project to generate the client from WSDL. Latest version of JAX-WS supports Dynamic Web Module v2.5 and up. So create client using apache CXF first you need to create Dynamic web project.
Once dynamic project created then open web service client wizard to create client from WSDL and issue should be resolved.