Domanda

I have a BPEL process which catches any faults raised and assigns them to a variable:

<assign name="AssignFault">
  <copy>
    <from>ora:getFaultAsString()</from>
    <to>$myVariable</to>
  </copy>
</assign>

This puts the whole XML message, including tags, into the variable:

com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}
messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
parts: {{
summary=<summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): myServer/myService</summary>
,detail=<detail>Unable to access the following endpoint(s): myServer/myService</detail>
,code=<code>404</code>}

Is there any way of getting the individual element values, i.e. the text values contained in the "summary", "detail" and "code" tags? I'd like to assign the text of each to individual variables and do different stuff with them.

Thanks in advance for any assistance.

È stato utile?

Soluzione

I split the individual elements from the fault message using

<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;code&gt;"), "&lt;/code&gt;")</from>
<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;summary&gt;"), "&lt;/summary&gt;")</from>
<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;detail&gt;"), "&lt;/detail&gt;")</from>

... and then reassembled into something non-XML using the concat function.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top