Search code examples
sql-server-2008biztalkbiztalk-2010

XmlReaderParsingException: The start element with name <...> and namespace "http..." was unexpected


This is for BizTalk 2010. I am running into a very strange issue that I've not been able to find a solution either using my favorite search engine's results or elsewhere.

I added several SQL Server 2008 table schemas to BizTalk. Set up orchestration and mapping without any problems. BizTalk was able to use WCF_Custom SQL Adapter using XML/BTSAction to insert data to the SQL tables identified in the XML.

Some of those tables had data inserted just fine, except two. Both had the same error. The error was pulling from a third table's namespace. Here's the error in full -- notice that the namespace, ns, is for ns46:professionalAddendum as is expected, but somehow, somewhere, BizTalk is pulling a different namespace, ns35, from a different table:

Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The start element with name "ClaimFilingIndicatorCode" and namespace "http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/professionalCOBAdjustmentsAncillary" was unexpected. Please ensure that your input XML conforms to the schema for the operation.

<ns2:Insert xmlns:ns2="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/professionalAddendum">
  <ns2:Rows>
    <ns46:professionalAddendum xmlns:ns46="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
      <ns46:uid_claim>1b8f20e9-0517-4f00-9ee2-99d5f04d1573</ns46:uid_claim>
ERROR>>>>>   <ns35:ClaimFilingIndicatorCode xmlns:ns35="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/professionalCOBAdjustmentsAncillary">17</ns35:ClaimFilingIndicatorCode>
      <ns46:ClaimFrequencyTypeCode>1</ns46:ClaimFrequencyTypeCode>
      <ns46:ProviderAcceptAssignmentCode>B</ns46:ProviderAcceptAssignmentCode>
      <ns46:BenefitsAssignmentCertificationIndicator>Y</ns46:BenefitsAssignmentCertificationIndicator>
      <ns46:ReleaseofCode>Y</ns46:ReleaseofCode>
      <ns46:ProviderOrSupplierSignatureIndicator>N</ns46:ProviderOrSupplierSignatureIndicator>
    </ns46:professionalAddendum>
  </ns2:Rows>
</ns2:Insert>

Is there a way to fix this? Really weird.

Thanks all!


Solution

  • I'm posting up what I found. The map and orchestration are both fine for the most part. There was a Scripting functoid in the mapper that used an inline XSLT to map from the source schema to the destination schema, and the offending namespace was in that XSLT code. When I changed the schema's tables, their corresponding namespace #s changed as well thus causing this problem to manifest itself. Having said that, I fixed it up to be flexible should the schema tables' namespace #s change again.

    Problem solved. Now I got to fix up a few of those. :)

    Thanks all for your help.