WSO2 - Uploading "Registry Resources Project" onto ESB Server - wso2

I have a requirement to version control my "registry" artifacts (i.e. wsdls, xsds, xsls), that I currently upload to the WSO2 ESB 4.8.1 server. I'm not using WSO2 GREG at the moment. I came across the "Registry Resources Project" facility which I think would help me achieve this. However I'm unsure as to whether this facility can only be used with GREG or with ESB as well. Is there a way for me to generate a CApp Project, include the the above "Registry Resources Project" in it, and deploy it to my ESB server?
I've come across blogs which deploy standard ESB artifacts in the way, but not the registry. -
Please help....

You can create required registry resources as specified in the creating registry resources documentation. Once you have created your registry resource project, then you need to create composite application archive as specified in the Creating a Composite Application Archive (CAR) file documentation.
When you are creating CAR file, you need to specify server role as EnterpriseServiceBus to deploy your registry resources in ESB.
Thanks.

Related

Accessing WSO2 BPS and ESB registry from code

I am trying to access the registry of WSO2 BPS and WSO2 ESB from Java in order to automatically fill the registry based on the data I provide.
I have already found a number of resources about the required Java code and dependencies, this being the most helpful one: [WSO2 Governance Registry]Using WSRegistryServiceClient. However, the approach described in these resources depends on the WSRegistryService service. This service is included in Governance Registry by default, but not in the other WSO2 products. I have verified that my code works for the Governance Registry. For any other WSO2 product on my machine, I get this error:
The service cannot be found for the endpoint reference (EPR) https://localhost:9445/services/WSRegistryService
I found an old thread suggesting that it should be possible to install the WSRegistryService on other WSO2 products as well, but I have not been able to find out how to do so. I can't seem to find it within the features I can install from the web console of the products. I have also tried manually copying the relevant jar from the plugins directory of Governance Registry into the plugins directory of other products, but that doesn't seem to be sufficient.
Note that my application for filling the registry will not be running on the carbon server whose registry I want to access, so using CarbonContext.getThreadLocalCarbonContext() (an approach I found in some other articles) is not an option.
I think your referring to how to install features to WSO2 products,
Please find this documentation.

Error occurring while Listing wsdl from wso2 governance

I have added wso2 governance registry on wso2 BPS 3 as a feature from http://dist.wso2.org/p2/carbon/releases/turing/
and restarted.
When tried to add wsdl from file it giving error:
org.wso2.carbon.governance.api.exception.GovernanceException: Attribute Search Service not Found.
I am trying to use BPS, GREG as a single component to reduce servers in my project. After GREG added as a feature it adding ".wsdl" file at "_/system/governance" and it is not forming endpoints,services as GREG normally do.
Is there any way to get out of this problem.
Thank's in advance....
The reason for this is missing some of the features which needed in ordered to work governance features. I think best option is using Governance Registry separately and mount the registry of it to BPS. By doing this you can add services from Governance Registry and use them in BPS. You can follow this document for more information on registry mounting.

WSO2 ESB How to upload app config xml files

I need to work around a weird behaviour of WSO2 ESB. Whenever the ESB is started, all carbon files are redeployed. This means to reset all changes made in files after last deploy(restart), such us, configuration xml files (endpoints, custom config files...) .
So I guess the only way to avoid modifing this configuration files during the start up is to take them out from the carbon file. Thus, I would upload app files as carbon app, and app config files (EP, custom config files...) using an alternative way.
So, in this situation, how could I upload these config files in and easy and automatic way?
Regards
I presume you are using a CApp (Carbon Application) to deploy the esb artifacts like endpoints. The number rule for this procedure is that you need to do all the modifications you need to do via the WSO2 Developer Studio, build a CApp, and re-deploy it in WSO2 ESB. You should try to avoid using management console to perform esb artifact (proxy services, endpoints, sequences, templates etc.) modifications. You can of course use the management console for other administrative tasks like configuring data-sources, BAM mediation data publishing etc.
If you are using the Management console to modify artifacts, then you can do that too, but avoid using CApps as the method of deploying esb artifacts. You should probably copy all the config xml files to relevant folders at $ESB_HOME/repository/deployment/server/synapse-configs/default/. And then go ahead with your modifications via mgt console.

WSO2 Ant CAR build task

I understand that WSO2 provides Maven plugin for building CAR files from command line.
Our organization uses ANT instead of Maven. And I noticed that WSO2 provides Ant Deployer task. Do they offer an Ant task for building CAR files as well?
Another question: is there any documentation on the CAR file structure?
Appreciate your help!
You can use Carbon Application aRchives (CAR) file to deploy applications to any WSO2 Carbon-based servers.
CAR files can be created from Carbon Application (C-App) projects.
C-App is an Aggregator Project for deploying items such as Axis2 services, ESB configurations, web apps etc.
A C-App artifact has a name, version and a (server) role. Such as EnterpriseServiceBus and ApplicationServer. Likewise, a C-App can have many artifacts. You can use WSO2 Developer Studio to create C-Apps easily. You choose the option to create a Carbon application in WSO2 Developer Studio dashboard once you have some applications for WSO2 Carbon based servers. Then you can right click the project and export as a CAR file.
The root of CAR file has the artifacts.xml, which describes each artifact in sub directories (sub projects) and dependencies. Each artifact directory also has an artifact.xml.
You can find information about CAR file from following links.
http://docs.wso2.org/wiki/display/ESB460/Browsing+Applications
http://docs.wso2.org/wiki/display/Carbon410/Introduction+to+Server+Roles
AFAIK, there is no ANT plugin to offer similar functionality.

Deploying Different WSO2 product as single carbon application project

I am using WSO2 DSS, ESB and BPS for my project.
They are working fine in respective servers. But my idea is to integrate DSS, ESB & BPS into one car file(or some other deployment archive file) and thus making the deployment easier.
I have a Carbon application project created in Developer studio which has DSS project, ESB Config project, BPEL workflow and a Web application in it.
When I export it, it exports only the ESB & BPS and excludes Web application.
Is there a way to generate one deployment archive which would contain all the mentioned project? And is it possible to deploy a java application in WSO2 server since it has tomcat in it?
Thanks in Advance.
You can deploy webapplications in WSO2 Application server. Refer this. There is a server role which is defined in the server and also in the CAR file for each deployable artifacts. So if you are going to use one server lets say application server with DSS,ESB and BPS installed you need to add DSS's ESB's and BPS's server roles so artifacts which has respective servers role can be deployed in bundled server. Please refer following for server role management.
http://docs.wso2.org/wiki/display/AS510/Introduction+to+Server+Roles
Q>
Is there a way to generate one deployment archive which would contain all the mentioned project?
Ans>> Yes. It is possible. Carbon Application Archive(CAR) file is the single deployable module to package all the above mentioned different artifacts type to a single deployable archive.
You can use either IDE or Maven to generate the CAR file for your artifacts. Please refer to Dev Studio Documentation for more information.
Q> And is it possible to deploy a java application in WSO2 server since it has tomcat in it?
Ans>> You can deploy a Java application in WSO2 Application Server but in order to do that you need to convert your application to a Web-Services since WSO2 provides mechanism to expose your applications as Web Services. For that you can use either Axis2 Web Service or Jax-WS web-Service.
WSO2 Developer Studio supports creation of Axis2 Web-Services as well as Jax-WS web services. Please refer to Axis2 Artifact and Jax-WS Artifact Documentation for more information.
Also if you have a Java based Web-Application, you may deploy that Web-Application in WSO2 Application Server and WSO2 Dev Studio supports implementing Web-Applications as well.
Thanks and Regards,
Harshana