Configuring Outbound WCF message body with promoted context properties RRS feed

  • Question

  • I have a send port that receives a document with a set of promoted context properties. The adapter on the send port is set as WCF-SQL, and have been configured to connect to the SQL server.

    The only part missing is configuring the messages tab, so that the correct message is being sent to the database. Right now I simply have some hardcoded values along with the message itself:

    <bizSaveDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
      <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>

    I'm unsure how to properly insert my promoted context properties into these elements.

    I cannot use the body option, since I need to insert some promoted properties into the database. Looking at the MSDN there seems to be no explanation of how to accomplish this.

    For the receiving message, I created a pipeline component which promoted the required properties and works fine.

    Is this simply not possible in standard Biztalk? If not, I will need to create an additional pipeline component to handle the sending.

    Tuesday, December 4, 2018 10:05 AM

All replies

  • Hi,

    Do you want to say that the context properties promoted by receive pipeline on the receive port are unavailable to the receive pipeline of the 2 way send port?

    Then this is expected behavior because these properties are not sent to downstream system it only receive what is available in the body of message so as a response will send only the content which eventually get attached as stream to the body of message generated by adapter along with the context properties generated by adapter.

    Secondly have you tried setting XmlTransmit and XmlReceive instead of PassThrough ???


    Hope this Helps!!!! Regards, Note: Please Mark As Answered if you satisfy with Reply.

    Tuesday, December 4, 2018 11:06 AM
  • I am not using a two-way send port. The send pipeline is set to PassThru Transmit. Are you saying that the context properties have been demoted by the time they reach the send port?

    There is no schema attached to the message, so I have not tried XMLTransmit. The message received by the receive location runs through a custom pipeline, which has been set up to handle XML documents. 

    Tuesday, December 4, 2018 11:11 AM
  • Hi,

    PassThru Transmit pipeline will pass-on the message AS IS passed to send port, and no context be available except system properties.

    Hope this Helps!!!! Regards, Note: Please Mark As Answered if you satisfy with Reply.

    Tuesday, December 4, 2018 11:26 AM
  • Ah, ok, I see what you're doing....so....don't do it this way.

    The best and essentially correct way to handle this is with a normal BizTalk flow with Maps and an Orchestration.  Remember, there is nothing wrong with using an Orchestration, if someone is telling you to not use Orchestrations, they are, well, wrong.*

    Basically, Map to you SQL Schema using temp values, then set them from the Context using Distinguished fields.

    Don't ever bother with the Messages Tab, it's basically hiding code where it should never be.

    If they still make you do it some other way, you need to tell your management that this will take you about twice as long to implement because you have to create a anti-pattern that replicates built in functionality.

    Tuesday, December 4, 2018 2:21 PM