7 Replies Latest reply on Jul 13, 2011 7:37 PM by sk_vishnu

    Namespace prefix in Root element missing during variable assignment

    Sandeep_22
      In bpel 10.1.3.4, I need qualified element Namespaces in one of the target variables. I have an xsd that has elementFormDefault = "qualified" set, therefore all elements being referred to would have the namespace prefixed. This is working for all child elements, but not the root element. How can i get the root element prefixed with the namespace?

      If i use transform or copy/append operation to populate in the target variable the variable gets populated something like this :

      <Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
      <pidx:InvoiceProperties>
      <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
      </pidx:InvoiceProperties>
      </Invoice>

      Whereas i need :

      <*pidx:*Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
      <pidx:InvoiceProperties>
      <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
      </pidx:InvoiceProperties>
      </*pidx:*Invoice>

      Is there some way to accomplish this?

      Regards,
      Sandeep
        • 1. Re: Namespace prefix in Root element missing during variable assignment
          user9285225
          Hi all,

          Even i am facing a similar issue. Can anyone let us know how to solve it?

          When the transformation file is tested in Jdeveloper it is showing the expected output but under real testing it is not.
          • 2. Re: Namespace prefix in Root element missing during variable assignment
            Sandeep_22
            We were able to fix it using custom java code :
            First use transform to assign the output to the variable, in our case its :

            Invoke_SendInvoiceToB2B_Enqueue_InputVariable

            and the use this java function to prefix the namespace after rendering the xml as a string, the parse the xml again and use the setvariabledata to assign values back to the variable.


            <bpelx:exec name="FormatXML" language="java"
            version="1.5">
            <![CDATA[try{  
            //Element originalNode=(Element)getVariableData('Invoke_SendInvoiceToB2B_Enqueue_InputVariable','Invoice');  
            String myDoc=(String)getVariableData("myDoc");   
            String finalDoc="<pidx:"+myDoc.substring(1,myDoc.length()-9)+"pidx:Invoice>";   
            Element node =    
            DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(new String(finalDoc).getBytes())).getDocumentElement();   
            setVariableData("Invoke_SendInvoiceToB2B_Enqueue_InputVariable","Invoice",node);   
            }
            catch(Exception e)
            {   
            addAuditTrailEntry(e.getMessage());
            }]]>
            </bpelx:exec>
            • 3. Re: Namespace prefix in Root element missing during variable assignment
              user9285225
              Hi Sandeep,

              Thanks for the information.

              Can you let us know if there is any alternate way to achieve this?

              Edited by: user9285225 on Jan 18, 2011 12:03 AM
              • 4. Re: Namespace prefix in Root element missing during variable assignment
                user9285225
                Hi Sandeep,

                Can u pls let me know the jars and library files that u used for this java embedded activity?

                Thanks in advance
                • 5. Re: Namespace prefix in Root element missing during variable assignment
                  sk_vishnu
                  Hi Sandeep,

                  We have exactly the same issue, but, when we implemented the solution, we are getting the following error, when we tried to compile the code, we are using 11.1.1.4.0 version of SOA 11g, appreciate if there is any way you can help us on this:

                  Jul 12, 2011 2:40:28 PM com.collaxa.cube.CubeLogger info
                  INFO: validating "BPELProcess1.bpel" ...
                  oracle.jrf.UnknownPlatformException: JRF is unable to determine the current application server platform.
                       at oracle.jrf.ServerPlatformSupportFactory.getInstance(ServerPlatformSupportFactory.java:79)
                       at oracle.integration.platform.blocks.WLSPlatformConfigurationProvider.<clinit>(WLSPlatformConfigurationProvider.java:44)
                       at oracle.integration.platform.blocks.FabricConfigManager.<clinit>(FabricConfigManager.java:154)
                       at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXpathFunctions(FabricXPathFunctionResolver.java:282)
                       at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXPathConfigFile(FabricXPathFunctionResolver.java:156)
                       at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.init(FabricXPathFunctionResolver.java:49)
                       at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.loadFabricXpathFunctions(BPELXPathFunctionNameResolver.java:57)
                       at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<init>(BPELXPathFunctionNameResolver.java:48)
                       at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<clinit>(BPELXPathFunctionNameResolver.java:44)
                       at com.collaxa.cube.lang.compiler.bpel.XPathExprValidatorVisitor.<init>(XPathExprValidatorVisitor.java:122)
                       at com.collaxa.cube.lang.compiler.bpel.AssignValidator.<init>(AssignValidator.java:89)
                       at com.collaxa.cube.lang.compiler.bpel.BpelParser.<init>(BpelParser.java:452)
                       at com.collaxa.cube.lang.compiler.bpel.BPELValidator.validate(BPELValidator.java:60)
                       at com.collaxa.cube.lang.compiler.BPEL1Processor.validate(BPEL1Processor.java:329)
                       at com.collaxa.cube.lang.compiler.BPEL1Processor.process(BPEL1Processor.java:153)
                       at com.collaxa.cube.lang.compiler.CubeParserHelper.compile(CubeParserHelper.java:47)
                       at oracle.fabric.bpel.bpelc.BPELComponentValidator.validate(BPELComponentValidator.java:40)
                       at oracle.soa.scac.ValidateComposite.validateComponentTypeServicesReferences(ValidateComposite.java:1117)
                       at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:500)
                       at oracle.soa.scac.ValidateComposite.run(ValidateComposite.java:150)
                       at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:135)
                  Jul 12, 2011 2:40:29 PM CubeProcessGenerator compile
                  WARNING: classpath is: C:\oracle\Middleware\jdeveloper\jdev\extensions\oracle.sca.modeler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mediator_11.1.1\mediator_client.jar;C:\oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\oracle\Middleware\jdeveloper\jdev\extensions;;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\gen-classes;C:\oracle\Middleware\oracle_common\modules\commonj.sdo_2.1.0.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel1-1-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel_coherence_config.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpm-analytics.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\wsif-binding.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\monitor-rt-xbean.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\oracle.soa.bpmn.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\user-patch.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.thirdparty.jar;C:\oracle\Middleware\jdeveloper\uddi\lib\oracle.soa.uddi.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\bpm-infra.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\testfwk-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-scheduler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\xmlunit-1.1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-xpath-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle-soa-client-api.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-was.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\classes

                  Regards,
                  Sireesh
                  • 6. Re: Namespace prefix in Root element missing during variable assignment
                    sk_vishnu
                    We are using a Java Embedding object after the Transform process as suggested.

                    Thanks,
                    Sireesh
                    • 7. Re: Namespace prefix in Root element missing during variable assignment
                      sk_vishnu
                      I'm able to fix the compilation issue using "Java Embedding" activity and has tested an XML invoice. But, still the fix mentioned did not resolve the issue. Are there any steps we are missing?