WSO2 Greg and ESB integration samples - wso2

I am attempting to use Greg to hold endpoint URL's for services deployed into non-WSO2 containers (Weblogic/JBoss). I would like to use WSO2 ESB to perform mediation and routing of data through these endpoints.
However, when I look at the WSO2 ESB samples, it is not clear how I instruct the ESB to use WSO2's Greg. Below is the xml used to have the ESB use a registry deployed to the filesystem.
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.ESBRegistry">
<parameter name="root">file:./repository/samples/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
</definitions>
My assumption is that the registry tag's provider element should probably be able to be overridden with a web-service address providing access to Greg.
When all is said and done, I would like to create simple BPMN configuration files that connect to Greg, obtain URI's and URL's for the services used by the file, and then to reference them as properties later in the BPMN route.
First question, is this a standard configuration, or is there a better way to integrate WSO ESB and Greg.
Second question, are there any examples I could refer to that will answer this question?

Please refer following documentation.
[1] http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances
[2]http://docs.wso2.org/wiki/display/ESB460/Storing+Various+WSO2+Enterprise+Service+Bus+Configurations
Those include how you can store and using WSO2 governance registry in highlevel.
If you need to manage endpoints through API in governance registry following will help.
[3] http://docs.wso2.org/wiki/display/Governance453/Endpoints+with+Governance+API
[4] http://docs.wso2.org/wiki/display/Governance453/Endpoint+Look-up+Sample
Futher this thread include some of the hints how you can access custom stored properties in Registry
[5]How to access system property from WSO2 ESB and Registry

WSO2 Governance Registry is a meta data repository, therefore you can use it to store the SOA artifacts (WSDL,Schems,Policies, Mediation configurations , customs artifacts ..etc) of your deployment. After that you can govern those artifacts through the Governance Registry. You can find more details in the ESB documentation[1].
[1]http://docs.wso2.org/wiki/display/ESB460/Config+and+Governance+Partitions+in+a+Remote+Registry
Thanks & Regards,
Ajith

Related

Publish API in WSO2 API Manager Publisher to call a WSDL SAP

We have to publish an API and configuring a SAP WSDL inside.
When we test the connection, we have a time out.
Is there any spécial settings to configure publish an API with a SAP WSDL?
Thanks in advance for your help.
Regards.
There shouldn't be any special settings to publish a SAP-generated WSDL, but have you confirmed that your WSDL is 100% correct?
If your WSO2 installation is external (ie outside your firewall or if you're accessing WSO2 in the cloud), make sure that the URL in your WSDL is the external one and not the internal one. In particular, check the location in the port definitions for all of your services.

WSO2 ESB Callout Mediator axis2Configuration

I have a question regarding the WSO2 ESB callout mediator using an individual Axis2 configuration file. I would like to have the individual Axis2 configuration to be deployed using a carbon application. Unfortunately the callout mediator doesn't seem to be able to read the Axis2 configuration from the registry. I'm getting an error that the file axis2_blocking_client_proxy.xml can't be resolved when I deploy the carbon application that contains the mediation with my callout mediator.
The deployment works when I Quote a relative file path that points to the configuration file. Does anybody know if there is a way to tweak carbon application files so that distinct resources will be written to a dedicated directory on the WSO2 ESB Server?
Best regards,
Heiko
AFAIU, your requirement is to deploy an axis2 configuration file using a CAR (carbon application) file. This is not a recommended approach. If you need to deploy a configuration file in to the ESB, you can deploy that during the server creation time. CAR files are used to deploy the actual implementation code rather than the static configuration files.

WSDL for WSO2 ESB proxy service

I have done a few use cases on WSO2-ESB including protocol mediation with transformation and service-chaining.
In all of them I had to manually write the wsdl for the proxy service. Having experienced other vendor products including Oracle and Tibco where wsdl generation is done by the tool.
Would it be right to assume in WSO2 ESB one needs to manually write the wsdl file to expose a proxy service on any protocol, do not see any documents calling that out.
Considering the usage of wsdl in practical use cases.
I have seen posts stating "you can give the WSDL available at your Axis2 service" but most of real time use cases would not be pass through and have custom request and response.
Thanks,
Wajid
I'm also confused with manual wsdl creation. As far as I can see there are gaps in wsdl proxy description. When I do wsdl proxy with WSO2 I have to indicate wsdl to expose
its either as:
"none" and I have only mediate function exposed
"same contract" and this breaks the whole idea of proxy because after that clients read original wsdl and go straight to original server access point.
or and I have several options to make my own wsdl.
With rich SOAP API (hundreds of methods) none of above work well, considering that manual support of exposed WSDL is rather cumbersome.
I wonder if there is more adequate way for proxying WSDL?
You can use java2wsdl generator tool to achieve the WSDL generation.
For the proxies, if you try to restrict access for some operations in your backend service, you can attach customized wsdl to the proxy.
The customization has to be done by yourself and it is simple..
If you want to generate a wsdl fro your service, jsut deploy the service in wso2as, and check the service dashboard, wsdl option to view the wsdls.

WSO2 ESB 4.5.0 fails to create proxy service from governance registry

I have WSO2 ESB and WSO2 GREG running with registry being mounted to ESB instance.
While trying to create Loging proxy service I picked up the WSDL from registry. The WSDL has a schema import which it depends on. However ESB fails to resolve the schema location trying to find it on the local FS.
Screen here
Logs here.
Can this be overcame? Or that's another bug for WSO2?
Thanks,
Vladimir.
Use exactly the same "SchemaLocation" attribute value used in your WSDL in the "SchemaLocation" attribute of the "resource" element of the "publishWSDL" option.
For example, if the WSDL has a the schema imported as,
<schema namespace="some_namespace" schemaLocation="./TestSchema.xsd">
Then the "schemaLocation" attribute of the "resource" tag should also have the same as mentioned below.
<resource schemaLocation="./TestSchema.xsd" ...>

Getting WSO2 ESB endpoint meta data programmatically

I am trying to programmatically retrieve the meta data of the end points configured to WSO2 ESB (Eg: ServiceName, WebMethods, Input/Output Parameters with Return types etc). Can someone direct me to some way/docs which could help me fetch this data.
Unfortunately it's not really clear what you want to do. Here some examples how to access properties (Meta-Data?)
inside a proxy/sequence access properties:
<property name="some name" expression="get-property('registry','conf:resource/path')"/>
<property name="some name" expression="get-property('registry',gov:resource/path')"/>
<property name="some name" expression="get-property('registry','resourceName')"/>
Or inside a Custom Mediator:
String property = (String)messageContext.getProperty("nameOfThePropery");
Or inside a Custom Mediator (getting the filename from the Transport Layer):
org.apache.axis2.context.MessageContext axis2messageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext();
// print the filename of the current transport
myLog.info("FileName: " + axis2messageContext.getTransportIn().getName());
Hope this helps you a little bit further, otherwise improve you question.
To further improve on Abdul's question, we are developing a web-service gateway between a legacy client on side and on the other side are external web-services. We have created a template/sequences in WSo2 where we trap the legacy client request and redirect it to the correct web-service based on a internal protocol.
The external web services are registered in WSo2 as endpoints. So far we have been configuring these endpoints manually using the admin console. We are looking at automating this step so that our gateway will hit WSo2 and provide the WSDL URL. A class mediator would then invoke the WSo2 / Synapse APIs to save this endpoint in the Synapse configuration. We have not been successful in this.
We have also read the docs which say that changing synapse config thru mediator is not recommended, hence would like to see if there are other options that would do this job for us.
One workaround would be to create those endpoints from the client side itself. This can be done by calling the AdminService APIs exposed by the carbon framework. In carbon, a front end of any carbon component talks to its back end through Admin Services. For example, if we take endpoints related functionalities, when you use the management console to create/delete or to do any functionalities, it would in turn call the respective back end via the "EndPointAdmin" admin service. Therefore I believe, if you want to programmatically create those endpoints, you can call the EndPointAdmin backend admin service (via EndPointAdminStub - it is the client stub corresponding to the aforesaid back end service) directly from your client side and get your requirement fulfilled.
Regards,
Prabath