Outside of going down the road of using the version aware binding facility to
isolate contexts which I find only useful in the simplest scenarios - I'm
trying to version using namespaces and ran into some significant limitations.
- For this simple use case. CreateContract is the message for a new
service. It uses a Contract canonical message as a child.
- Originally, it was using version 1 of this and the mapping for
Contract was not abstract and it worked fine - even though they had different
namespaces.
- But now we versioned the Contract canonical to V2 where we added an
element that is required.
- So I followed the convention to use multiple mappings for the same
class by making them abstract whereby I should be able to explicitly tell JiBX
which mapping to use via map-as.
- But it looks like JiBX will not allow inclusion of a different
namespace that the parent mapping. This is a big problem because we rely on
namespaces for versioning schema canonical components.
- The configuration below results in Error: Default namespace conflict
on mapping reference; on structure element at... referencing the Contract
child of CreateContract mapping.
What I'm wondering is if anyone found a solution to this problem or if anyone
knows of a suitable work-around. I can't imagine that this problem hasn't been
run into before in any kind of complex solution requiring versioning with
namespaces. Any suggestions much appreciated.
<?xml version="1.0" encoding="UTF-8"?>
<binding>
<mapping name="CreateContract"
class="com.mckesson.integration.message.contracting.CreateContract">
<namespace
uri="http://mhs.mckesson.com/contracting/schema/ContractServiceMessagesV1"
default="elements"/>
<structure name="Contract" field="contract" map-as="ContractV2"/>
</mapping>
<!-Version 1 of Contract canonical -->
<mapping class="com.porticosys.domain.contracting.Contract"
type-name="ContractV1" abstract="true">
<namespace uri="http://mhs.mckesson.com/contracting/schema/ContractV2"
default="elements"/>
<value style="attribute" name="id" field="enterpriseId"
usage="optional"/>
</mapping>
<!-Version 2 of Contract canonical -->
<mapping class="com.porticosys.domain.contracting.Contract"
type-name="ContractV2" abstract="true">
<namespace uri="http://mhs.mckesson.com/contracting/schema/ContractV2"
default="elements"/>
<value style="attribute" name="id" field="enterpriseId"
usage="optional"/>
<value style="attribute" name="type" field="type" usage="required"/>
</mapping>
</binding>
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users