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
    SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value S...
    SYS-CON Events announced today that Outscale will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Outscale's technology makes an automated and adaptable Cloud available to businesses, supporting them in the most complex IT projects while controlling their operational aspects. You boost your IT infrastructure's reactivity, with request responses that only take a few seconds.
    SYS-CON Events announced today that Peak 10, Inc., a national IT infrastructure and cloud services provider, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Peak 10 provides reliable, tailored data center and network services, cloud and managed services. Its solutions are designed to scale and adapt to customers’ changing business needs, enabling them to lower costs, improve performance and focus intern...
    The 21st International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
    Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with the 21st International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. @ThingsExpo Silicon Valley Call for Papers is now open.
    As cloud adoption continues to transform business, today's global enterprises are challenged with managing a growing amount of information living outside of the data center. The rapid adoption of IoT and increasingly mobile workforce are exacerbating the problem. Ensuring secure data sharing and efficient backup poses capacity and bandwidth considerations as well as policy and regulatory compliance issues.
    DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
    SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
    Five years ago development was seen as a dead-end career, now it’s anything but – with an explosion in mobile and IoT initiatives increasing the demand for skilled engineers. But apart from having a ready supply of great coders, what constitutes true ‘DevOps Royalty’? It’ll be the ability to craft resilient architectures, supportability, security everywhere across the software lifecycle. In his keynote at @DevOpsSummit at 20th Cloud Expo, Jeffrey Scheaffer, GM and SVP, Continuous Delivery Busine...
    SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
    SYS-CON Events announced today that DivvyCloud will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. DivvyCloud software enables organizations to achieve their cloud computing goals by simplifying and automating security, compliance and cost optimization of public and private cloud infrastructure. Using DivvyCloud, customers can leverage programmatic Bots to identify and remediate common cloud problems in rea...
    SYS-CON Events announced today that Tintri, Inc, a leading provider of enterprise cloud infrastructure, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Tintri offers an enterprise cloud platform built with public cloud-like web services and RESTful APIs. Organizations use Tintri all-flash storage with scale-out and automation as a foundation for their own clouds – to build agile development environments...
    SYS-CON Events announced today that Progress, a global leader in application development, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Enterprises today are rapidly adopting the cloud, while continuing to retain business-critical/sensitive data inside the firewall. This is creating two separate data silos – one inside the firewall and the other outside the firewall. Cloud ISVs ofte...
    SYS-CON Events announced today that Tappest will exhibit MooseFS at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. MooseFS is a breakthrough concept in the storage industry. It allows you to secure stored data with either duplication or erasure coding using any server. The newest – 4.0 version of the software enables users to maintain the redundancy level with even 50% less hard drive space required. The software func...
    SYS-CON Events announced today that EARP will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. "We are a software house, so we perfectly understand challenges that other software houses face in their projects. We can augment a team, that will work with the same standards and processes as our partners' internal teams. Our teams will deliver the same quality within the required time and budget just as our partn...
    SYS-CON Events announced today that Interoute has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Interoute is the owner operator of Europe's largest network and a global cloud services platform, which encompasses over 70,000 km of lit fiber, 15 data centers, 17 virtual data centers and 33 colocation centers, with connections to 195 additional partner data centers. Our full-service Unifie...
    SYS-CON Events announced today that Super Micro Computer, Inc., a global leader in compute, storage and networking technologies, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Supermicro (NASDAQ: SMCI), the leading innovator in high-performance, high-efficiency server technology, is a premier provider of advanced server Building Block Solutions® for Data Center, Cloud Computing, Enterprise IT, Hadoop/...
    SYS-CON Events announced today that Carbonite will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Carbonite protects your entire IT footprint with the right level of protection for each workload, ensuring lower costs and dependable solutions with DoubleTake and Evault.
    SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
    SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...