Using OSGi services in a mediator - osgi

Is there any way to create a custom mediator that access existing osgi services?
Basically I already have some functionality published as OSGi Services, that I want to be able to call from a custom mediator, but I can't find any way to get access to them. While the class mediator allows for creating instances of classes exposed through osgi, it doesn't appear to allow for the injection of other osgi services.

If you cannot do it using the class mediator, you can write a complete mediator. It will allow your mediator to access OSGi services as other mediators.
These three blog posts describes how to create a such full featured mediator for WSO2 ESB.
Part 1
Part 2
Part 3
And this is how to create a such mediator using WSO2 Developer Studio.

Related

Add authentication to wsdl service in Genexus

I'm studying how to create a web service with Genexus 17U10. The first part looks very simple, following this https://wiki.genexus.com/commwiki/servlet/wiki?4210,Web+Services+with+GeneXus I can expose the service and consume it in another project. Now I want to add some kind of authorization but I can't find how to set it. Does genexus manage it somehow? I can't find informations about this
It is easier and recommended to use REST services and authenticate using GAM.
For SOAP services you have to add extra programming.

Sharing of a view among microservies

I'm splitting up a monolith web service into several microservices using spring boot. To reduce duplicated code I extracted shared parts in a maven module that is used in the different microservices.
The monolith application had a healthcheck page that showed various information about the state of the service and some debbuging infos. It is implemented with Spring MVC and jsp.
I'd like to use this view in each of the microservices. Whats the best way to do this without duplicating the view/controller?
I was thinking of adding a web module to the shared maven project that contains the controller, view, spring mvc settings,...
But I'm not sure if it is good to have two web modules in one microservice.
Have you considered using spring boot actuator to retrieve health (and more) application information?
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready
You could then have another microservice that retrieves that information from each of your services, or just simply check it on then hitting the different endpoints (/health, /env, etc.).
UPDATE:
If you have you custom health logic you can even implement your own actuator endpoint for it. Furthermore, you can create your own library to reuse it in all your microservices:
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-customizing-endpoints-programmatically
46.4 Adding custom endpoints
If you add a #Bean of type Endpoint then it will automatically be exposed over JMX and HTTP (if there is an
server available). An HTTP endpoints can be customized further by
creating a bean of type MvcEndpoint. Your MvcEndpoint is not a
#Controller but it can use #RequestMapping (and #Managed*) to expose
resources.
[Tip]
If you are doing this as a library feature consider adding a
configuration class annotated with #ManagementContextConfiguration to
/META-INF/spring.factories under the key
org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration.
If you do that then the endpoint will move to a child context with all
the other MVC endpoints if your users ask for a separate management
port or address. A configuration declared this way can be a
WebConfigurerAdapter if it wants to add static resources (for
instance) to the management endpoints.

Liferay service builder 6.2

It is a basic question. What is the main advantages of using the service builder? If my portlet doesn't have anything to do with database, everything is of using webservices, will service builder help in any case like caching? will the service builder provides service layer, so that i can apply AOP on it ?
You can create a Service without any attrs, so service builder will create all the services and injections for these services.
The advantage maybe could be having a service wrapper, You can also use Liferay Catching solution.
For example you use services classes, and create method that calls Web Services.
Well there you can use the liferay cache solution.You can take a look to this class: MultiVMPoolUtil.java
Hope this helps

REST Bidnings for service reference in TIBCO Business Studio

I am using AMX Service Bus 3.2. and trying to expose my rest services (ASP.NET WebApi) through the TIBCO Active Matrix. Unfortunately I have not found any way to do this in TIBCO business studio.
I found TIBCO Active Matrix Binding Type for REST but it is intended only for promoted services. It allows to expose SOAP services via REST interface but it is unable to invoke my REST services hosted on IIS.
As for now I see the only one way to implement that - Create addition SOAP service that will redirect HTTP request from Promoted service to my REST Service. But such solution is not very good SOA design.
Any help is appreciated.

Are WSDL's like spring dispatch servlet?

im trying to understand where WSDL's fit in, in a typical web service backend application. i am coming from a Spring background and in my experience so far, in Spring, each url request gets mapped to a specific controller class via a dispate servlet running in the web container. you can specify which url matches a given controller via xml config or from annotations.
is using a WSDL the same thing as using an xml config file to map url requests to java objects?
Thanks in advance. im moving from Spring to standard j2ee/EJB3.
WSDL is just a description of Web Service interface, most Web Service systems generate those descriptions on fly like for example when you create asmx web services you can generate WSDL on fly by typing http://yourhost/yourwebcontext/yourwebservicename.asmx?wsdl and it will return you the description of that web service. Then you can use a tools that generate stub proxies for coding using those descriptions automatically, for example in Visual Studio when you add an Web Service Reference those operations are done automatically
No, WSDLs are not like a dispatch servlet.
A WSDL file is a description of a web service (SOAP, REST, etc.). A WSDL can (theoretically) be used by anyone to generate executable code which consumes the web service described by that WSDL.
From the WSDL tag info:
"WSDL" stands for "Web Services Description Language." It is an XML language used to describe a web service to code that wishes to consume it. It describes the messages sent and received, the possible faults, and the communication and security requirements.
From WSDL Essentials:
In a nutshell, WSDL represents a contract between the service requestor and the service provider, in much the same way that a Java interface represents a contract between client code and the actual Java object. The crucial difference is that WSDL is platform- and language-independent and is used primarily (although not exclusively) to describe SOAP services.
Using WSDL, a client can locate a web service and invoke any of its publicly available functions. With WSDL-aware tools, you can also automate this process, enabling applications to easily integrate new services with little or no manual code. WSDL therefore represents a cornerstone of the web service architecture, because it provides a common language for describing services and a platform for automatically integrating those services.

Resources