Getting root element twice using ora:parseEscapedXML(bpws:getVariableData(

Bpel reads a normalised message as an input but when try parsing the normalised message to take the xml data from its payload using BPEL function
ora:parseEscapedXML(bpws:getVariableData('NormMsg','payload','/ns3:NormalizedMessage/ns3:Payload/ns3:CharacterData'))
the xml generated as an output has root element occuring twice
<Transaction-101 xmlns="urn:oracle:integration:b2b:643F5D34AAD44B18A36DD19E798FD085">
<Transaction-101 xmlns="urn:oracle:integration:b2b:643F5D34AAD44B18A36DD19E798FD085" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" XDataVersion="1.0" Standard="X12" Version="V4010" CreatedDate="" CreatedBy="" GUID="">
<Internal-Properties>
<Data-Structure Name="Interchange">
kindly reply as soon as possible
Edited by: user10264394 on Apr 9, 2009 5:58 AM
Edited by: user10264394 on Apr 9, 2009 6:02 AM

Hello,
I have the same problem - parseEscapedXML creates double headers if used after getContentAsString (if my payload has special characters parseEscapedXML fails). I used parseXML - it didn't work. And assigning TO level higher didn't work either. I used substring-before(substring-after,..),..) on a payload before applying parseEscapedXML and it solves the problem. But it doesn't seem like a very clean solution. I am new to BPEL. Could somebody advise, please?
Here is my assignment:
<assign name="AssignCustomerEmailEnqueueInput">
<copy>
<from expression="substring-before(substring-after(bpws:getVariableData('QueryRestartOutput','RestartCollection','/ns5:RestartCollection/ns5:Restart/ns5:payload'), '&lt;CUSTOMEREMAILMSG xmlns=&quot;http://xmlns.oracle.com/xdb/FIS&quot;>'), '&lt;/CUSTOMEREMAILMSG>')"/>
<to variable="QueryRestartOutput"
part="RestartCollection"
query="/ns5:RestartCollection/ns5:Restart/ns5:payload"/>
</copy>
<copy>
<from expression="ora:parseEscapedXML(ora:getContentAsString(bpws:getVariableData('QueryRestartOutput','RestartCollection','/ns5:RestartCollection/ns5:Restart/ns5:payload')))"/>
<to variable="CustomerEmailQueueInput"
part="CUSTOMEREMAILMSG"
query="/ns8:CUSTOMEREMAILMSG"/>
</copy>
<copy>
<from expression="substring-before(substring-after(ora:getContentAsString(bpws:getVariableData('CustomerEmailQueueInput','CUSTOMEREMAILMSG','/ns8:CUSTOMEREMAILMSG/DOCUMENT')), '&lt;DOCUMENT xmlns=&quot;&quot;>'), '&lt;/DOCUMENT>')"/>
<to variable="CustomerEmailQueueInput"
part="CUSTOMEREMAILMSG"
query="/ns8:CUSTOMEREMAILMSG/DOCUMENT"/>
</copy>
</assign>
The third copy is there because on ocasion I get double headers on <DOCUMENT..> which is inside payload variable. Does anybody know why it's doing it? Does it depend on XML itself (double header is not always created)?
Thanks,
Yulia

Similar Messages

  • How to use ora:parseEscapedXML() Function with String Content

    Hello,
    I am receiving a ResponseMessage that returns a string, but the content of the string is actually XML. I have tried to use the ora:parseEscapedXML() function to parses the string (see XML Fragment below) to return structured XML data that can be assigned to typed BPEL variables. The documentation is very limited for this (I've looked in the Developer Guide draft that is available at the OraBPEL site).
    2 customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    The copy rule for assigning CustNum to accountnumber that fails:
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('DataService_OutputVariable','invokeSpecMsgReturn','/recordset/customer/CustNum'))"/>
    <to variable="outputVariable" part="payload" query="/client:QueryResult/client:customer/client:accountNumber"/>
    </copy>
    Any help would be greatly appreciated.
    Thanks,
    Sean

    Hello,
    I am attempting to provide more information in order to hopefully get some better guidance here.
    1) The BPEL process I built receives input from a client that is one of city name or region name or postal code or country name and returns a list of customer records with their AccountNumber, LastName, FirstName, Email, Address, City, Region, PostalCode and Country. The BPEL flow invokes a packaged integration Web Service that retuns the records in a string whose content is XML (see XML fragment below).
    2) The string content returned is vaiable based on the input (i.e. city name="London")
    Two customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    I want to <assign> each record from the packaged integration service result (the string whose content is XML) to a complexType variable defined within the BPEL Process WSDL (see example below).
    XML fragment from BPEL WSDL:
    <element name="QueryResult" type="client:recordType"/>>
    <complexType name="recordType">
    <sequence>
    <element name="customer" type="client:customerType" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="customerType">
    <sequence>
    <element name="accountNumber" type="string"/>
    <element name="lastName" type="string"/>      
    <element name="firstName" type="string"/>
    <element name="email" type="string"/>
    <element name="address" type="string"/>
    <element name="city" type="string"/>
    <element name="region" type="string"/>
    <element name="postalcode" type="string"/>
    <element name="country" type="string"/>
    </sequence>                         
    </complexType>
    I have read through the tutorial and reviwed the XPath Funtion example in the reference (C:\OraBPELPM_1\integration\bpelpm\orabpel\samples\references\XPathFunction), but I am stsill very unclear as to how to handle this. I would appreciate any and all help.
    Thanks,
    Sean

  • Error While trying to Get XML element(tag) Values

    We are trying to get XML element (TAG) value from the XML pay load.
    Example.
    Getting XML String from a web service and then converting into XML payload.
    ora:parseEscapedXML(bpws:getVariableData('signOn_Out','signOnReturn'))
    From this XML payload we are trying to get an element (Tag) value.
    We are getting following error
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@118dc2a
    {http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Here are signOnReturn and XML Payload XSD's
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web1"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="Web1ProcessRequest">
              <complexType>
                   <sequence>
                        <element name="userName" type="string"/>
    <element name="password" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="Web1ProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    <?xml version="1.0" encoding="windows-1252" ?>
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="TProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
    <element name="User">
    <complexType>
                   <sequence>
                        <element name="Id" type="string"/>
    <element name="CompanyId" type="string"/>
    <element name="SecurityToken" type="string"/>
    <element name="FirstName" type="string"/>
    <element name="LastName" type="string"/>
    </sequence>
    </complexType>
    </element>
                   </sequence>
              </complexType>
         </element>
    </schema>

    I am sure and can see the data in audit trail.
    [2006/12/12 09:17:36]
    Updated variable "signOn_Output"
    - <signOn_Output>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <WebMethodsProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </WebMethodsProcessResponse>
    </part>
    </signOn_Output>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "tririga"
    - <tririga>
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </tririga>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "Variable_2"
    - <Variable_2>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </part>
    </Variable_2>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@1c8768e
    Copy details to clipboard
    [2006/12/12 09:17:36]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Copy details to clipboard

  • Ora:parseEscapedXML error when trying to execute

    Hi,
    I have tried implementing the ora:parseEscapedXML function, I have used the following expression to copy the data in the CODE node to a variable also called CODE.
    ora:parseEscapedXML(bpws:getVariableData('inputVariable','payload','/client:TestXML2ProcessRequest/client:input','/Acc_Type/code'))
    I get the following error message:
    ORABPEL-09500 XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:parseEscapedXML(bpws:getVariableData('inputVariable','payload','/client:TestXML2ProcessRequest/client:input','//Acc_Type/code'))", the reason is FOTY0001: type error. Please verify the xpath query.
    I am not sure if the format of my expression is correct especially - '/Acc_Type/code'
    Thanks

    ora:parseEscapedXML(bpws:getVariableData('inputVariable','payload','/client:testBPELProcessRequest/client:input'))
    This one is generated for me when i create the assign.
    I think the last part is wrong :
    ora:parseEscapedXML(bpws:getVariableData('inputVariable','payload','/client:TestXML2ProcessRequest/client:input/somenamespaceheretoo:Acc_Type/somenamespaceheretoo:code'))
    does this one work?
    i think you need just 1 xpath query on the end

  • About ora:parseEscapedXML(String contentString)

    Where can I find more documentation on each specific expression? Web service returns a String (which is a XML document). We are trying to consume it in BPEL as XML document. I couldn't get this parsing function work though. Can anyone give a pointer or two?
    Thanks,
    Wen

    Hi Wen,
    Look at the XPathFunction sample to see an example of the usage at "OracleAS\bpel\samples\references\XPathFunction".
    We have also successfuly used this funktion to convert the result of a webservice (string containing the xml-structure) into a xml document.
    BPEL code snippet
    <assign name="expandResult">
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('invokeWizardOutput','closeWoResponse','/ns5:closeWoResponse/ns5:fi_datum'))"/>
    <to variable="wizardOutputExpanded" query="/ns5:closeWoResponse_Expanded/ns5:If"/>
    </copy>
    </assign>
    If i look at the flow in the bpel-consol my result looks like this:
    BEFORE:
    <invokeWizardOutput>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="closeWoResponse">
    <types:closeWoResponse xmlns:types="http://schema.kabeldeutschland.de/interface/ProvisioningInterface/WizardAPITypes">
    <types:tpRetCode>0</types:tpRetCode>
    <types:tpErrno>0</types:tpErrno>
    <types:tpErrDetails/>
    <types:fi_datum><?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?><If version="5.02.10.00_6051"><closeWoOut><meldungen><meldung><code>0</code><text>OK</text></meldung></meldungen></closeWoOut></If></types:fi_datum>
    </types:closeWoResponse>
    </part>
    </invokeWizardOutput>
    AFTER:
    <wizardOutputExpanded>
    <closeWoResponse_Expanded xmlns="http://schema.kabeldeutschland.de/interface/ProvisioningInterface/WizardAPITypes">
    <If version="5.02.10.00_6051">
    <closeWoOut xmlns="">
    <meldungen>
    <meldung>
    <code>0</code>
    <text>OK</text>
    </meldung>
    </meldungen>
    </closeWoOut>
    </If>
    </closeWoResponse_Expanded>
    </wizardOutputExpanded>

  • Pass XML inside ora:parseEscapedXML

    How to pass XML inside ora:parseEscapedXML ?? Like
    ora:parseEscapedXML(' <PersonalDetails><FirstName></FirstName><PreferredName></PreferredName><Nationality></Nationality></PersonalDetails>')
    It works fine. But problem is how to get variable values inside <FirstName></FirstName> ? Like <FirstName> some variable </FirstName>.
    Thanks

    Hi ,
    assign the xml content to the string variable like ex:ErrorData then call the ora:parseEscapedXML function like ora:parseEscapedXML(bpws:getVariableData('ErrorData')) to another string variable.
    ex with out parseEscapedXML ..the xml looks like this
    <ErrorDataStr>
    <ErrorDataStr xsi:type="ns:string">*<parameters xmlns:ns1="http://www.testing.com/ErrorReport" xmlns="http://www.testing.com/ErrorReport">*<ns1:item><ns1:ProcessInfo>n</ns1:ProcessInfo><ns1:BusinessProcessName>a</ns1:BusinessProcessName><ns1:BusinessProcessInstanceId>a</ns1:BusinessProcessInstanceId><ns1:BusinessProcessStep>a</ns1:BusinessProcessStep><ns1:ImplementationCode>ss</ns1:ImplementationCode><ns1:StatusCode>s</ns1:StatusCode><ns1:ErrorCode>s</ns1:ErrorCode><ns1:ErrorDescription>s</ns1:ErrorDescription><ns1:ErrorType>s</ns1:ErrorType><ns1:ErrorDateTime>3-oct-2011</ns1:ErrorDateTime></ns1:item></parameters></ErrorDataStr>
    </ErrorDataStr>
    using parseEscapedXML --xml file looks like this
    <ErrorDataStr>
    <ErrorDataStr>
    <ns1:item>
    <ns1:ProcessInfo>n</ns1:ProcessInfo>
    <ns1:BusinessProcessName>a</ns1:BusinessProcessName>
    <ns1:BusinessProcessInstanceId>a</ns1:BusinessProcessInstanceId>
    <ns1:BusinessProcessStep>a</ns1:BusinessProcessStep>
    <ns1:ImplementationCode>ss</ns1:ImplementationCode>
    <ns1:StatusCode>s</ns1:StatusCode>
    <ns1:ErrorCode>s</ns1:ErrorCode>
    <ns1:ErrorDescription>s</ns1:ErrorDescription>
    <ns1:ErrorType>s</ns1:ErrorType>
    <ns1:ErrorDateTime>3-oct-2011</ns1:ErrorDateTime>
    </ns1:item>
    </ErrorDataStr>
    </ErrorDataStr>

  • Load xml - xls with OWB error "ORA-20011:....Start of root element expected

    Hi
    I need to load XML document into a table in Oracle warehouse builder.
    I've followed the steps as given in the user guide and I get the following error,
    ORA-20011: Error occurred while loading source XML document into the target database object PURCHASE_ORDERS.
    Base exception: Start of root element expected.
    ORA-06512: at "DC_DWH.WB_XML_LOAD_F", line 12
    ORA-06512: at "DC_DWH.WB_XML_LOAD", line 4
    ORA-06512: at line 7
    The steps are:
    DECLARE
    CONTROL_INFO VARCHAR2(200);
    BEGIN
    CONTROL_INFO := '<OWBXMLRuntime> <XMLSource> <file>c:\xml_test\y.xml</file> </XMLSource> <targets> <target XSLFile="c:\xml_test\y.xsl" dateFormat="yyyy.MM.dd">PURCHASE_ORDERS</target> </targets></OWBXMLRuntime>';
    DC_DWH.Wb_Xml_Load ( CONTROL_INFO );
    COMMIT;
    END;
    where:
    ------------- y.xml ----------------
    <purchaseOrder>
    <id>103123-4</id>
    <orderDate>2000-10-20</orderDate>
    <shipTo country="US">
    <name>Alice Smith</name>
    <street>123 Maple Street</street>
    <city>Mill Valley</city>
    <state>CA</state>
    <zip>90952</zip>
    </shipTo>
    <comment>Hurry, my lawn is going wild!</comment>
    <items>
    <item>
    <partNum>872-AA</partNum>
    <productName>Lawnmower</productName>
    <quantity>1</quantity>
    <USPrice>148.95</USPrice>
    <comment>Confirm this is electric</comment>
    </item>
    <item>
    <partNum>845-ED</partNum>
    <productName>Baby Monitor</productName>
    <quantity>1</quantity>
    <USPrice>39.98</USPrice>
    <shipDate>1999-05-21</shipDate>
    </item>
    </items>
    </purchaseOrder>
    -----------------y.xsl -------------------
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes">
    <SHIPTO_NAME>
    <xsl:value-of select="purchaseOrder/shipTo/name"/>
    </SHIPTO_NAME>
    <SHIPTO_STREET>
    <xsl:value-of select="purchaseOrder/shipTo/street"/>
    </SHIPTO_STREET>
    <SHIPTO_CITY>
    <xsl:value-of select="purchaseOrder/shipTo/city"/>
    </SHIPTO_CITY>
    </xsl:stylesheet>
    Any help is appreciated

    Hello,
    The error occurs as far as your XSL file has incorrect structure. Your have to transform incoming XML in so-called (by Oracle) canonical form i.e.:
    <ROWSET>
    <ROW>
    <FIELD_1>value-for-field-1</FIELD_1>
    <FIELD_N>value-for-field-N</FIELD_N>
    </ROW>
    </ROWSET>
    So, assuming your table has three fields : SHIPTO_NAME, SHIPT_STREET, SHIPTO_CITY, - your XSL file should look like following:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match=”/”>
    <ROWSET>
    <xsl:apply-templates select=”purchaseOrder”/>
    </ROWSET>
    </xsl:template>
    <xsl:template match=”purchaseOrder”>
    <ROW>
    <SHIPTO_NAME><xsl:value-of select=”shipTo/name”/></SHIPTO_NAME>
    <SHIPTO_STREET><xsl:value-of select=”shipTo/street”/></SHIPTO_STREET>
    <SHIPTO_CITY><xsl:value-of select=”shipTo/city”/></SHIPTO_CITY>
    </ROW>
    </xsl:template>
    </xsl:stylesheet>
    Hope this will help.

  • Ora:parseEscapedXML

    Hi,
    I have a input string that has the 4 values passed from a CLOB PO_NUMBER (xsd:string) 173510 , PO_LINE_NUMBER(xsd:integer) 1 , PO_SHIPMENT_NUMBER (xsd:integer) 1 , QTY_CANCELLED (xsd:integer) 2000 to a BPEL Process
    When I try to receive this value using ora:parseEscapedXML from this string I cannot receive into a variable of complex type . However when I retrieve it into a String (say) PO Number I get 173510112000 (All Concatenated )
    How do I receive this into a XML Type ?
    Any inputs are appreciated
    Thanks

    Try something link this.. This is the .bpel file
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Thu Feb 05 16:04:06 PST 2009
    Author: venkatrr
    Purpose: Asynchronous BPEL Process
    -->
    <process name="BPELProcess_parseEscapedXML"
    targetNamespace="http://xmlns.oracle.com/BPELProcess_parseEscapedXML"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess_parseEscapedXML"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.kemet.com/KEMET_EVENT_PO_CANCEL_SHIPMENT"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client"
    partnerLinkType="client:BPELProcess_parseEscapedXML"
    myRole="BPELProcess_parseEscapedXMLProvider"
    partnerRole="BPELProcess_parseEscapedXMLRequester"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable"
    messageType="client:BPELProcess_parseEscapedXMLRequestMessage"/>
    <!-- Reference to the message that will be sent back to the requester during callback -->
    <variable name="outputVariable"
    messageType="client:BPELProcess_parseEscapedXMLResponseMessage"/>
    <variable name="inputString" type="xsd:string"/>
    <variable name="stringToXML" element="ns1:KEMET_PO_CAN_SHIP_EVENT"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess_parseEscapedXML.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:BPELProcess_parseEscapedXML"
    operation="initiate" variable="inputVariable"
    createInstance="yes"/>
    <!--
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    <assign name="Assign_1">
    <copy>
    <from expression="ora:getContentAsString(bpws:getVariableData('inputVariable','payload','/ns1:KEMET_PO_CAN_SHIP_EVENT'))"/>
    <to variable="inputString"/>
    </copy>
    <copy>
    <from expression="ora:translateFromNative(bpws:getVariableData('inputString'),'untitled1.xsd','KEMET_PO_CAN_SHIP_EVENT')"/>
    <to variable="stringToXML"
    query="/ns1:KEMET_PO_CAN_SHIP_EVENT"/>
    </copy>
    <copy>
    <from variable="stringToXML"
    query="/ns1:KEMET_PO_CAN_SHIP_EVENT/ns1:PO_NUMBER"/>
    <to variable="outputVariable" part="payload"
    query="/client:BPELProcess_parseEscapedXMLProcessResponse/client:result"/>
    </copy>
    </assign>
    <invoke name="callbackClient" partnerLink="client"
    portType="client:BPELProcess_parseEscapedXMLCallback"
    operation="onResult" inputVariable="outputVariable"/>
    </sequence>
    </process>
    -Ramana.

  • Problem in using ora:countNodes

    Hi i am trying to poll database and receive the records using receive activity.
    later i am trying to count the number of record polled each time.
    i am using ora:countNodes function.
    But i am getting the below error :
    Error while processing xpath expression, the expression is "ora:countNodes(bpws:getVariableData('Receive_Data_receive_InputVariable','EmpCollection','/ns2:EmpCollection/ns2:Emp'))", the reason is FOTY0001: type error.
    Please verify the xpath query.
    the schema file created by the AdapterConfigurator was:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBA4GettingData" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBA4GettingData" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="EmpCollection" type="EmpCollection"/>
    <xs:complexType name="EmpCollection">
    <xs:sequence>
    <xs:element name="Emp" type="Emp" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Emp">
    <xs:sequence>
    <xs:element name="empno" type="xs:int"/>
    <xs:element name="ename" minOccurs="0" nillable="true"/>
    <xs:element name="job" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    i am trying to count the nodes of EMP ...
    Could you please tell me the solution...
    Thanks in advance
    chandra

    It should look like:
    ora:countNodes('Receive_Data_receive_InputVariable','EmpCollection','/ns2:EmpCollection/ns2:Emp')
    I typically use the expression builder to identify the element then replace the bpws:getVariableData with ora:countNodes. Works every time.

  • Help Needed: Issue in ora:parseEscapedXML function in BPEL

    Hello All-
    We are facing issue while using the XSLT Function ora:parseEscapedXML in SOA 11g. Following is our scenario:
    1.     We are using DB Adapter to poll for records in the database. One of the fields in the polled records is a CLOB type which contains a XML message.
    2.     Our requirement is to get the XML Message as a String in the BPEL Process, parse it to XML and then assign to Complex Type XML Element.
    3.     We are using ora:parseEscapedXML function to achieve the same. However we are getting error "Empty Variable/Expression result. The XPATH variable or expression is empty"
    If anybody has faced similar issues, kindly provide us the resolution/pointers on how to resolve it.
    Thanks in advance. Please let me know if you need any additional information from my side.
    Regards,
    Dibya

    Reading Xml file from clob column in the staging table
    CLOB has to be treated as string in xsd/xml in BPEL. Hope you have read the following document http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#CHDIEBJD. Still valid for 11g.

  • Problem with ora:parseEscapedXML

    I have XML as string that contains & q u o t; (without space :( ).
    Now I have to convert it to XML, I tried using ora:parseEscapedXML.
    I have to process lot of XMLs that contains these encoded values, I tried adding escape character still it is not working.
    It is throwing type error, which is not caught in Catch block and CatchAll block.
    Atleast I need to Catch this exception.Can anybody suggest??
    It seems like it is bug in ora:parseEscapedXML.
    has anybody tried this
    thanks and regards
    V Kumar
    Message was edited by:
    user640551
    Message was edited by:
    user640551
    Message was edited by:
    user640551

    Replace the "&" with "& amp;amp;" (no space in real situation as the browser will replace it back
    to "&").You can use a Java exec in the BPEL code to implement this workaround.
    java.lang.String temp = (String) getVariableData("dummy");
    System.out.println("String before manipulation: " + temp);
    temp = temp.replaceAll("&", "& a m p; a m p"); <-- Intentionally spaces
    System.out.println("String after manipulation: " + temp);
    setVariableData("dummy", temp);

  • End of XML file without root element

    how can i know when the end of a XML file is reached if there is no root element, im using kxml.
    <element id="12" nom="dan"/>
    <element id="32" nom="eco"/>
    <element id="34" nom="juar"/>i can parse it without no problem but when it reaches the last element it throws an exception when calling to nextTag() method, how can i knwo when stoping reading...
    while(???????????)
    code....
    }

    Read the document with DOM, and append the new children, then use an empty transformer to write ti out.

  • ORA-20100: Error occurred while parsing: Start of root element expected.

    I've been searching everywhere for a reason to the following error message: ORA-20100: Error occurred while parsing: Start of root element expected.
    I get this when attempting to parse an XML file stored as a CLOB using the xmlparser.parseClob procedure
    Any help would be much appreciated.

    I initially used US ASCII but then tried several unicode formats as created by XML Spy (UTF16, Unicode16, Unicode32). All had the exact same result.
    Exactly what would be the most helpful output? The XML documents are varied, mostly very simple, but do you want the CLOB printed some other way?
    --Joan Armstrong
    null

  • Getting Error in java mapping: Parsing empty source. Root element expected!

    Hi Experts,
       I am using java mapping for schema validation of input message. I have followed all the standard procedures and implemented the java class in the interface mapping.
    My interface mapping is like this:
    OrderData --->Java Class ---SchemaValidate
                         Mesg Map ---OrderData_to_BAP --->BAPI Msg
    So first I want to validate the schema of the input message. If the input message is invalid then XI should throw an exception. Then I use the actual message mapping to map the input order data to the BAPI input parameters.
    In the java code I am using xerces parser.
    The java code works fine when I run it as a standalone application.
    The interface mapping also works fine if I don't include the java mapping. Ofcourse schema validation does not happen.
    But when I test the interface mapping by including the java mapping then I am getting the error:
    Call method execute of the application Java mapping SchemaValidate
    Java mapping SchemaValidate completed. (execute() of SchemaValidate
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected!
    What am I doing wrong? Why it is not getting the root element?
    My Java code is as follows:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.helpers.*;
    import org.xml.sax.*;
    import org.apache.xerces.jaxp.*;
    Sample mapper for SAP-XI
    @author Gopal
    public class SchemaValidate implements StreamTransformation {
        //Constants when using XML Schema for SAX parsing.
         static final String JAXP_SCHEMA_LANGUAGE =
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         static final String W3C_XML_SCHEMA =
         "http://www.w3.org/2001/XMLSchema";
         static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
    Injection of mapping parameters
    from integration engine
    @param map Map with configuration data
        public void setParameter(Map map) {
    Mapping implementation
    @param inputStream Input data from integration engine
    @param outputStream Output data to integration engine
        public void execute(InputStream inputStream,
                            OutputStream outputStream)
          throws StreamTransformationException {
            try {
                  // obtain an object of class javax.xml.parsers.SAXParser,
                  SAXParserFactory spf = SAXParserFactoryImpl.newInstance();
                  spf.setNamespaceAware(true);
                  spf.setValidating(true);
                  SAXParser sp = spf.newSAXParser();
                  // setup the schema file
                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, new File("IOReqMsgSchema.xsd"));
                  //parse the input xml using the given schema
                  sp.parse(inputStream, new ParseErrorHandler());
            catch(SAXException se) {
              se.printStackTrace();
            catch ( Exception e ) {
              throw new StreamTransformationException( e.getMessage() );
    My input message is :
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreate_request xmlns:ns0="mynamespace">
       <ORDER>HTEST1234567</ORDER>
       <ORDER_TYPE>z001</ORDER_TYPE>
       <ORDER_NAME>Test Order</ORDER_NAME>
       <CO_AREA>INTC</CO_AREA>
       <CCTR_POSTED>1234567890888888888</CCTR_POSTED>
       <CURRENCY>USD</CURRENCY>
       <PERSON_RESP>12345679</PERSON_RESP>
    </ns0:OrderCreate_request>
    Kindly help! please this is urgent!!!!!!
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Feb 28, 2008 9:34 AM

    Hi Stefan,
       I did the code changes to return output stream and the java code works perfectly in standalone mode in my PC.
       But when I use the same in the Java mapping with XI then It throws an error "Getting Error in java mapping: Parsing empty source. Root element expected!".
    My XI J2EE server has JDK1.4.3.11.
    Is there any limitation of using SAX parser in XI? If Yes, then which parser should be used for schema validation in XI?
    I have included the XSD file for schema validation along with class files in the .jar file. This jar file is then imported in XI repository. Is the XI engine not able to read the XSD file?
    Do I have to handle reading XSD file differently? Any suggession how?
    Is this parser error due to some security access?
    Kindly help me! I have been struggling with this problem since 2 weeks. I will be greatfull to you if you can help me.
    Thanks
    Gopal

  • Use DOM to get the element value of XML document?

    I can not to use the method getNodeValue to get the element value of XML document. How can I do for it?
    For example, for element
    <address>125 Smith Avenue</address>
    how to get the value "125 Smith Avenue" by using DOM?
    Thanks

    Thanks for all of you.
    The code indicates that I need to get the node by tag name. If I do not know the distribution of the elements and want to traverse all nodes. If the node contains value, I retrieve the value. How to implement the general case.
    For example, my XML file represent a directory hierarchy and looks like
    <root>
    <usr>
    <user>user1
    <file>file1</file>
    <file>file2</file>
    </user>
    <user>user2
    <file>file1</file>
    <file>file2</file>
    <file>file3</file>
    <file>file4</file>
    </user>
    </usr>
    </root>

Maybe you are looking for

  • Error in printing sum value of DME file in Automatic Payment Run

    Hi All, We are in the process of upgrading from R/3-4.0B to ECC6.0. In Automatic Payment run in transaction F110, when the spool is generated, the sum values is displaying in correctly.  It is displaying and printing as actual value/100 for example i

  • Reading text from a text file(what else!!!!!)

    okay to save time here i've managed to read the text from the text file and display in the console my question is - is there a way to read the text a character at a time, at present i read it as a string, the reason i need a character is that i have

  • Calculate the date range from entered date

    HI My requirement is to get the data in a perticular intervals of posting date. Directly we can create a variable with interval on posting Date to have the required data but Here we need two have two varibles because in one varibale user enters posti

  • What are the bugs in N95 8G new firmware V15?Let'...

    what are the bugs in N95 8G new firmware V15?

  • Xss vulnerabilities in Robohelp 10.0.0.287

    I've searched on xss vulnerabilities but did not find anything about "document.write(strHtml)". Can anyone tell me is this due to usage of frames or another reason? ---thanks