BizTalk Server Orchestration - App.config or Web.config in Orchestration BT project?

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > October 2004 > App.config or Web.config in Orchestration BT project?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author App.config or Web.config in Orchestration BT project?
Ben Jiang

2004-10-04, 5:52 pm

Hi there,
In a BT project (with Orchestration) I need to read some initialization
information which are configurable (such as Web service URL, Authentication
information etc.). Do we have a way to leave a web.config (or app.config)
like a normal dot net application in somewhere so that at runtime, the
orchestration process can read from them?

The question is because I would like to build just once in my development
environment for a BT project and then I can deploy to QAT, UAT and PROD
environment by just updating the configuration file.

One thing I can NOT understand is why You have to register any assemblies in
GAC for a BT project? (Does this lose the most advanced feature for DOT NET
that You do NOT have to share any library if you do NOT want to?)

Does a BT project have a application domain (context)?

Thanks beforehand.
Cheers
Ben Jiang
Wurox

2004-10-05, 5:54 pm

Hi you can add configuration keys in C:\Program Files\Microsoft BizTalk
Server 2004\BTSNTSvc.exe.config.

- Wurox


"Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
news:A08AEA55-F666-4F59-A7F9-C329F598EED5@microsoft.com...
> Hi there,
> In a BT project (with Orchestration) I need to read some initialization
> information which are configurable (such as Web service URL,

Authentication
> information etc.). Do we have a way to leave a web.config (or app.config)
> like a normal dot net application in somewhere so that at runtime, the
> orchestration process can read from them?
>
> The question is because I would like to build just once in my development
> environment for a BT project and then I can deploy to QAT, UAT and PROD
> environment by just updating the configuration file.
>
> One thing I can NOT understand is why You have to register any assemblies

in
> GAC for a BT project? (Does this lose the most advanced feature for DOT

NET
> that You do NOT have to share any library if you do NOT want to?)
>
> Does a BT project have a application domain (context)?
>
> Thanks beforehand.
> Cheers
> Ben Jiang



Bill Chesnut

2004-10-05, 5:54 pm

Ben,

This is an issue caused by your BizTalk assemble running from the GAC
(Global Assemble Cache).

What I recommend is to put this information in a simple business rule policy
that you call when the orchestration starts.

Bill Chesnut [Biztalk MVP]

"Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
news:A08AEA55-F666-4F59-A7F9-C329F598EED5@microsoft.com...
Hi there,
In a BT project (with Orchestration) I need to read some initialization
information which are configurable (such as Web service URL, Authentication
information etc.). Do we have a way to leave a web.config (or app.config)
like a normal dot net application in somewhere so that at runtime, the
orchestration process can read from them?

The question is because I would like to build just once in my development
environment for a BT project and then I can deploy to QAT, UAT and PROD
environment by just updating the configuration file.

One thing I can NOT understand is why You have to register any assemblies in
GAC for a BT project? (Does this lose the most advanced feature for DOT NET
that You do NOT have to share any library if you do NOT want to?)

Does a BT project have a application domain (context)?

Thanks beforehand.
Cheers
Ben Jiang


Ben Jiang

2004-10-05, 5:54 pm

Thanks Wurox. How do I use this config file? Do we have any doc to reference
to?
Cheers
Ben Jiang

"Wurox" wrote:

> Hi you can add configuration keys in C:\Program Files\Microsoft BizTalk
> Server 2004\BTSNTSvc.exe.config.
>
> - Wurox
>
>
> "Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
> news:A08AEA55-F666-4F59-A7F9-C329F598EED5@microsoft.com...
> Authentication
> in
> NET
>
>
>

Wurox

2004-10-06, 2:47 am

You have to add appSettings tag inside configuration tag in
BTSNTSvc.exe.config

<configuration>

<appSettings>

<add key="Key1"/>

<add key="Key2"/>

</appSettings>

</configuration>

You can get this key in code like this:

AppSettingsReader configReader = new AppSettingsReader();

Key1 = configReader.GetValue(Key1, typeof(string)).ToString();



-Wurox

"Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
news:424689FC-FB93-4F97-B4FD-F2793926EB8D@microsoft.com...
> Thanks Wurox. How do I use this config file? Do we have any doc to

reference[vbcol=seagreen]
> to?
> Cheers
> Ben Jiang
>
> "Wurox" wrote:
>
initialization[vbcol=seagreen]
app.config)[vbcol=seagreen]
development[vbcol=seagreen]
PROD[vbcol=seagreen]
assemblies[vbcol=seagreen]
DOT[vbcol=seagreen]


Ben Jiang

2004-10-06, 5:49 pm

Thanks.
Is this information available for all BT assemblies on the BT server?
Also I have to restart the host after updating this config file?
Do we have a way to provide its own config file for each BT assembly?
(or a section in the BTSNTSvc.exe.config delicated only to a BT assembly?)

I hope MS provides some documentation about these.

Cheers
Ben Jiang

"Wurox" wrote:

> You have to add appSettings tag inside configuration tag in
> BTSNTSvc.exe.config
>
> <configuration>
>
> <appSettings>
>
> <add key="Key1"/>
>
> <add key="Key2"/>
>
> </appSettings>
>
> </configuration>
>
> You can get this key in code like this:
>
> AppSettingsReader configReader = new AppSettingsReader();
>
> Key1 = configReader.GetValue(Key1, typeof(string)).ToString();
>
>
>
> -Wurox
>
> "Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
> news:424689FC-FB93-4F97-B4FD-F2793926EB8D@microsoft.com...
> reference
> initialization
> app.config)
> development
> PROD
> assemblies
> DOT
>
>
>

Ben Jiang

2004-10-08, 2:46 am

After a few pain and search about this issue, I finally come the following
solution:

In file BTSNTSvc.exe.config in BT installation folder(normally C:\Program
Files\Microsoft Biztalk Server 2004), add the following just below the
opening configuration tag

<configSections>
<section name="xlangs"
type="Microsoft.XLANGs.BizTalk.CrossProcess. XmlSerializationConfigurationSectionHand
ler, Microsoft.XLANGs.BizTalk.CrossProcess" />
</configSections>

<xlangs>
<Configuration>
<AppDomains AssembliesPerDomain="10">
<AppDomainSpecs>
<AppDomainSpec Name="MyAppDomain" SecondsIdleBeforeShutdown="-1"
SecondsEmptyBeforeShutdown="12000">
<BaseSetup>
<ConfigurationFile>c:\temp\app.config</ConfigurationFile>
</BaseSetup>
</AppDomainSpec>
</AppDomainSpecs>
<ExactAssignmentRules>
<ExactAssignmentRule AssemblyName="myAssemblyName, Version=1.0.0.0
Culture=neutral PublicKeyToken=5a4c37737373" AppDomainName="MyAppDomain" />
</ExactAssignmentRules>
</AppDomains>
</Configuration>
</xlangs>

My configuration file (c:\temp\app.config) contained the following
<configuration>
<appSettings>
<add key="mykey" value="myvalue" />
</appSettings>
</configuration>

Now in My BT Orchestration project (myAssemblyName) or any librarys it
refers to, I can use
System.Configuration.ConfigurationSettings.AppSettings("mykey")
to retrieve myvalue.

Please note that you must restart BT Host after update BTSNTSvc.exe.config
to make these changes available.

Hope this may help someone with the same pain I had.

Cheers
Ben Jiang

"Ben Jiang" wrote:
[vbcol=seagreen]
> Thanks.
> Is this information available for all BT assemblies on the BT server?
> Also I have to restart the host after updating this config file?
> Do we have a way to provide its own config file for each BT assembly?
> (or a section in the BTSNTSvc.exe.config delicated only to a BT assembly?)
>
> I hope MS provides some documentation about these.
>
> Cheers
> Ben Jiang
>
> "Wurox" wrote:
>
David

2004-10-15, 9:09 pm

Hello,

I am in a similar situation as you , but i need to be able to access
the value held in the config file inside a script functoid on a map,
is this possible?

in the config file BTSNTSvc.exe.config i have this just before the
closing configurations tag:

<appSettings>
<add key="IMSDataFeed.Orchestration.CODAWS.ConnectionString"
value="DSN=CODATEST"/>
<add key="InvoicePosting.Orchestration.CODAWS.Email.Subject"
value="CODA Web Service Error"/>
</appSettings>

i can access these ok inside the orchestration when i use

System.Configuration.ConfigurationSettings.AppSettings.Get("IMSDataFeed.Orchestration.CODAWS.ConnectionString");

but when i try to use it in the script functiod like this

public string returnconnectionstring()
{
string connectionstring =
ConfigurationSettings.AppSettings.Get("IMSDataFeed.Orchestration.CODAWS.ConnectionString");
return (connectionstring);
}

I receive the following error:

C:\vss\Integration\Development\BizTalk\M
asterData\IMSDataFeed.Maps\1. x\MapSelectIMSFeedToSelectIMSFeedConcatS
QL
v1.0.btm Inline Script Error: The type or namespace name
'ConfigurationSettings' could not be found (are you missing a using
directive or an assembly reference?)

I tried looking for system.configuration.dll to add as a reference but
i cant seem to find it.

Thanks

David





Ben Jiang <BenJiang@discussions.microsoft.com> wrote in message news:<1975D854-D0CD-40E6-9BEA-52B050B5DDC0@microsoft.com>...[vbcol=seagreen]
> After a few pain and search about this issue, I finally come the following
> solution:
>
> In file BTSNTSvc.exe.config in BT installation folder(normally C:\Program
> Files\Microsoft Biztalk Server 2004), add the following just below the
> opening configuration tag
>
> <configSections>
> <section name="xlangs"
> type="Microsoft.XLANGs.BizTalk.CrossProcess. XmlSerializationConfigurationSectionHand
ler, Microsoft.XLANGs.BizTalk.CrossProcess" />
> </configSections>
>
> <xlangs>
> <Configuration>
> <AppDomains AssembliesPerDomain="10">
> <AppDomainSpecs>
> <AppDomainSpec Name="MyAppDomain" SecondsIdleBeforeShutdown="-1"
> SecondsEmptyBeforeShutdown="12000">
> <BaseSetup>
> <ConfigurationFile>c:\temp\app.config</ConfigurationFile>
> </BaseSetup>
> </AppDomainSpec>
> </AppDomainSpecs>
> <ExactAssignmentRules>
> <ExactAssignmentRule AssemblyName="myAssemblyName, Version=1.0.0.0
> Culture=neutral PublicKeyToken=5a4c37737373" AppDomainName="MyAppDomain" />
> </ExactAssignmentRules>
> </AppDomains>
> </Configuration>
> </xlangs>
>
> My configuration file (c:\temp\app.config) contained the following
> <configuration>
> <appSettings>
> <add key="mykey" value="myvalue" />
> </appSettings>
> </configuration>
>
> Now in My BT Orchestration project (myAssemblyName) or any librarys it
> refers to, I can use
> System.Configuration.ConfigurationSettings.AppSettings("mykey")
> to retrieve myvalue.
>
> Please note that you must restart BT Host after update BTSNTSvc.exe.config
> to make these changes available.
>
> Hope this may help someone with the same pain I had.
>
> Cheers
> Ben Jiang
>
> "Ben Jiang" wrote:
>
> reference
> initialization
> Authentication
> app.config)
> development
> PROD
> assemblies
> in
> DOT
> NET
Matt Milner

2004-10-15, 9:09 pm

You might need to use an external assembly for your functoid instead of
inline script. There is a limited amount of supported libraries in maps.

Matt


"David" <david.cheung@gmail.com> wrote in message
news:83ad30f9.0410130442.6e3fa79f@posting.google.com...[vbcol=seagreen]
> Hello,
>
> I am in a similar situation as you , but i need to be able to access
> the value held in the config file inside a script functoid on a map,
> is this possible?
>
> in the config file BTSNTSvc.exe.config i have this just before the
> closing configurations tag:
>
> <appSettings>
> <add key="IMSDataFeed.Orchestration.CODAWS.ConnectionString"
> value="DSN=CODATEST"/>
> <add key="InvoicePosting.Orchestration.CODAWS.Email.Subject"
> value="CODA Web Service Error"/>
> </appSettings>
>
> i can access these ok inside the orchestration when i use
>
> System.Configuration.ConfigurationSettings.AppSettings.Get("IMSDataFeed.Orchestration.CODAWS.ConnectionString");
>
> but when i try to use it in the script functiod like this
>
> public string returnconnectionstring()
> {
> string connectionstring =
> ConfigurationSettings.AppSettings.Get("IMSDataFeed.Orchestration.CODAWS.ConnectionString");
> return (connectionstring);
> }
>
> I receive the following error:
>
> C:\vss\Integration\Development\BizTalk\M
asterData\IMSDataFeed.Maps\1. x\MapSelectIMSFeedToSelectIMSFeedConcatS
QL
> v1.0.btm Inline Script Error: The type or namespace name
> 'ConfigurationSettings' could not be found (are you missing a using
> directive or an assembly reference?)
>
> I tried looking for system.configuration.dll to add as a reference but
> i cant seem to find it.
>
> Thanks
>
> David
>
>
>
>
>
> Ben Jiang <BenJiang@discussions.microsoft.com> wrote in message
> news:<1975D854-D0CD-40E6-9BEA-52B050B5DDC0@microsoft.com>...


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com