none
Namespace appear in the child node when using FOR XML output in BizTalk server 2009 and the map fails

    Question

  • Hi,
    I am working on BizTalk server 2009. And I am using the WCF adapter to call the stored procedure with FOR XML AUTO to get the data and loaded into the XML schema. The output received is as below.

    <?xml version="1.0" encoding="utf-8"?>
    <RESDATA xmlns="http://OB/SQLTest">
    <C
    CustomerId="1" Name="AAA" xmlns="">
            <O OrderNo="1">
                    <OD DetailNo="1" OrderInfo="XXX" OrderQuantity="2" />
                    <OD DetailNo="1" OrderInfo="YYY" OrderQuantity="1" />
           </O>
           <O OrderNo="2">
                   <OD DetailNo="1" OrderInfo="ZZZ" OrderQuantity="10" />
           </O>
    </C>
    </RESDATA>

    If you see my output of the Requset response port, I am having the namespace in RESDATA tag as "xmlns=http://OB/SQLTest and I am having a blank namespace in "C" tag too (xmlIns = ""). If this blank namespace is available then my Source schema in the map is not accepting the input. If I remove the "xmlIns = "" from the XML output then only my "TestMap" is working fine. Could anyone suggest me how can I remove this blank namespace in my schema, if I use the FOR XML stored procedure.

    If I do schema "Validate Instance" or Test map, I am getting the following error.

    error BEC2004: The element 'RESDATA' in namespace 'http://OB/SQLTest' has invalid child element 'C'. List of possible elements expected: 'C' in namespace 'http://OB/SQLTest'


    But I didn't come accross this issue when I used the SQL Adapter in BizTalk server 2006.

    Thanks,
    R.Subha

    Tuesday, August 25, 2009 1:00 AM

Answers

  • Hey,

    A simple workaround as of now for this is to add “FORM = UNQUALIFIED” in the schema generated. This change will allow the empty namespace to be present in the response XML

    If the schema generated has the columns as elements, then you will have to put the "FORM= UNQUALIFIED" at all the elements otherwise you can just put it at the root element.

    Thanks
    -Abhinav-


    Abhinav
    • Marked as answer by RSubha Wednesday, August 26, 2009 7:03 PM
    Tuesday, August 25, 2009 5:28 AM

All replies

  • Hey,

    A simple workaround as of now for this is to add “FORM = UNQUALIFIED” in the schema generated. This change will allow the empty namespace to be present in the response XML

    If the schema generated has the columns as elements, then you will have to put the "FORM= UNQUALIFIED" at all the elements otherwise you can just put it at the root element.

    Thanks
    -Abhinav-


    Abhinav
    • Marked as answer by RSubha Wednesday, August 26, 2009 7:03 PM
    Tuesday, August 25, 2009 5:28 AM
  • Hi Abhinav,

    I added the form = "unqualified" in my schema. Now the schema and map are working fine. Thank you very much.

    thanks,
    R.Subha
    Wednesday, August 26, 2009 7:02 PM