Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
BPEL and Java Cookbook

You're reading from   BPEL and Java Cookbook Written by an SOA guru to help you orchestrate web services, the 100 recipes in this book will make integrating Java and BPEL a smooth process. Using the examples you'll avoid common problems and learn sophisticated techniques.

Arrow left icon
Product type Paperback
Published in Sep 2013
Publisher Packt
ISBN-13 9781849689205
Length 382 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jurij Laznik Jurij Laznik
Author Profile Icon Jurij Laznik
Jurij Laznik
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Calling BPEL from Java FREE CHAPTER 2. Calling Services from BPEL 3. Advanced Tracing and Logging 4. Custom Logging in the Oracle SOA Suite 5. Transforming and Validating the BPEL Services 6. Embedding Third-party Java Libraries 7. Accessing and Updating the Variables 8. Exposing Java Code as a SOAP Service 9. Embedding Java Code Snippets 10. Using XML Facade for DOM 11. Exposing Java Code as a Web Service Index

Gathering a BPEL process's in and out parameters

This recipe will explain the ways of getting input and output parameters about a BPEL process. The information gathered is very important if we want to call the BPEL process from Java applications.

How to do it…

We are deploying the BPEL process on the BPEL server. The business process is now ready to be executed; however, we don't have any information about the business process besides the WSDL location of the business process.

  1. In the Oracle Enterprise Manager Console, we select the BPEL process from the tree, and click on the following icon:
    How to do it…
  2. We receive information about the business process endpoint URI and a location of the business process WSDL as shown in the following screenshot:
    How to do it…
  3. By entering the WSDL address into the web browser, we receive a description of the BPEL process interface. In this definition, we check for the input and output messages as follows:
    <wsdl: message name = "HelloWorldProcessRequestMessage">
      <wsdl: part name = "payload" element = "client:process"/>
    </wsdl: message>
    <wsdl: message name = "HelloWorldProcessResponseMessage">
      <wsdl: part name = "payload" element = "client: processResponse"/>
    </wsdl: message>
    <wsdl: portType name = "HelloWorldProcess">
      <wsdl: operation name = "process">
      <wsdl: input message = "client: HelloWorldProcessRequestMessage"/>
      <wsdl: output message = "client:HelloWorldProcessResponseMessage"/>
      </wsdl:operation>
    </wsdl:portType>
  4. The most interesting part of WSDL is the <wsdl:operation> element, which indicates the entry point, the functionality, and the input and output messages of the BPEL process. We see that the input and output parameters both have a defined message in the client namespace, which is defined as the XSD schema. We can find its location in WSDL under the <import> tag. We search for the client: process input parameter in the XSD schema:
    <element name="process">
      <complexType>
        <sequence>
          <element name="input" type="string"/>
        </sequence>
      </complexType>
    </element>
  5. As we can see, the input parameter takes the string variable with the name input. Similarly, we explore the output parameter client: processResponse in the XSD schema as follows:
    <element name="processResponse">
      <complexType>
        <sequence>
          <element name="result" type="string"/>
        </sequence>
      </complexType>
    </element>
  6. The BPEL process will return the string variable named result.

How it works…

In general, there are two approaches to designing the BPEL processes. The first one is the top-down approach, where we first develop the XSD schema and WSDL files, which is also called the contract-first approach . The next one is called the bottom-up approach, where we start from the already-written Java code and generate the XSD schema and WSDL files with tools.

The recommended approach when designing the BPEL processes is to first define the XSD schema, which contains the definition of the input and output parameters. This is also the proper place to put the various complex variables used in the business process.

The schema is later used by WSDL to define the BPEL process interface via the <wsdl: portType> element. Both WSDL and the XSD schema are packed into the deployment package and deployed to the BPEL server.

Note

The definition of the input and output parameters in the XSD schema is not mandatory. We can easily define them in WSDL of the BPEL process. However, we lose some of the readability of the WSDL document. Note that such an approach is bad practice and is not recommended, since it hinders the reusability of the XML data types and elements.

See also

  • To learn about the deployment of a BPEL process, refer to the previous recipe, Deploying a BPEL process
You have been reading a chapter from
BPEL and Java Cookbook
Published in: Sep 2013
Publisher: Packt
ISBN-13: 9781849689205
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image