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
    From 2013, NTT Communications has been providing cPaaS service, SkyWay. Its customer’s expectations for leveraging WebRTC technology are not only typical real-time communication use cases such as Web conference, remote education, but also IoT use cases such as remote camera monitoring, smart-glass, and robotic. Because of this, NTT Communications has numerous IoT business use-cases that its customers are developing on top of PaaS. WebRTC will lead IoT businesses to be more innovative and address...
    When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
    SYS-CON Events announced today that App2Cloud 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. App2Cloud is an online Platform, specializing in migrating legacy applications to any Cloud Providers (AWS, Azure, Google Cloud).
    IoT is at the core or many Digital Transformation initiatives with the goal of re-inventing a company's business model. We all agree that collecting relevant IoT data will result in massive amounts of data needing to be stored. However, with the rapid development of IoT devices and ongoing business model transformation, we are not able to predict the volume and growth of IoT data. And with the lack of IoT history, traditional methods of IT and infrastructure planning based on the past do not app...
    Internet-of-Things discussions can end up either going down the consumer gadget rabbit hole or focused on the sort of data logging that industrial manufacturers have been doing forever. However, in fact, companies today are already using IoT data both to optimize their operational technology and to improve the experience of customer interactions in novel ways. In his session at @ThingsExpo, Gordon Haff, Red Hat Technology Evangelist, shared examples from a wide range of industries – including en...
    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. Jack Norris reviews best practices to show how companies develop, deploy, and dynamically update these applications and how this data-first...
    Intelligent Automation is now one of the key business imperatives for CIOs and CISOs impacting all areas of business today. In his session at 21st Cloud Expo, Brian Boeggeman, VP Alliances & Partnerships at Ayehu, will talk about how business value is created and delivered through intelligent automation to today’s enterprises. The open ecosystem platform approach toward Intelligent Automation that Ayehu delivers to the market is core to enabling the creation of the self-driving enterprise.
    "We're a cybersecurity firm that specializes in engineering security solutions both at the software and hardware level. Security cannot be an after-the-fact afterthought, which is what it's become," stated Richard Blech, Chief Executive Officer at Secure Channels, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
    Consumers increasingly expect their electronic "things" to be connected to smart phones, tablets and the Internet. When that thing happens to be a medical device, the risks and benefits of connectivity must be carefully weighed. Once the decision is made that connecting the device is beneficial, medical device manufacturers must design their products to maintain patient safety and prevent compromised personal health information in the face of cybersecurity threats. In his session at @ThingsExpo...
    SYS-CON Events announced today that Grape Up 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. Grape Up is a software company specializing in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the U.S. and Europe, Grape Up works with a variety of customers from emergi...
    Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
    SYS-CON Events announced today that Massive Networks 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. Massive Networks mission is simple. To help your business operate seamlessly with fast, reliable, and secure internet and network solutions. Improve your customer's experience with outstanding connections to your cloud.
    Because IoT devices are deployed in mission-critical environments more than ever before, it’s increasingly imperative they be truly smart. IoT sensors simply stockpiling data isn’t useful. IoT must be artificially and naturally intelligent in order to provide more value In his session at @ThingsExpo, John Crupi, Vice President and Engineering System Architect at Greenwave Systems, will discuss how IoT artificial intelligence (AI) can be carried out via edge analytics and machine learning techn...
    Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution and join Akvelon expert and IoT industry leader, Sergey Grebnov, in his session at @ThingsExpo, for an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
    In the enterprise today, connected IoT devices are everywhere – both inside and outside corporate environments. The need to identify, manage, control and secure a quickly growing web of connections and outside devices is making the already challenging task of security even more important, and onerous. In his session at @ThingsExpo, Rich Boyer, CISO and Chief Architect for Security at NTT i3, discussed new ways of thinking and the approaches needed to address the emerging challenges of security i...
    SYS-CON Events announced today that Datera, that offers a radically new data management architecture, has been named "Exhibitor" of 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. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
    SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...
    SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
    Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
    In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...