This post is a follow up on the post where we described how to propagate a transaction from WebLogic 11g (WLS) to WebSphere 8 (WAS). Post is located here: http://www.soa.si/2011/12/20/how-to-propagate-a-global-transaction-between-oracle-weblogic-11g-and-ibm-websphere-8-0-using-ws-at/. It is describing transaction propagation in the opposite direction from WLS to WAS using WS-Atomic Transactions.

In this follow up I will describe transaction propagation from WAS to WLS using WS-AT.  I am using the same two JAX-WS Web Services as are used in the previous post. One is deployed on WAS and one on WLS. They both contain operation insert() which we use for inserting a record in a database table. For this each environment uses a separate database and has configured a corresponding XA Data Source. We implemented additional JAX-WS Web Service facade. Its role is to start a global transaction and invoke other two services inside this transaction.

 

 


Main steps:

  • From the previous post we use XA-enabled data source and both web services that participate in a global transaction.
  • Next step is to configure WAS transaction service for interoperability and proper WS-AT version (we used WS-AT version 1.2) using WAS administrative console.
  • We can also configure WAS to use Secure Socked Layer connection for WS-AT coordination or disabling it in case we do not want to use it.
  • Implement the facade Web Service. There we are calling both web services in one global transaction which is controlled using Java Transaction API (JTA). Both service clients must have attached proper WS-AT policy. We also recommended using WS-Addressing.

No tags Hide

This article serves as a tutorial on how to develop Web Service using Axis2 and JAXB XML data binding.

Current version of Axis2 framework at the time of writing this tutorial is 1.6.1. Its integration in Eclipse java development tool supports two types of wizards for creating web services: Web Service Wizard and Web Service Client Wizard. Using these two wizards enables us to build client-side and server-side web service artefacts for Axis2. Its preferences include selecting XML data binding type. Supported types in these wizards are ADB and XMLBEANS. Although when using supplied Web Service wizards there are only those two supported data bindings in fact Axis2 also supports JiBX and JAXB data bindings.

Because the standard development of Web Services compliant to JAX-WS 2.1 is using JAXB 2.0 data binding we will show how to develop web services under these technologies. For this we will not use supported wizards, but WSDL2Java command line tool. This tool is supplied in downloaded Axis2 package. Be aware that WAR (Web Archive) Axis2 distribution does not include mentioned tool.

For this tutorial we will develop a Top Down Web Service from supported WSDL.

We will assume that we already have installed Tomcat server version 7.

Preparing Eclipse environment.

To prepare Eclipse environment for implementing our web service we must set Axis2 runtime location. In Eclipse we enter “Preferences” (Window -> Preferences), than we navigate to “Web Services” -> “Axis2 Preferences”, where we set “Axis Runtime Location” to the location of extracted Axis2 folder (Image below). After this we can also prepare User Libraries under “Java” -> “Build Path” -> “User Libraries” where we first add new Library, and then we add all JAR files from “lib” directory under extracted Axis2 directory to this library.

After this we must add AXIS2_HOME environment variable (assuming we already have JAVA_HOME environment variable set) which points to installation directory of Axis2 e.g. “C:\axis2-1.6.1”.

Preparing project for developing Web Service.

We will develop our sample Web Service into Dynamic Web Project. For creating project with support for Axis2 we must select proper facets. We can do this when creating new “Dynamic Web Project” using button “Modify” (Image below).

We must select “Axis2 Web Services”. Since current version of Axis2 runs on Servlet version 2.5 or less it is also necessary to change “Dynamic Web Module” version to 2.5. Note that this is not necessary if we are using target runtime that does not support Web Module higher than 2.5.

At this stage we have prepared our project for building a web service.

Preparing WSDL Web Service description.

For the purpose of this tutorial creating WSDL description does not hold high priority. That is why we will skip the part of creating one and will use one supported on this link: WeatherServiceWSDL

Generating Java skeleton.

As mentioned earlier in this tutorial we will use WSDL2Java command line tool (we can find it in axis2 installation directory under directory “bin”). For generating Java Skeleton classes we will use the following command shown on image below:


wsdl2java.bat –o C:\EclipseWorkspaces\DefaultWorkspace\WeatherService -ss -d jaxbri -uri C:\WeatherService.wsdl

Attributes explanation:

  • o – Path where Java skeleton will be generated (usually web project path).
  • ss – Marks generating server side artefacts
  • d – Selected data binding for generating Java skeleton, “jaxbri” marks JAXB Reference Implementation data binding.
  • uri – supported is local disk path or URL of WSDL file.

Implementation.

After generation Java skeleton we must implement web service. Image below shows generated classes.

Implementation classes are named “*Skeleton.java”. There we implement generated method that represents our Web Service operation. Note that sometimes it is necessary to refresh file list in Eclipse Project Explorer for generated files to be visible.

Packaging Web Service.

When generating web service Java Skeleton, WSDL2Java tool also creates ant build file for building and packaging generated web service. This file is “build.xml”. Our next task is to run this Ant task. For the purpose of this tutorial we will add a builder that uses generated Ant task to prepare our web service for deployment. Another option would be manually running this task with Ant.
This we will do by Right Clicking on project that holds generated classes and selecting “properties”. Under “builders” we add new Ant builder. Only thing we must do when configuring this builder is to select build file. We must select generated “build.xml” file as seen on image below. Recommended is also to change builder name.

After setting new builder we see build log on console. Building must be successful.

Deploying Web Service.

Result of successful building is Axis Archive package, which includes build web service. Procedure in previous stage creates this kind of package under “build/lib” folder in our project. Archive name in the case of this tutorial is “WeatherService.aar” and it includes developed services class files. We have different possibilities on how to deploy Web Service packed this way. We can deploy it under Axis administrative console, or we can manually add it to Axis service repository. For the purpose of this tutorial we will manually deploy it on Axis runtime which has been already added into our project at stage 2. We must do two things. First one is copying Axis archive file, in our case is “WeatherService.aar” to “WebContent/WEB-INF/services” folder that represents Axis2 repository. Next step is to add “WeatherService.aar” into “services.list” text file situated in the “services” folder.

Files used at this stage of the tutorial are shown in image below.

Running Web Service.

After completed all this steps successfully, we are now able to test developed Web Service. WSDL should be accessible, when using default configuration, at address like: http://localhost:8080/WeatherService/services/WeatherService?wsdl

Source Project

You can download a Eclipse snapshot of this project from this link: WeatherService

, , , Hide

Oracle Node Manager brief overview

In this blog post I will provide a brief introduction on one of the important components of Oracle WebLogic Server called Oracle Node Manager. WebLogic Server instances are in production environment often highly distributed, usually across multiple domains, machines, or even geographic locations. Oracle Node Manager is intended to simplify and centralize control options over those distributed instances. It provides us with abilities to start, stop or restart Administration Server and various Managed Server instances from remote location using a graphical interface. Node manager is optional, but highly recommended in WebLogic Server environment. It is one of the key features of Oracle Cloud Application Grid technologies.

(more…)

No tags Hide

4. April 2011 – Standards organisation IEEE (Institute of electrical and Electronics Engineering) is starting to face cloud interoperability issues with hopes to minimize cloud fragmentation.

According to IEEE Cloud Computing Initiative, “cloud computing today is very much like the nascent Internet – a disruptive technology and business model that is primed for explosive growth and rapid transformation. But without a flexible, common framework for interoperability, innovation could become stifled, leaving us with siloed ecosystem” the organisation warns. As part of this IEEE initiative two working groups are formed, P2301 and P2302. P2301 will aim to provide profiles in critical areas such as portability, management and interoperability interfaces as well as file formats and operation conventions while group P2301 will focus on cloud-to-cloud interoperability and federation. It will, for example, work on standardizing gateways that can handle data exchange between clouds.

At the moment number of organisations are working to standardize cloud computing. Even the European Commission got involved, stating that users must be able to change their cloud provider as fast and easily as changing one’s Internet or mobile-phone provider has become in many places. Formal consultations on European cloud computing will take place in Brussels on May 23.

In general, standardisation in the cloud is an extremely good thing. It will allow enterprises to use cloud computing more effectively and with more confidence, but there is also a risk that defining how things should work could have an opposite effect and stifle innovation, according to David Bradshaw, research manager of European SaaS and cloud services at IDC.

Bradshaw also hopes that they all have good sense to work together and avoid different islands of standards. The platform level (PaaS) is the area where the need for standardization is the most urgent, allowing companies to move workloads from one cloud vendor to another.

The IEEE’s Cloud Computing Initiative is being led by EMC’s Steve Diamond and at the head of working groups is David Bernstein, managing director at the consultancy firm Cloud Strategy Partners.

No tags Hide