0

When I call a stored procedure from BizTalk the result is split across multiple nodes. The stored procedure returns XML which is mangled by being split.

Multiple sources state the correct configuration will automatically assemble the result but I'm not able to make it work.

Example result:

<bsp_FA_StatementOutputResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo">
  <StoredProcedureResultSet0>
    <StoredProcedureResultSet0 xmlns="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/bsp_FA_StatementOutput">
      <XML_F52E2B61-18A1-11d1-B105-00805F49916B>&lt;Root...</XML_F52E2B61-18A1-11d1-B105-00805F49916B>
      </StoredProcedureResultSet0>
    <StoredProcedureResultSet0 xmlns="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/bsp_FA_StatementOutput">
      <XML_F52E2B61-18A1-11d1-B105-00805F49916B>...</XML_F52E2B61-18A1-11d1-B105-00805F49916B>
    </StoredProcedureResultSet0>
    <StoredProcedureResultSet0 xmlns="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/bsp_FA_StatementOutput">
      <XML_F52E2B61-18A1-11d1-B105-00805F49916B>sactionDate&gt;2020-10-6&lt;/...;&lt;/Root&gt;</XML_F52E2B61-18A1-11d1-B105-00805F49916B>
    </StoredProcedureResultSet0>
  </StoredProcedureResultSet0>
  <ReturnValue>0</ReturnValue>
</bsp_FA_StatementOutputResponse>

The stored procedure works correctly when executed manually.

  • I created the send port using the 'Add generated items' wizard.
  • I chose 'strongly typed' from the wizard.
  • I used the bindings provided by the wizard.

Any help is appreciated.

7
  • So you have stored XML in a column and you are trying to return that in a stored procedure? Can you show us your stored procedure and the structure of your table? It is probably more of a SQL question in how to format it as the XML structure you want in the stored procedure as all the BizTalk SQL adapter is doing is escaping the XML from your result set and having multiple rows. Can you also show your results from when you execute it manually.
    – Dijkgraaf
    Commented Mar 26, 2021 at 1:59
  • I believe you've completely misunderstood. The issue is the result in the node named 'XML_F52E2B61-18A1-11d1-B105-00805F49916B" is chopped up into two pieces. It's the XML result from the sproc. XML randomly chopped into bits doesn't parse very well ;) I suspect the issue is the WCF transport layer is doing it
    – Jay
    Commented Mar 26, 2021 at 13:25
  • The result in sql server management studio has the correct result and returns correctly formed XML. This page claims a solution but I was unable to make it work since I am not using xmlpolling. reply.com/solidsoft-reply/en/content/…
    – Jay
    Commented Mar 27, 2021 at 9:48
  • So why aren't you using XmlPolling as per the article? You also need to specify the XmlStoredProcedureRootnodename and XmlStoredProcedureRootnodenamespace as per that article. I don't think the Wizard is going to help you with this scenario. You have to configure things manually, and probably also generate the schema from the XML rather than via the Consume Adapter Wizard.
    – Dijkgraaf
    Commented Mar 29, 2021 at 2:57
  • This process runs monthly at a scheduled time. Polling is not a good design choice.
    – Jay
    Commented Mar 29, 2021 at 17:55

2 Answers 2

1

Sorry, I misunderstood first, see below.

If you don't want to split resultsets from a stored procedure, just remove the is_enelope="yes" from the typed procedure schema.

2
  • I'm not sure I understand how this applies. My question was how to join the parts of the result from SQL server into a single (correct) xml document. You mention the 'disassemble' stage and selecting a single result of many. I can see that might be useful if the sproc was returning multiple result sets, but that's not the problem. It was splitting a single result set and mangling the xml.
    – Jay
    Commented Sep 28, 2023 at 17:53
  • Sorry, I must have misread your problem 🤦‍♂️ If you don't want to split, just remove the is_enelope="yes" from the typed procedure schema. Commented Sep 29, 2023 at 18:10
0

If you've had this issue I've documented the solution I came up with here. I used a manual XSLT map to reassemble the fragmented result.

1
  • This is actually not the optimal solution. The initial commentary that BizTalk/WCF would reassemble the result set is correct but there are many non obvious requirements
    – Jay
    Commented Jul 9, 2021 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.