Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Mapping to an Abstract Type Node
- This topic has 10 replies, 1 voice, and was last updated 8 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
June 5, 2006 at 2:53 AM #13802
Hi,
I have this situation wherein supposedly Node \”Detail\” is an abstract type. Then we have \”General Detail\” and \”Specific Detail\” as Node \”Detail\” ‘s subclass.
Here is more or less the picture of the map
Source———————————->Destination
——————————————– [Detail] (*Abstract)
———————————————– [GeneralDetail]
[A]————-Mapped To———————–>@[type]
———————————————– [SpecificDetail]
——————————————————@[type]The output would be like this:
(1)
<Detail xsi:type=\”GeneralDetail\” type=\”A\”>instead of
(2)
<GeneralDetail type=\”A\”>Is this okay? I want it to output the (2), not (1).
Is there an alternative way on the mapping to achieve (2) instead?
If there is something that is not clear, please let me know.
Thanks,
Fred -
June 8, 2006 at 3:01 AM #13803
Hi,
I encountered this error
\”A request-response for the \”Submit\” adapter at receive location \”Submit://OT\” has timed out before a response could be delivered\”
Does anyone knows why this happens?
Thanks…
-
June 8, 2006 at 3:13 AM #13804
Oops,
Sorry Fred, I thought I’ve created a new topic. I’m really sorry, I was reading your topic when I have encountered that error so when I tried to post it. I accidentally post it in your question.
I’m really sorry…
Anyways, I’ve re-create a new topic from my question. Sorry about that…
Thanks
-
June 8, 2006 at 3:19 AM #13805
Hi Greg,
Well… The schema was created by someone else so I can’t change it nor can I show it.
The Detail in my example is the abstract type and General Detail and Specific Detail are subclass of the abstract type Detail. I think this is the simpliest way I could explain it but I’ll try to ask permission.
Let me just explain the appearance of the Diagram that I’ve created earlier so it will be much clearer…
Basically in the Biztalk Map,
The \”Detail\” node Appears as a record eventhought it was an abstract.
then if you expand the \”Detail\” node. 2 nodes with <General> and <Specific> will appear. Note that you can’t directly map into them but if you mapped into their child or attributes, This \” <Detail xsi:type=\”GeneralDetail\” type=\”A\”> \” will appear.*Note: As for insanekid, that’s okay.
Thanks,
Fred-
June 8, 2006 at 6:14 AM #13806
Hi Greg,
Yes, that is correct
except that instead of
[code:1:b3c2866306]
<element name=\"Detail\" type=\"Detail\">
[/code:1:b3c2866306]an abstract=\”True\” is added to make it
[code:1:b3c2866306]
<element name=\"Detail\" type=\"Detail\" abstract=\"true\">
[/code:1:b3c2866306]so will the result be the same?
Thanks,
Fred-
June 8, 2006 at 7:36 AM #13807
Hi Greg,
Thanks for the quick response…
Ah i see…
Nope…No substitution Group was declared. They are just declared as complex type.
Thanks,
Fred-
June 8, 2006 at 8:12 AM #13808
Hi Greg,
I see…
Thanks for helping me out….
Thank you for your quick reply.
Thanks,
Fred-
June 6, 2006 at 10:56 PM #13809
Can you show us you schema or at least the definition of the Detail element and associated element/types
Are you using abstract types or elements
Do you have control over the output schema or ar you interfacing using an existing schema.
-
June 8, 2006 at 5:10 AM #13810
It sounds like the schema is using abstract types rather than abstract elements.
something like this:[code:1:6375a16c7c]<element name=\"Detail\" type=\"Detail\">
<complexType name = \"Detail\" abstract=\"true\">
<attribute name=\"Type\" type=\"string\" />
</complexType><complexType name=\"GeneralDetail\">
<complexContent mixed=\"false\">
<extension base=\"DetailType\"/>
</complexContent>
</complexType><complexType name=\"SpecificDetail\">
<complexContent mixed=\"false\">
<extension base=\"DetailType\"/>
</complexContent>
</complexType>[/code:1:6375a16c7c]If this is the case then the output <Detail xsi:type=\”GeneralDetail\” Type=\”A\”/> is the correct output.
There is no element called GeneralDetail, so this <GeneralDetail Type=\”A\”/> is not valid.
If you wish to to use different element names then the schema needs to have the an abstract element and use a substitutionGroup
-
June 8, 2006 at 7:11 AM #13811
Do you also have
[code:1:297183077f]<element name=\"GeneralDetail\" type=\"string\" substitutionGroup=\"Detail\"/>
<element name=\"SpecificDetail\" type=\"string\" substitutionGroup=\"Detail\"/>[/code:1:297183077f]or are GeneralDetail and SpecificDetail only declared as complexTypes?
Not sure what happens if the element and the type are marked as abstract. The Xml schema spec doesn’t seem to mention this case
-
June 8, 2006 at 8:02 AM #13812
If thats the case then the schema is a bit ambiguous.
[quote:e7343b6206][b:e7343b6206]From W3.org – XML Schema Part 0: Primer Second Edition[/b:e7343b6206]
When an element or type is declared to be \”abstract\”, it cannot be used in an instance document. When an element is declared to be abstract, a member of that element’s substitution group must appear in the instance document. When an element’s corresponding type definition is declared as abstract, all instances of that element must use xsi:type to indicate a derived type that is not abstract.
[/quote:e7343b6206]If both the element and its type are marked as abstract the you have a small problem. You can’t use <GeneralDetail> or <SpecificDetail> because they are types not elements and you can’t use <Detail> because it is marked as abstract.
Can you refer this back to the schema author.
I just did a quick check, it looks like Biztalk ignores the abstract attribute on the element if there is no substitutionGroup.
It creates a Detail node with the xsi:type set and this passes instance validation even though the Detail element is marked as abstract.
-
-
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.