Importing Process Definitions in BPEL 2.0

6-46 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite If you review the definition of the input variable and its payload part in the WSDL file, you go several levels down before coming to the definition of the addresses field. There you see the maxOccurs=unbounded attribute. The two XPath indexing methods are functionally identical; you can use whichever method you prefer.

6.19.2 How to Use SOAP-Encoded Arrays

Oracle SOA Suite provides support for SOAP RPC-encoded arrays. This support enables Oracle BPEL Process Manager to operate as a client calling a SOAP web service RPC-encoded that uses a SOAP 1.1 array. Example 6–85 provides an example of a SOAP array payload named myFavoriteNumbers. Example 6–85 SOAP Array Payload myFavoriteNumbers SOAP-ENC:arrayType=xsd:int2 number3number number4number myFavoriteNumbers In addition, ensure that the schema element attributes attributeFormDefault and elementFormDefault are set to unqualified in your schema. Example 6–86 provides details: Example 6–86 Schema Element Attributes attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=java:services xmlns:s0=http:schemas.xmlsoap.orgwsdl xmlns:xs=http:www.w3.org2001XMLSchema The following features are not supported: ■ A service published by BPEL that uses a SOAP array ■ Partially-transmitted arrays ■ Sparse arrays ■ Multidimensional arrays To use a SOAP-encoded array: Example 6–87 shows how to prepare SOAP arrays with the bpelx:append tag in a BPEL project. 1. Create a BPEL process in Oracle JDeveloper. 2. Prepare the payload for the invocation. Note that bpelx:append in Example 6–87 is used to add items into the SOAP array. Example 6–87 SOAP Array bpws:assign bpws:copy bpws:from variable=input part=payload query=tns:value bpws:to variable=request part=strArray query=strArrayJavaLangstring bpws:copy bpws:assign bpws:assign bpelx:append Manipulating XML Data in a BPEL Process 6-47 bpelx:from variable=request part=strArray query=strArrayJavaLangstring1 bpelx:to variable=request part=strArray query=strArray bpelx:append bpws:assign 3. Import the following namespace in your WSDL file. Oracle JDeveloper does not understand the SOAP-ENC tag if the import statement is missing in the WSDL schema element. xs:import namespace=http:schemas.xmlsoap.orgsoapencoding

6.19.2.1 SOAP-Encoded Arrays in BPEL 2.0

SOAP-encoded arrays are supported in BPEL projects that use version 2.0 of the BPEL specification. Example 6–88 shows a sample assign activity with a SOAP-encoded array in a BPEL 2.0 project. Example 6–88 SOAP-Encoded Array in an Assign Activity in BPEL 2.0 assign name=Assign_1 copy frominputVariable.payloadfrom toInvoke_1_echoArray_InputVariable.strArrayJavaLangstring[1]to copy extensionAssignOperation bpelx:append bpelx:from variable=Invoke_1_echoArray_InputVariable part=strArray bpelx:query JavaLangstring[1] bpelx:query bpelx:from bpelx:to variable=Invoke_1_echoArray_InputVariable part=strArray bpelx:to bpelx:append extensionAssignOperation assign Example 6–89 shows a sample invoke activity with a SOAP-encoded array in a BPEL 2.0 project. Example 6–89 SOAP-Encoded Array in an Invoke Activity in BPEL 2.0 invoke name=Invoke1 partnerLink=FileOut portType=ns3:Write_ptt operation=Write bpelx:invokeAsDetail=no toParts toPart part=body fromVariable=ArrayVariable toParts invoke

6.19.3 How to Determine Sequence Size

If you must know the runtime size of a data sequence that is, the number of nodes or data items in the sequence, you can get it by using the combination of the XPath built-in count function and the BPEL built-in getVariableData function.