best practice for axis2 client projects in wso2 - 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.

Related

SOA Suite - How to automatically enable Web Service Rest support after composite deploy

I have a composite with a SOAP web service entry point running on SOA Suite. We will have a new client for that web service, but this client cannot speak SOAP, so we will have to publish that entry point on a REST endpoint. I know I can enable REST Support to the existing web service through EM console, but I would like to have this configuration enabled by default after deploy.
My research for ways to do that using a property or attribute on a configuration plan did not get useful informations.
Does anyone know how could I achieve that?
Thanks!
REST Support is formal part of SOA Suite 12c. Download and install that and then you can easily add a REST interface to a SOAP composite. Also, 12c now installs without RCU/DB, etc - just start the Integrated WLS domain in JDev and it builds itself and you are up and deploying in under 20 mins. And this may help.

WSO2 AS guice integration

I am using WSO2 application server to deploy my web services. I would like to use guice in my project. I have read a maksim blog about axis2 guice integration. He has used web.xml for injection however i do not know how could i change web.xml in wso2 as.
Thanks
You didn't want to change web.xml on WSO2 AS. You can have web.xml on your WS project.
here is complete guide on developing WS and how to deploy on WSO2 AS using WSO2 Developer Studio.
http://wso2.com/library/articles/2012/09/develop-deploy-web-applications-using-wso2-developer-studio/
Using WSO2 DS you can ease your development effort.
There is no much difference. You implement your webservice/webapp. Web.xml is the part of your webapp . Create the war file and deploy that in AS. Keep the dependency jars(guice lib etc ..) in the repository/components/lib folder.

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

webservice application in Demandware

I need to develope WAS application and should be hosted into Demandware platform. Can i develop the WAS application using tomcat and can host it into the Demandware or should WAS application be developed in the Demandware platform?
I am new to Demanware platform and WAS. Guide me.
You cannot build a web service outside of the UX Studio paradigm like what you described, but you can build a psuedo-service like pipeline in UX Studio that returns JSON, XML, etc. and it will work more or less just like any other REST service.
Demandware is Software as a Service (SaaS) provider, which will not allow you to access the underlying infrastructure (e.g. Tomcat server, Oracle DB, etc.) to make/install your custom extensions.
UPDATE (25.09.2015):
Currently Demandware are making extensions to their controllers, migrating from pipeleine-based controllers to script based ones. Chances are that at some point they may even introduce an API for creating web-services.
Until this happens, your only option is to make some custom pipelines and utilize something like XML/JSON over HTTP for this type of functionality. (Or if you insist on having it as SOAP based service, you would need to parse the SOAP envelopes with explicit code)
Demandware platform is a proprietary technology which allows developing only using their sandboxes and own IDE "UX Studio". All this stuff is available for demandware developers on their xchange portal. Access there could be requested by a merchant you do a development for.
Demandware has the core framework is closed to third parties and is exposed via the Demandware script and REST API's as well as Demandware's own Pipelet system.
Sadly you can't deploy external application in Demandware server, we have to separately create new app in UX studio
You can get the proper help on Demandware Wiki or on Exchange