none
How Can I assign dynamic port to Party and Party Agreement? RRS feed

Answers

  • I totally understand.  I would actually solve a different problem.

    Instead of addressing the Dynamic Port problem, I would address the Agreement Send Port problem by not specifying the Send Port in the Agreement.

    Instead, I would (and very frequently do) use the EDI.DestinationPartyName Property to match the outgoing Message to the Agreement.

    This is described as Option 3 here: https://msdn.microsoft.com/en-us/library/bb259945.aspx

    This has the added benefit of not tying the Agreement to specific Send Ports which has implications for deployment and working with binding files.

    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Thursday, October 6, 2016 4:39 PM
  • For the benefit of future readers, please mark the appropriate answer as Answer or Helpful.
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 2:38 PM
  • Answer
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 3:16 PM
  • Oh, you should change the Thread Type to Question, then mark the Answer(s) and Helpful posts.
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 3:42 PM

All replies

  • Hi M.Yaseen,

    can you provide more details on as to what you want to do???

    Regards,


    Mandar Dharmadhikari

    Thursday, October 6, 2016 3:42 AM
  • Hello Yasin.

    Role-Link could fit your requirement perfectly. Role links allow you to use the features of static ports in a dynamic way. They are ideal for creating solutions that will interact in a similar way with many different parties (often B2B).  I've never been a big fan of dynamic ports in BizTalk because they remove an important layer of visibility from the administrators.

    You can follow below steps:

    1) Receive a message into an Orchestration.

    2) Create a “Provider” Role-Link with send port type following the wizard.

    3) In Orchestration’s expression shape may be before sending the message out, performs the party resolution using a code similar to the following:  

    YourRoleLinkName(Microsoft.XLANGs.BaseTypes.DestinationParty) = new Microsoft.XLANGs.BaseTypes.Party(msgToBeSend.YourDistingushedPropertyToIdentifyParty, "OrganizationName");


    4) In the above sample code “YourDistingushedPropertyToIdentifyParty” refer for the code which could identify the partyname where the send port is configured.

    5) Create Parties representing different type of message to be send like flat-file or XML messages.

    6) Create a static send port and populate the outbound URL dynamically by using a custom pipeline component. In the custom pipeline component URL can be dynamically bound by calling the database as per your requirement i.e based on the received message by accessing its content in custom pipeline access the database, find the destination URL and assign the “OutboundTransportLocation” context property of the outbound message something like this 

    msgToBeSend.Context.Promote("OutboundTransportLocation", "http://schemas.microsoft.com/BizTalk/2003/system-properties", YourOutboundURLFromDatabase);

    Refer this article on this topic: http://www.codit.eu/blog/2013/03/06/adding-dynamic-behavior-to-static-send-ports-a-caveat/

    7) In the Parties you have created assign the send ports.

    8) GoTo your “Role-Links” folder within the deployed BizTalk application and enlist the parties.

    These steps enable you to achieve the dynamic requirement you want to implement with the mentioned Role-Link.



    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, October 6, 2016 6:57 AM
    Moderator
  • Thanks Rachit,

    Your answer is helpful, however how about if I used Out of the box component EnableDynamicPortRouting? Instead of creating the custom one? Will that fulfill my requirements i.e. dynamic locations for Send port?

    Regards,

    Yasin

    Thursday, October 6, 2016 1:40 PM
  • msgToBeSend.Context.Promote("OutboundTransportLocation", "http://schemas.microsoft.com/BizTalk/2003/system-properties", YourOutboundURLFromDatabase);

    Can

    I use this in Orchestrations Instead of using Pipeline component?



    I tries, but his is not showing the Context property for the message in Orchestration.


    Thursday, October 6, 2016 2:17 PM
  •  When I use the following in my orchestration it does not work? Either I get in Suspend message or I not get any error.

    SndMessage(BTS.OutboundTransportLocation)= @"file://C:\DynamicPort\%SourceFileName%.xml";

    Thursday, October 6, 2016 2:52 PM
  • Like Mandar Dharmadhikari mentioned, it would be very helpful if you described your actual situation.  It's likely the best answer is not really for the question you're asking.

    If we know all the details, we can better send you in right direction.

    Thursday, October 6, 2016 3:17 PM
  • Ok, here is the requirement

    I have an orchestration and one send port

    The send port I want to be dynamic for Different file locations, means I have to get the Send port location from Database on certain condition.

    I am also using Parties and Agreements, because Party and Agreements cannot access the Dynamic Port, therefore I need to use the static port, but this has to get the send location from database and not hard coded.

    As Rachit said, I can create a custom pipeline component and by using the following code the send location can be dynamic.

    msgToBeSend.Context.Promote("OutboundTransportLocation", "http://schemas.microsoft.com/BizTalk/2003/system-properties", YourOutboundURLFromDatabase),

    but I don’t want to create the custom pipeline component I have the Orchestration and I believe there must be a way to use the OutboundTransportLocation in orchestration and I can set the send location here, but when I tried to do this by using the following line of code in MessageAssigne Shape I get nothing, although this does compile successfully but file don’t generate at given location and sparingly I also cannot find the message in Suspend stage neither any error in error log.

    SndMessage(BTS.OutboundTransportLocation)= @"file://C:\DynamicPort\%SourceFileName%.xml"

     Question is that, the way I used in orchestration to set the send file location is the right way? What I am doing wrong that file not generated on provided location?

    I hope this get clear to you now.

    Thanks

    Thursday, October 6, 2016 3:47 PM
  • Well still not sure what conditions that you want to evaluate to assign the send port..but why such a requirement??? 

    How many such location are you planning to use?

    TO answer your second question..

    what you did inside the orchestration will not promote the property in the message context..it will just write the property in the message context. Orchestration uses the concept o correlation to promote the property..

    You have to initialize the correlation set on your send port and then the property will be promoted..

    refer

    Property Promotion inside Orchestration

    Regards,


    Mandar Dharmadhikari

    Thursday, October 6, 2016 4:37 PM
  • I totally understand.  I would actually solve a different problem.

    Instead of addressing the Dynamic Port problem, I would address the Agreement Send Port problem by not specifying the Send Port in the Agreement.

    Instead, I would (and very frequently do) use the EDI.DestinationPartyName Property to match the outgoing Message to the Agreement.

    This is described as Option 3 here: https://msdn.microsoft.com/en-us/library/bb259945.aspx

    This has the added benefit of not tying the Agreement to specific Send Ports which has implications for deployment and working with binding files.

    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Thursday, October 6, 2016 4:39 PM
  • Mandar ,

    you said that,"You have to initialize the correlation set on your send port and then the property will be promoted."

    how can I do this? can you please further explain this!

    Thanks


    Thursday, October 6, 2016 5:12 PM
  • Hi M.Yaseen,

    Refer the link I shared, it is a tutorial...just go through the link and try it..

    But I would suggest you also look at the approach suggested by Johns305

    Regards,


    Mandar Dharmadhikari

    Thursday, October 6, 2016 5:15 PM
  • Thanks guys, the approach suggested by  Johns305 has worked for me.

    Regards,

    Yasin


    Tuesday, October 11, 2016 2:27 PM
  • For the benefit of future readers, please mark the appropriate answer as Answer or Helpful.
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 2:38 PM
  • Answer
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 3:16 PM
  • Oh, you should change the Thread Type to Question, then mark the Answer(s) and Helpful posts.
    • Marked as answer by GoforWin Wednesday, October 12, 2016 8:56 PM
    Tuesday, October 11, 2016 3:42 PM