none
WCF-SQL xmlpolling issue RRS feed

  • Question

  • I have an issue with the xml im getting back from biztalk using a wcf-sql adapter.

    Im getting a strange blank namespace on a child element.

    <ShippedPackages xmlns="http://Correct.Schema"> <Package xmlns=""> <SALESORG>4000</SALESORG> <SOLDTO>5111632</SOLDTO> <PICKUP>5314125</PICKUP> <SOURCE>14</SOURCE>

    .....


    Im getting this blank namespace in <package>

    here are my settings for the receive location

    the receive pipeline is 'XMLreceive'

    XmlStoredProcedureRootNodeName - ShippedPackages

    XmlStoredProcedureRootNodeNamespace - http://Correct.Schema

    inbound operation type is xmlpolling

    PolledDataAvailableStatement - SELECT COUNT(*) as count FROM [Shopping].[dbo].[VW_DHLGMPartner_ShippedPackages]

    Pollingstatement - SELECT * FROM [Shopping].[dbo].[VW_DHLGMPartner_ShippedPackages] AS Package

    FOR XML AUTO, ELEMENTS

    Any ideas would be great

    Thanks

    Tuesday, February 3, 2015 3:30 PM

Answers

  • Hi,

    Please follow the blog -> All about Legacy SQL Adapter and migrating it to WCF SQL Adapter

    Snippet from the blog which says:

    Issue

    Records fetched by WCF Sql Adapter have blank XMLNS with every record unlike the legacy Sql Adapter where there are no such blank namespaces coming along. This results in validation failure wherever the polled schema is being used as a SOURCE SCHEMA.

    Resolution

    Additionally following 2 changes need to be made: 

    1. Need to feed in the "PolledDataAvailableStatement" as it is a mandatory field before the polling operation could start.
    2. Marked "UseAmbientTransactions" as false to eliminate the error.
    3. For the blank namespace problems - the ElementFormDefault property needs to be set to 'False'.

    Rachit


    Please mark as answer or vote as helpful if my reply does

    Tuesday, February 3, 2015 3:42 PM
    Moderator

All replies

  • Hi,

    Please follow the blog -> All about Legacy SQL Adapter and migrating it to WCF SQL Adapter

    Snippet from the blog which says:

    Issue

    Records fetched by WCF Sql Adapter have blank XMLNS with every record unlike the legacy Sql Adapter where there are no such blank namespaces coming along. This results in validation failure wherever the polled schema is being used as a SOURCE SCHEMA.

    Resolution

    Additionally following 2 changes need to be made: 

    1. Need to feed in the "PolledDataAvailableStatement" as it is a mandatory field before the polling operation could start.
    2. Marked "UseAmbientTransactions" as false to eliminate the error.
    3. For the blank namespace problems - the ElementFormDefault property needs to be set to 'False'.

    Rachit


    Please mark as answer or vote as helpful if my reply does

    Tuesday, February 3, 2015 3:42 PM
    Moderator
  • There's nothing strange about it. It is simply another way of representing XML as unqualified. And the WCF-SQL Adapter always returns xml as unqualified.


    http://blog.vertica.dk/2013/09/18/migrating-to-wcf-sql-adapter-from-sql-adapter-receiving/

    As a matter of fact the following two snippets are 100% identical from an XML perspective:

    <Order xmlns="http">
    <ID xmlns="">10</ID>
    </Order>

    <ns0:Order xmlns:ns0="http">
    <ID>10</ID>
    </ns0:Order>

    Morten la Cour

    Tuesday, February 3, 2015 3:49 PM
  • Thanks that worked.  Changing the schema to unqualified allowed it to process the message.

    Tuesday, February 3, 2015 8:48 PM