Using the BPEL Designer and Service Engine

Using an Incoming Message to Extract the Endpoint

To extract an endpoint address from an incoming message, the message must be defined with the endpoint schema as part of the message. The following code sample show one way that this can be done.


<types>
    <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/dynamicPL">
        <xsd:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
        schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing/"/>
            
    </xsd:schema>
</types>
<message name="dynamicPLOperationRequest">
    <part name="part1" element="wsa:EndpointReference"/>
</message>

Note that the prefix wsa is defined to point to http://schemas.xmlsoap.org/ws/2004/08/addressing.

Use this message variable to assign the endpoint to a partner link at runtime. A special BPEL mapper function, "Wrap with Service Reference" makes it easy to map the WS-A message to a partner link, as demonstrated below.

Image shows the Wrap with Service Reference BPEL Mapper
option

Choosing the BPEL Mapper option Wrap with Service Reference adds the doXslTransform method box to the Mapper canvas.

Image shows the doXSLTransform method box in the BPEL
Mapper

The doXslTransform Method box generates the BPEL doXslTransform() function, as shown in the code sample below.


<assign name="Assign1">
    <copy>
        <from>ns0:doXslTransform('urn:stylesheets:wrap2serviceref.xsl', 
$DynamicPLOperationIn.part1)</from>
        <to partnerLink="PartnerLink1"/>
    </copy>
</assign>

The stylesheet for the transformation is already defined by the editor.