WSO2 Ant CAR build task - wso2

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.

Related

WSO2 - Uploading "Registry Resources Project" onto ESB Server

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.

How to run WSO2 EMM Jaggery Web App in a WSO2 EMM Carbon Server?

I have been using WSO2 EMM product for a while. I imported emm jaggery web app project, which is located under modules/apps/ folder. into the WSO2 Eclipse Developer Studio and it is imported as a regular jaggery web app project.
I want to quickly change and run just the emm jaggery web app project (lets say some hbs files, page-layout etc.) and quickly review the impacts of the new design. Is there a way to do this quickly?
Best
You can simply do this by changing the necessary files then reloading the emm project from web-browser as you normally do for other web applications written in HTML, js & css. This can be tested by changing the files in emm jaggery application in WSO2 EMM product & there is no need for using a separate server.
Finally i have found a simple solution to reflect the Jaggery Web App changes to the running system via symbolic links.
After you have build the system successfully, the zip archive file is created at the product-emm/modules/distribution/target/wso2emm-1.1.0 directory.
Unzip the file and for linking Jaggery Web Apps locate to the product-emm/modules/distribution/target/wso2emm-1.1.0/repository/deployment/server/jaggeryappsdirectory where the web applications are bundled.
And give symbolic links by removing the old bundled ones and linking apps like ln -s ../../../../../../../apps/emm/ . to the product-emm/modules//apps/ location where the real development is going on.
Final picture will look like something like this. After this you can change the code and see the effect without reloading the server.

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.

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

best practice for axis2 client projects in wso2

I have a WSO2 Axis2 Service project, that has a dependency on five other web services. I have generated the service with WSO2 developer studio 2.1, so the service is a maven project.
If I use the developer studio wizard for creating the axis2 client projects, the wizard creates the clients as eclipse projects, and not a maven projects.
I am thinking that it would be cleaner for me to create each client project from scratch as maven projects (using the wsdl2code plugin) rather than use the developer studio wizard. These five maven client projects can then be added as dependencies to the service project.
What is the best practise for managing the relationship between service and client code in WSO2 projects?
It depends on the use case. Developer Studio is really helpful for someone with limited knowledge to start with and also with its wizards you do not miss the steps that are essential in completing end scenario. But in your particular use case where you need to generate lots service stubs it will be easy to use Maven and automate client stub generation. In WSo2 we generate lots of service stubs and use Maven to automate that. .If you need more governance on that you can use some repository to manage WSDLs and then use maven plugin to pick wsdls from there. So whenever you change your service your client stubs will reflect those changes.