Spring WS and UDDI - java

I have a bunch of web services implemented in Spring-WS 1.5.9. We use Maven to do our builds, our services run on OC4J that have a UDDI provider.
What we want to do is to start using UDDi internally to register our web services to allow other groups in the business to find and use them.
The problem is that I've not been able to find how to actually put this all together. How do I get the services to register them selves when they are deployed to the app server.
Spring doesn't seem to have any support or annotations. There doesn't appear to be a maven plugin.
I've got all the pieces but how do I put these together into an automated solution?

For service discoverability, Spring-ws provides the DestinationProvider interface to locate the edpoint of a service at runtime. You can use the Wsdl11DestinationProvider class to retrieve the endpoint from a WSDL available or you can implement your own class by extending AbstractCachingDestinationProvider using UDDi access libraries.
For the automatic publication, I am aware of Mule Galaxy wich is a Service Registry solution (not based on UDDI but on ATOM/REST) that provides connectrs to automatically import artifacts from Maven for example.

You could use UDDI4J it let you interact with uddi servers :)

Check out Apache jUDDI. It has annotations that youc an use to automate the registration process. I'm not sure what you mean by "internal use only" but can you run optionally run the full server in embedded mode without a web container) or it can be ran within Tomcat, Jboss, and most other containers.
Example: http://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/uddi-annotations/
There's also a number of other solutions, such as WS-Discovery, mDNS, ebXML etc.

Related

Spring and SOA application

I'm new to WEB SOA applications and i have several questions about how to implements this architecture.
I would like to make a SOA based application involving multiple services using spring restfull api.
I'm aware of how to build each service itself.
i've already made a maven based project exposing a restful service using spring boot and secured it using spring security... my problem is to implement several services:
I don't know if i have to make a project for each one or there's a better solution... i want them to communicate through XML/Json so they won't be in same project in my point of view.
All secured by same service which makes use of spring security, i don't know how to link between the security service and the other ones. i don't want to write same security config classes on each project and then the user would be asked for sign in each time he accesses one of the services.
Share some resources which are used by all most services such as domain model classes, since i don't want to copy paste them (make duplicates), if i would change anything i would have to make changes in all services ... horrible :/
Thanks in advance.
1- Secure them all (the entire application) using one service which
make use of spring security and which will be asked for whenever a
client access one of the services.
This link will help you : https://www.youtube.com/watch?v=3s2lSD50-JI
2- Share some resources which are used by all most services such as
domain model classes.
Here it is about how to organize your project in your IDE or in your architecture. Using packages, shared libraries, shared projects or maven modules can help you.
3- Deploy all services inside one " application container ".
Your IDE or Maven should be able to help you deploy you application in a container. In the case of Spring Boot, there is an embedded Tomcat server that can run your application. Or if you have your Tomcat stand alone installation, you can deploy it by your self.
Reading you post, I guess your are new in Spring Boot development. The learning path I can suggest is the following (in my point of view) :
N-Tier Pattern for application architecture, and the purpose of the layers
The architecture of the Web and HTTP protocol
SOA and REST Services
Maven to build and compile your projects
Spring Boot, in mostly moderns architectures used to implement Backends my exposing REST Services
You can find by Googling tones of well explained documentations and blogs concerning those subjects.

Is there any possibility to add a module to a web service deployed on Tomcat without terminating the existing web service

I have developed a web service using spring mvc and hibernate. Currently I couldn't find a solution to add a module to the running web service without terminating it. My intention is to develop the web service as modules and plug modules in runtime. In .Net the solution is developing the program using MEF (Managed Extensibility Framework) the DLL's. I developed some solutions using OSGI framework but I found some practicability issues existing. Please help me to find an applicable solution for the scenario.
deepening of your plan. this is possible with OSGI by registering the new modules as Services and tracking all services in the Framework's service registry by using ServiceTracker
You can deploy the external module as a another app onto the container/server. And leverage JNDI for resource sharing. https://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html

Is possible to communicate the components which is running on different server by OSGI

We are going to develop large scale application by using J2EE. The application has contains many number of modules. For the purpose we have planned to split the application into module application and run it on different servers.
If i use OSGI, then is it possible to communicate between the two module component which is running on different server?
I am not familiar in OSGI. Please help me to find the solution for the large scale application
Thanks
You could start from the OSGi Remote Services Specification. Apache CXF project provides an implementation for that. Quoting from CXF web page:
It implements the Remote Services functionality using Web Services, leveraging SOAP over HTTP and exposing the Service over a WSDL contract.
In my experience, embedding CXF in Equinox (the Eclipse OSGi implementation) has been very easy.
However DOSGI is not the only way to go: queueing systems like JMS or distributed caches like Hazelcast can help you to distribute events and data across the system. These technologies can be easily embedded in OSGi as well.
Ok, here's another one ;)
If run with Apache Karaf you just need to install the Apache Karaf sub-project Cellar and it's corresponding DOSGi feature. With those two, you'll have 1) a clustering solution for Karaf and 2) a way for your Applications to communicate with different cluster-groups. All of this comes out-of-the-box with Karaf 3, just install the extra features cellar and cellar-dosgi :)
Another implementation of the Remote Services specification is Amdatu Remote:
https://amdatu.atlassian.net/wiki/display/AMDATUDEV/Amdatu+Remote
The Amdatu Remote subproject provides implementations of the OSGi Remote Services 1.0 (OSGi Enterprise R5) and Remote Service Admin 1.1 (under development) specifications.

WCF Self-Hosting capabilities in Java

Hi guys is there a way to self-host a web service in Java just like WCF?
Jersey using Grizzly embedded within it would seem like a good fit for your needs. It wouldn't require and outside application server and would be fairly lightweight to get setup. You can just read the Jersey getting started documents to get going with that exact path:
Jersey User Guide
If by self-hosting you mean generating a web service endpoint for invocation, there are a number of ways to go on this, depending on your potential deployment environment.
I'd start off looking at Oracle's JAX-WS implementation, which includes RESTful capabilities. If you want to run a relatively simple stack, you could use Apache Axis2. And then JBoss has JBossWS, which can run standalone or in the JBoss Application Server. I'm pretty sure most of the major application server engines have a Web Services component as well.

Testing Web Services Consumer

Here are some tools that I have found to test web services consumers:
http://www.soapui.org/
https://wsunit.dev.java.net/
Are there any others? I would prefer testing frameworks that are written in Java or Python.
I have used soapui by a maven plugin. It can create junit-linke reports to be run and analysed like unit tests. This can be easily integrated in continious build, also with the free distribution of soapui.
I've used Web Service Studio.
Web Service Studio is a tool to invoke web methods interactively. The
user can provide a WSDL endpoint. On clicking button Get the tool
fetches the WSDL, generates .NET proxy from the WSDL and displays the
list of methods available. The user can choose any method and provide
the required input parameters. On clicking Invoke the SOAP request is
sent to the server and the response is parsed to display the return
value.
This tool is meant for web service implementers to test their web
services without having to write the client code. This could also be
used to access other web services whose WSDL endpoint is known.
Also the Web Services Explorer in Eclipse which comes as part of the Web Tools Platform.
Through UDDI and WSIL, other applications can discover WSDL documents
and bind with them to execute transactions or perform other business
processes. The Web Services Explorer allows you to explore, import,
and test WSDL documents.
The Grinder is right up your ally with both Java and Python, that handles most web services, (SOAP/REST/CORBA/RMI/JMS/EJB) etc.
http://grinder.sourceforge.net/
You really need to be more specific: What is it that you want to test in your WS-consumer? That it calls the right WS? This looks a bit pointless - WS are a perfect place for mocking whatever may be called - without anything being called.
In order to test the consumer you'd otherwise be writing a Webservice that mocks the original, right? I'd suppose that the communication protocol that goes through the wire is not the clients domain - e.g. it's generated. So the only thing a WS-consumer's client sees is the interface. And there's nothing to test in an interface.
It might be that I completely misunderstood your question - please clarify if I did. I'll revise the answer then.

Categories

Resources