Using the BPEL Designer and Service Engine

Dynamic Partner Links and Dynamic Addressing

During the design-time of an application, you may need to configure certain services whose endpoints (addresses) are not known beforehand, or it may be necessary to change an endpoint reference while the application is running. The Dynamic Partner link feature allows you to dynamically assign an endpoint reference to the partner link. This means that you can use one partner link for subsequent calls to different web-services (provided that the services use the same interface).

See Using Dynamic Partner Links and Dynamic Addressing for additional use cases and more information.

Assigning an Endpoint Reference

Each partner link defines abstract information and concrete information. While abstract information, describing the web-service interface, should be static, the concrete information, such as the address and port, can be discovered and used dynamically.


Note –

For successful deployment of the process, a partner link should be completely defined. When you deploy the project, the WSDL file for the partner link should contain and define both the abstract and the concrete information for the partner link, including address and port, though later the concrete information can be changed independently from the WSDL file.



Note –

The BPEL specification mandates that only the partner endpoint reference (EPR) can be changed dynamically. In BPEL terms, only the partnerRole of a partner link element can have a new value assigned. The myRole value doesn't change after the BPEL has been deployed.


To assign a new endpoint reference to a partner link you can use the standard Assign activity and the BPEL Mapper.

The EPR information can be provided in several different ways:

Each of these options is explained in more detail in the advanced section of this book. For more information on each of these alternatives, see Using Dynamic Partner Links and Dynamic Addressing.

If you use an incoming message, an EPR schema should be defined as a part of the message in WSDL. To assign the EPR to a partner link, use the message variable.

ProcedureTo assign a new endpoint reference to a partner link from a variable:

  1. Create a new Assign activity in the process.

  2. Open the BPEL Mapper.

  3. In the target tree on the right, find the partner link to which you want to deliver a new concrete part.

  4. In the source tree, find a variable containing the new endpoint address.

    The address of the web-service can be defined in terms of different schemas, and the JBI container requires a special data type called ServiceRefType which is a simple wrapper for any endpoint-describing data type.

    To wrap your data:

    • In the mapper toolbar, choose BPEL -> Wrap with Service Reference.

      Wrap with Service Reference function
    • This function is a doXslTranform function that uses a predefined XSL-style sheet. A new concrete part is assigned to the partner link.

      New Endpoint Reference is Assigned to the Partner Link

    Note –

    The runtime supports only schemas included into WS-BPEL 2.0 specification. The WS-Addressing schema is not included in the BPEL specification and as a result it is not supported by the BPEL runtime. When the WS-Addressing schema is used for the first time it is copied from NetBeans global catalog to the BPEL Module project source root and further the project refers to the local copy of the schema. The adressing.xsd schema also appears among the Module's procees files in the Projects window.