WCF-SQL xmlpolling issue

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

February 3rd, 2015 6:30pm

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

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 6:42pm

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

February 3rd, 2015 6:49pm

Thanks that worked.  Changing the schema to unqualified allowed it to process the message.

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 11:48pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics