Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Introducing WebLogic Cajun

Bringing Web Services to the Enterprise

While Web services possess the potential to completely change how applications and organizations are integrated, capitalizing on this innovative technology hasn't been easy. To truly leverage the potential of Web services, you need both an architecture that can handle enterprise integration challenges and a framework that enables developers possessed of varying skillsets to work together. BEA Systems is launching a new product designed to solve these problems - "Cajun". Cajun makes it incredibly simple for application developers to build sophisticated Web services.

This article introduces "cajun", and illustrates some of its major features and concepts. You'll see from the examples that "cajun" sets a new bar for developer productivity, ease-of-use, and Web-service sophistication.

Enterprise Class Web Services
SOAP, WSDL, and UDDI are the three major standards that form the foundation of Web services. Leveraging XML and existing Internet standards, these specifications describe how XML messages can be sent between applications (SOAP), provide a mechanism for describing the operations an individual Web service supports (WSDL), and establish a registry of Web services (UDDI).

Based on these standards, the Web services marketplace is flourishing. You can leverage Web services that let you check stock quotes, exchange profile information between Web sites, and check the traffic on your favorite highway - regardless of the platform you're using.

To date, these simple, synchronous Web services have commanded the attention of the marketplace. But Web services represent much more than just a way to exchange simple information over the Internet; their real power lies in the enterprise. Web services are a cross-platform, standards-based way to integrate systems (inside and outside a company's walls) in a way that's flexible and designed for change. Building Web services for the enterprise requires the right architecture and approach, as well as the infrastructure necessary to support it. In particular, enterprise class Web services have three main characteristics:

1. They're loosely coupled. Loosely coupled applications are flexible and can accommodate change over time. In an IT environment in which you need to integrate different applications built by different teams on different schedules using different technologies and platforms, you need a way to minimize the impact of change. With Web services, you can integrate applications based on a "public contract" that describes the XML messages applications will exchange, but leaves the underlying implementation details to each application. As long as applications continue to honor their "contract" they can change at will without breaking the integration.
2. They accommodate asynchrony. The real world doesn't consist entirely of systems that can immediately respond to any request. Any integration archicture must encompass human users, outside resources, and legacy applications - all of which are inherently better suited to asynchronous communication in most application scenarios.
3. They provide coarse-grained interfaces. By integrating at a business level - exchanging documents like POs and invoices instead of moving one piece of data from one application to another - Web services can have greater flexibility when the underlying implementation changes. This coarse-grained exchange of data is also much more network friendly, unifying the internal and external integration worlds.

The Enterprise Developer Organization
When used as an integration technology, Web services must be deployed on a trusted and secure, reliable, available, scaleable platform. "Cajun" provides the infrastructure to easily build Web services with these characteristics and deploy them on the WebLogic platform.

Bringing Web services to the enterprise also requires a platform that appeals to all constituents in the development organization. In most enterprises a small set of expert developers and architects is responsible for the overall enterprise architecture, creating reusable software components and building core business applications. For these users, the J2EE platform is the natural choice. The majority of developers, however, are focused on application and business logic rather than the architectural underpinnings of an enterprise. They're closer to the line of business, understand the requirements of an application, and are best at getting applications produced. These developers typically will write the code necessary to integrate existing components and expose new functionality through Web services.

By reducing the barriers of entry to programming with J2EE, "Cajun" brings the entire development organization onto the same platform. Moreover, "cajun" enables developers to focus on the tasks they do best. J2EE experts can focus on building enterprise components and applications with the knowledge that all developers in the organization can easily access them. The rest of the development organization can then focus on creating the Web services and procedural code necessary to build composite applications from these components. Time and energy can be directed to the real meat of the application, rather than the details of the J2EE APIs necessary to access components or the steps involved in calling an EJB.

"cajun" Architecture
"Cajun" includes two major components: a design-time tool that lets developers write Java code to implement Web services and a runtime framework that provides the Web services infrastructure, testing, debugging, and deployment environment for "cajun" applications.

The "cajun" Tool
The "Cajun" Integrated Development Environment (IDE) provides a complete environment for developing a Web service application. Standard features such as project management, syntax highlighting, code completion, and integrated debugging are all included. In addition, "Cajun" provides a unique visual approach to Web services. Figure 1 shows the "Cajun" Design View. The Web service under development appears at the center of the screen. Messages sent from the Web service client appear as events that can be handled by writing business logic code and additional resources are exposed as controls on the right.

The design view lets users graphically create new methods, set properties on controls, and specify the overall structure of a Web service and its relationship with the outside world. The goal is to enable developers to focus on writing business logic - the code that's executed in response to each incoming method - not the machinery of typical Java programming. The "Cajun" IDE supports two-way editing so any changes made through the graphical environment are reflected immediately in code and vice versa.

"Cajun" Controls
Controls are a key innovation that give developers easy access to enterprise resources and J2EE APIs. These APIs provide a tremendous amount of power and flexibility but are typically overkill for common tasks. The sophistication of J2EE is one of the main barriers to entry for most developers.

"Cajun" controls overcome this problem by simplifying APIs and reducing the amount of object-oriented programming necessary to access external resources. Instead of creating new objects or interfaces or having to learn the necessary Java to access a database or look up an EJB, controls appear as local objects with a simplified set of methods that can be called, and properties that can be set.

For example, "Cajun" has a database control that simplifies the JDBC API. Database administrators can create a reusable database control that links SQL statements with Java methods in a simple declarative fashion. Developers can then use these components to access database resources with a simple function call. These controls can be further customized or extended simply by adding a new SQL statement.

A code example of a method in a database control that executes a simple select statement follows:

/**
* @jws:sql statement::--
SELECT SCORE
FROM CUSTOMERS
WHERE SSN = {ssn}
::--
*/
int getScore (String ssn)
throws int getScore(String ssn);
A special "Cajun" javadoc annotation associates a SQL statement with a Java method. Once a method is on a control in this way, users of the control simply call the function to execute the SQL command.

"Cajun" currently provides controls to access databases, other Web services, EJBs, JMS queues, and applications exposed through the J2EE Connector Architecture. It also provides a timer control to help manage asynchronous events. You can see how both a Database and a Timer control are used in Listing 1.

Java Web Service Files
The meeting place between the design time tool and run-time framework is the Java Web Service (JWS) file. JWS files are standard Java files with annotations (expressed in the JavaDoc syntax) to express additional functionality. This format enables developers to write standard Java code, but provides a mechanism for the "Cajun" tool and framework to assist with more sophisticated tasks. Annotations are used to display the Web service and its properties graphically, and by the framework to generate the EJB and J2EE code to execute the Web service. By moving code generation out of the tool and into the framework, developers never have to manage and maintain code they didn't write.

"Cajun" uses annotations in a JWS file to encode everything from what SOAP style a Web service uses to how XML messages are converted into Java objects (see Figure 2). This approach is also a simple but powerful way to smooth the ramp between developer skill sets. Developers work in a simplified programming environment but still write standard Java code. This allows a J2EE expert to easily add value over time. Instead of rebuilding an application written in a procedural language when it hits performance or scalability limitations, expert developers can tune the original Java code.

The "Cajun" Framework
The "Cajun" framework is where the magic happens. Once a JWS file that contains all the business logic for a Web service has been created, the "Cajun" framework is responsible for generating the standard EJB code needed to implement it. Moreover, this framework exposes (through the annotations) functionality specifically designed to support building enterprise class Web services. In particular, "Cajun" assists by:

  • Managing asynchronous communication with a conversational metaphor. The "Cajun" framework automatically manages asynchronous message correlation and state management across messages in a conversation. Users can simply mark methods as starting, finishing, or continuing a conversation and the "Cajun" framework takes care of the details. A unique ID is automatically generated to identify the conversation, and any state (class member variables) defined in the Web service is managed persistently with entity Java beans. Conversations can be either two-way, in which the client sends SOAP messages to the "Cajun" Web service and that Web service executes an asynchronous callback to the client (again with a SOAP message), or one-way through a polling approach.
  • Enabling loose coupling with XML Maps and XML Script. "Cajun" uses simple, declarative XML maps to map between internal Java code and XML messages exchanged between Web services. Users simply indicate the structure of the desired method and associate XML fields with Java variables. For more sophisticated mapping tasks, developers can include ECMA script code in a map definition. "Cajun" has extended ECMA script with XML extensions to simplify access to XML data and enable complex structural or data transformations.
  • Enabling availability with JMS queues. To ensure availability under high load, Web services can take advantage of message buffers. Users simply mark a method as requiring a buffer, and the "Cajun" framework will handle creating a queue and wiring it to the Web service. This enables one-click access to sophisticated J2EE functionality.
  • Supporting the control architecture. The "Cajun" framework instantiates the implementation of any control used by the JWS. The framework also hooks up any asynchronous callbacks using a simple naming convention.

    The "Cajun" framework also enables a "write-and-run" approach to creating Web services. Much like Java Server Pages (JSP), JWS files are deployed the moment they're placed in the WebLogic Server applications directory. The framework is responsible for creating the necessary EJB and J2EE components (session beans to host application logic, entity beans to manage state, message queues to enable scalability, and so on) and deploying them. This entire process is transparent to users, giving those unfamiliar with WLS or J2EE the ability to create a Web service that takes advantage of all the major performance and scalability attributes of the WebLogic platform - connection pooling, caching, security, transaction management, and so on.

    In addition to deploying the Web service, the framework creates a Web page for each service that provides all the information necessary to use the service in another application - a Web Services Definition Language (WSDL) file - and a Java proxy that makes it easy to invoke the Web service from another Java application. Part of this Web interface is a complete test and monitoring system so that developers can immediately test a Web service for correctness and monitor messages as they are received by the service.

    Finally, the "Cajun" framework exposes a complete debugging environment that's accessible through the IDE. This lets a developer execute a Web service (that may be hosted on another machine) and step through the Web service code as it executes, watch variable values, and test expressions.

    Final Notes
    Listing 1 shows the complete source code for a very simple "Cajun" Web service.

    Investigate.jws defines a Web service at a credit bureau. This service provides both a synchronous method - investigateApplicant() - and an asynchronous method - investigateApplicantAsynch() - to determine whether an applicant should be offered credit. The synchronous method always returns a negative result immediately.

    investigateApplicationAsynch() is the more interesting version. In this method the code starts a timer (using the "Cajun" timer control) to simulate the delay in accessing a back-end system. When the timer fires 10 seconds later, the delayTimer_onTimeout()is invoked by the framework. In this function, we look up the credit score of the customer using a database control and make an asynchronous callback to the client to return the result.

    CreditReportDB.jwi includes a definition for a database control. Like the JWS files discussed above, JWI files are standard Java files with "Cajun" annotations that are used to define controls. Each method in the database control associates a Java method with an annotation used to define a SQL statement. The SQL statement can use variable names in squiggly braces to substitute parameters from the Java method.

    Conclusion
    As you've seen here, "Cajun" provides a complete tool set for building Web services in a fast and easy-to-use fashion. With the JWS format, control architecture, and write-and-run approach to deployment, "Cajun" brings the power of WebLogic to the entire development organization.

    Even more importantly, it provides developers with the infrastructure necessary to bring Web services into the enterprise - where the full potential of the technology can be realized.

  • More Stories By Carl Sjogreen

    Carl Sjogreen is senior product manager for BEA WebLogic Workshop, an integrated development framework that makes it easy for all developers – not just J2EE experts – to build enterprise class web services on the WebLogic platform. Carl has been involved with XML, Web services, and developer tools since 1998, when he founded Transformis, developers of the award-winning Stylus Studio IDE.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    "MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
    "Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    "Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
    "Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    "There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
    It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
    WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
    Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...