Using template message body on WCF-SQL adapter in Biztalk to insert promoted properties into SQL database










0















I need to insert some data from an XML document into an SQL table using a stored procedure. This should be done using the WCF-SQL adapter on a send port in Biztalk. I've set up the connection properties on the adapter, but I am missing the message part.



I'm currently using the below code with some hardcoded values inside a body template:



<SaveDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
<conversationID>123456</conversationID>
<dataType>OIO</dataType>
<fromID></fromID>
<toID></toID>
<msgInfoExtension><![CDATA[<infoExt><fileInfo fileName="ublinvoice.xml" encoding="utf-8" /></infoExt>]]></msgInfoExtension>
<msgBody>
<bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
</msgBody>
<msgBodyBin></msgBodyBin>
</SaveDocument>


Instead of the hardcoded values, I need to grab some of the promoted properties in an XML document, but I'm unsure how to correctly go about doing this.



In the MS documentation I found this page, which describes the structure of the request: https://docs.microsoft.com/en-us/biztalk/adapters-and-accelerators/adapter-sql/message-schemas-for-procedures-and-functions










share|improve this question


























    0















    I need to insert some data from an XML document into an SQL table using a stored procedure. This should be done using the WCF-SQL adapter on a send port in Biztalk. I've set up the connection properties on the adapter, but I am missing the message part.



    I'm currently using the below code with some hardcoded values inside a body template:



    <SaveDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
    <conversationID>123456</conversationID>
    <dataType>OIO</dataType>
    <fromID></fromID>
    <toID></toID>
    <msgInfoExtension><![CDATA[<infoExt><fileInfo fileName="ublinvoice.xml" encoding="utf-8" /></infoExt>]]></msgInfoExtension>
    <msgBody>
    <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
    </msgBody>
    <msgBodyBin></msgBodyBin>
    </SaveDocument>


    Instead of the hardcoded values, I need to grab some of the promoted properties in an XML document, but I'm unsure how to correctly go about doing this.



    In the MS documentation I found this page, which describes the structure of the request: https://docs.microsoft.com/en-us/biztalk/adapters-and-accelerators/adapter-sql/message-schemas-for-procedures-and-functions










    share|improve this question
























      0












      0








      0








      I need to insert some data from an XML document into an SQL table using a stored procedure. This should be done using the WCF-SQL adapter on a send port in Biztalk. I've set up the connection properties on the adapter, but I am missing the message part.



      I'm currently using the below code with some hardcoded values inside a body template:



      <SaveDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
      <conversationID>123456</conversationID>
      <dataType>OIO</dataType>
      <fromID></fromID>
      <toID></toID>
      <msgInfoExtension><![CDATA[<infoExt><fileInfo fileName="ublinvoice.xml" encoding="utf-8" /></infoExt>]]></msgInfoExtension>
      <msgBody>
      <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
      </msgBody>
      <msgBodyBin></msgBodyBin>
      </SaveDocument>


      Instead of the hardcoded values, I need to grab some of the promoted properties in an XML document, but I'm unsure how to correctly go about doing this.



      In the MS documentation I found this page, which describes the structure of the request: https://docs.microsoft.com/en-us/biztalk/adapters-and-accelerators/adapter-sql/message-schemas-for-procedures-and-functions










      share|improve this question














      I need to insert some data from an XML document into an SQL table using a stored procedure. This should be done using the WCF-SQL adapter on a send port in Biztalk. I've set up the connection properties on the adapter, but I am missing the message part.



      I'm currently using the below code with some hardcoded values inside a body template:



      <SaveDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
      <conversationID>123456</conversationID>
      <dataType>OIO</dataType>
      <fromID></fromID>
      <toID></toID>
      <msgInfoExtension><![CDATA[<infoExt><fileInfo fileName="ublinvoice.xml" encoding="utf-8" /></infoExt>]]></msgInfoExtension>
      <msgBody>
      <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
      </msgBody>
      <msgBodyBin></msgBodyBin>
      </SaveDocument>


      Instead of the hardcoded values, I need to grab some of the promoted properties in an XML document, but I'm unsure how to correctly go about doing this.



      In the MS documentation I found this page, which describes the structure of the request: https://docs.microsoft.com/en-us/biztalk/adapters-and-accelerators/adapter-sql/message-schemas-for-procedures-and-functions







      sql sql-server xml wcf biztalk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 13:20









      LethLeth

      461617




      461617






















          2 Answers
          2






          active

          oldest

          votes


















          0














          1. Distinguish the properties that you want to set in the SaveDocument schema

          2. Create a map that populates the fields, the ones you want to set from the Promoted properties, just fill them with some constants from the map.

          3. In an Orchestration have a Construct Message that contains both the map shape pointing to the above map and a message assignment shape.

          4. In the message assignment shape have some statements like saveSG.conversationID = sourceMSG(PropmotedProperty).

          P.S. I think you have manually tried to create the SaveDocument schema. This is probably not correct. The correct way is to create the stored procedure and then use the Generate Instance dialogue in Visual Studio, and to configure that to auto generate the schema for you, and as a bonus, it even generates a binding file containing the settings you need for your send port.






          share|improve this answer






























            0














            You might be able to use the often overlook Property Demotion feature.



            It's basically the reverse of Promotion and is done by the XmlAssembler component.






            share|improve this answer






















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320425%2fusing-template-message-body-on-wcf-sql-adapter-in-biztalk-to-insert-promoted-pro%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              1. Distinguish the properties that you want to set in the SaveDocument schema

              2. Create a map that populates the fields, the ones you want to set from the Promoted properties, just fill them with some constants from the map.

              3. In an Orchestration have a Construct Message that contains both the map shape pointing to the above map and a message assignment shape.

              4. In the message assignment shape have some statements like saveSG.conversationID = sourceMSG(PropmotedProperty).

              P.S. I think you have manually tried to create the SaveDocument schema. This is probably not correct. The correct way is to create the stored procedure and then use the Generate Instance dialogue in Visual Studio, and to configure that to auto generate the schema for you, and as a bonus, it even generates a binding file containing the settings you need for your send port.






              share|improve this answer



























                0














                1. Distinguish the properties that you want to set in the SaveDocument schema

                2. Create a map that populates the fields, the ones you want to set from the Promoted properties, just fill them with some constants from the map.

                3. In an Orchestration have a Construct Message that contains both the map shape pointing to the above map and a message assignment shape.

                4. In the message assignment shape have some statements like saveSG.conversationID = sourceMSG(PropmotedProperty).

                P.S. I think you have manually tried to create the SaveDocument schema. This is probably not correct. The correct way is to create the stored procedure and then use the Generate Instance dialogue in Visual Studio, and to configure that to auto generate the schema for you, and as a bonus, it even generates a binding file containing the settings you need for your send port.






                share|improve this answer

























                  0












                  0








                  0







                  1. Distinguish the properties that you want to set in the SaveDocument schema

                  2. Create a map that populates the fields, the ones you want to set from the Promoted properties, just fill them with some constants from the map.

                  3. In an Orchestration have a Construct Message that contains both the map shape pointing to the above map and a message assignment shape.

                  4. In the message assignment shape have some statements like saveSG.conversationID = sourceMSG(PropmotedProperty).

                  P.S. I think you have manually tried to create the SaveDocument schema. This is probably not correct. The correct way is to create the stored procedure and then use the Generate Instance dialogue in Visual Studio, and to configure that to auto generate the schema for you, and as a bonus, it even generates a binding file containing the settings you need for your send port.






                  share|improve this answer













                  1. Distinguish the properties that you want to set in the SaveDocument schema

                  2. Create a map that populates the fields, the ones you want to set from the Promoted properties, just fill them with some constants from the map.

                  3. In an Orchestration have a Construct Message that contains both the map shape pointing to the above map and a message assignment shape.

                  4. In the message assignment shape have some statements like saveSG.conversationID = sourceMSG(PropmotedProperty).

                  P.S. I think you have manually tried to create the SaveDocument schema. This is probably not correct. The correct way is to create the stored procedure and then use the Generate Instance dialogue in Visual Studio, and to configure that to auto generate the schema for you, and as a bonus, it even generates a binding file containing the settings you need for your send port.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 15 '18 at 17:51









                  DijkgraafDijkgraaf

                  7,44082745




                  7,44082745























                      0














                      You might be able to use the often overlook Property Demotion feature.



                      It's basically the reverse of Promotion and is done by the XmlAssembler component.






                      share|improve this answer



























                        0














                        You might be able to use the often overlook Property Demotion feature.



                        It's basically the reverse of Promotion and is done by the XmlAssembler component.






                        share|improve this answer

























                          0












                          0








                          0







                          You might be able to use the often overlook Property Demotion feature.



                          It's basically the reverse of Promotion and is done by the XmlAssembler component.






                          share|improve this answer













                          You might be able to use the often overlook Property Demotion feature.



                          It's basically the reverse of Promotion and is done by the XmlAssembler component.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 16 '18 at 12:51









                          Johns-305Johns-305

                          9,950721




                          9,950721



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320425%2fusing-template-message-body-on-wcf-sql-adapter-in-biztalk-to-insert-promoted-pro%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              這個網誌中的熱門文章

                              Barbados

                              How to read a connectionString WITH PROVIDER in .NET Core?

                              Node.js Script on GitHub Pages or Amazon S3