Forum Stats

  • 3,854,123 Users
  • 2,264,322 Discussions
  • 7,905,571 Comments

Discussions

Variable Element as xsd

672690
672690 Member Posts: 4
edited Nov 28, 2008 8:54AM in BPEL
Hi,
I have a variable of type element based on a xsd. I populate the variable with a xml snippet and later on in the process I try retrieive individual elements but get the
"bpws:getVariableData('UserAssetDefaults','/ns21:USERASSETDEFAULTS/ns21:processStatus')" is empty at line 297, when attempting reading/copying it. If I retrieve the entire variable this works and the xml document is copied. Any ideas?


Variable definition
============
<variable name="UserAssetDefaults" element="ns21:USERASSETDEFAULTS"/>

Assigning variable
===========
<copy>
<from>
<USERASSETDEFAULTS xmlns="http://sample.otn.com">
<processStatus>APPROVE
</processStatus>
<reviewStatus>ON HOLD
</reviewStatus>
<bookTypeCode>CCDHB
</bookTypeCode>
<batchName>filename1
</batchName>
</USERASSETDEFAULTS>
</from>
<to variable="UserAssetDefaults"/>

XSD
===============

<?xml version="1.0" encoding="windows-1252"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://Asset/Defaults"
targetNamespace="http://Asset/Defaults"
elementFormDefault="qualified" >

<xsd:element name="USERASSETDEFAULTS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="processStatus" type="xsd:string"/>
<xsd:element name="reviewStatus" type="xsd:string"/>
<xsd:element name="bookTypeCode" type="xsd:string"/>
<xsd:element name="batchName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:schema>
Tagged:

Answers

  • 206307
    206307 Member Posts: 1,760
    You namespace of the message is wrong:

    Namespace in message: xmlns="http://sample.otn.com"
    Namespace in XSD: "http://Asset/Defaults"

    Marc
    http://orasoa.blogspot.com
  • 521509
    521509 Member Posts: 53
    Assigning variable
    ===========
    <copy>
    <from>
    <USERASSETDEFAULTS xmlns="http://sample.otn.com">
    <processStatus>APPROVE
    </processStatus>
    <reviewStatus>ON HOLD
    </reviewStatus>
    <bookTypeCode>CCDHB
    </bookTypeCode>
    <batchName>filename1
    </batchName>
    </USERASSETDEFAULTS>
    </from>
    <to variable="UserAssetDefaults"/>

    When yuo make assign activity, you assign also namespace to variable.
    Try to use transform activity assign activity instead.

    After this bws:getVariableDate() will work.
This discussion has been closed.