Sanjeev Kumar Paul

Hi All,

I want to know whether BTS supports config file or not, if yes where i will get that and what is the name of that.I found in the installation folder of BTS but i am not clear which one to use.Can anyone please let me know which folder shall i use to define some values in it and how to use it in Orchestration.If possible please send me the code for that also.

My requirement is to define a the path name in the config file and use that key value in the Orchestration to create a dynamic send port.

Thanx in Advance.



Re: BizTalk R2 General App Config in BTS

Richard Hallgren

Where to store config values are alway debatable. The config file is by far the easiest. Use for example

System.Configuration.ConfigurationSettings.AppSettings to read it.

Richard Hallgren

http://www.richardhallgren.com






Re: BizTalk R2 General App Config in BTS

Sanjeev Kumar Paul

Hi Richard,

I tried to use BTSNTSvc.exe.config but whenever i am trying to start the application i am getting the error and it also stops the BTS service.My requirement is to declare is to add one key value "FilePath" in config and to fetch that filepath in the Orchestration and to create a dynamic port using that path.Please let me know which config file i have to use fior this.

Thanx in Advance.





Re: BizTalk R2 General App Config in BTS

Richard Hallgren

Hi,

This is the downside of using the BizTalk config file. If you mess it up the BizTalk service will not be able to start - dangerous stuff in a production environment. Also if you have several machines running your services you'll have to define the config setting in all the config files on the different machines.

In you case however I'd first try and validate the config file (for example opening it in a browser) - you probably made a small typo somewhere in there. If you can't get in to work try and show us your config file.

Richard Hallgren

http://www.richardhallgren.com






Re: BizTalk R2 General App Config in BTS

Sanjeev Kumar Paul

I have added the following line in the config file which is in red.

< xml version="1.0" >
<configuration>
<add key = "FilePath" value="D:\\TestingFiles\\"></add>
<runtime>
<assemblyBinding xmlns="urnTongue Tiedchemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop" />
</assemblyBinding>
</runtime>

<system.runtime.remoting>

<channelSinkProviders>
<serverProviders>
<provider id="sspi" type="Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine" securityPackage="ntlm" authenticationLevel="packetPrivacy" />
</serverProviders>
</channelSinkProviders>

<application>
<channels>
<channel ref="tcp" port="0" name="">
<serverProviders>
<provider ref="sspi" />
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

</configuration>

Please help me in solving this problem.





Re: BizTalk R2 General App Config in BTS

Richard Hallgren

Put your add key inside a "appsettings"-tag below the "configuration"-tag. Some info about it here.


Code Block

< xml version="1.0" >
<configuration>

<appSettings>
<add key = "FilePath" value="D:\\TestingFiles\\"></add>

</appSettings>
<runtime>
<assemblyBinding xmlns="urnchemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop" />
</assemblyBinding>
</runtime>

<system.runtime.remoting>

<channelSinkProviders>
<serverProviders>
<provider id="sspi" type="Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine" securityPackage="ntlm" authenticationLevel="packetPrivacy" />
</serverProviders>
</channelSinkProviders>

<application>
<channels>
<channel ref="tcp" port="0" name="">
<serverProviders>
<provider ref="sspi" />
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

</configuration>

Richard Hallgren

http://www.richardhallgren.com






Re: BizTalk R2 General App Config in BTS

Sanjeev Kumar Paul

Thanx a lot Richards,

Now i am able to fetch the file path from the config file. But still i am getting one new error,i am creating a dynamic folder with the file path which i am fetching from the config file and for this i have written the following code.

strFilePath= System.Configuration.ConfigurationSettings.AppSettings.Get("FilePath");

System.IO.Directory.CreateDirectory(strFilePath);

DynamicSendPort(Microsoft.XLANGs.BaseTypes.Address) = "file://" + strFilePath + strFileName;

Error:

There was a failure executing the send pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port: "LearningBiztalk_1.0.0.0_LearningBiztalk.FileOrchestration_DynamicSendPort_c4c84f71ba22f173" URI: file://D:\\TestingFiles\\TestingFile Reason: Invalid character in the given encoding. Line 1, position 1.

I am getting the full path and file name correctly but i dont know where i am giving a invalid character.

Please help me in solving this error.