Quantcast
Channel: BizTalk Server General Forum
Viewing all articles
Browse latest Browse all 872

How to get the partner custom data from the Party Information by using C# code

$
0
0

Hi,

I need Partner Custom Data (xml file) from the BizTalk Parties. For example i have created a party in biztalk and then in BTAHL7 Configuration explorer I have added some other informations to this party. This is my custom data. I got the following code from one blog but since profile.Partner.CustomData is non public member hence i am not able to fetch the value from the same. Here is the code:

//enumerate all the TPM Profiles in BizTalk
            var builder =
                new SqlConnectionStringBuilder("DATA SOURCE=localhost;Initial Catalog=BizTalkMgmtDb;"
            + "Integrated Security=SSPI;MultipleActiveResultSets=True");
            var tmpCtx = TpmContext.Create(builder);

           
            textBox1.Text = "Connected to BizTalk Global Parties" + System.Environment.NewLine.ToString();
            var partners = tmpCtx.Partners;
            textBox1.Text = textBox1.Text + string.Format("Number of Parters:{0}", partners.Count()) + System.Environment.NewLine.ToString();
            textBox1.Text = textBox1.Text + ("------------") +  System.Environment.NewLine.ToString();

            foreach (var ptr in partners)
            {
                var profiles = ptr.GetBusinessProfiles();
               
                textBox1.Text = textBox1.Text + string.Format("{0} Business Profiles:{1}", ptr.Name, profiles.Count) + System.Environment.NewLine.ToString();
                foreach (var profile in profiles)
                {
                   var customData = profile.Partner.CustomData;
                    textBox1.Text = textBox1.Text+ string.Format("\tProfile:{0}", profile.Name) + System.Environment.NewLine.ToString();
                }
            }
            //tmpCtx.Dispose();
            //if (bCreateProfile)
            //{
            //    createProfile("Breeze Partner #");
            //}
            textBox1.Text = textBox1.Text + ("Finished") + System.Environment.NewLine.ToString();

---------------------------------------------------------------------------------------------------------------

Is there any other way to get the partner custom data?


https://www.mcpvirtualbusinesscard.com/VBCServer/card.aspx?tag=YagyaDattMishra&wa=wsignin1.0



Viewing all articles
Browse latest Browse all 872

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>