Deploying "pure" web-services with BTDF

Topics: IIS and Web Services
Jan 13, 2010 at 10:21 PM
Edited Jan 13, 2010 at 11:41 PM

Please read this link for full background on this discussion: http://biztalkdeployment.codeplex.com/WorkItem/View.aspx?WorkItemId=5675

After spending probably 4 days or more trying to integrate XmlPreprocess (also on CodePlex) into a VisualStudio .vdproj or WIX custom action, and designing custom WIX dialogs, I decided that I needed something more streamline - more in tune with what BizTalk Developers are already familiar with.

The goal is to deploy a "pure" web service in an enterprise manner, and adjust its config file to based on the same or similar SettingsFileGenerator.xml used by the BT application.

I began by creating a .Deployment subdirectory, and copy an working .btdfproj file

I turned off all BizTalk artifacts, leaving on only the Virtual IIS:

<!-- Set following properties to true or false to include various pieces of a BizTalk deployment. -->
    <IncludeSchemas>false</IncludeSchemas>
    <IncludeOrchestrations>false</IncludeOrchestrations>
    <IncludeTransforms>false</IncludeTransforms>
    <IncludePipelines>false</IncludePipelines>
    <IncludeComponents>false</IncludeComponents>
    <IncludePipelineComponents>false</IncludePipelineComponents>
    <IncludeCustomFunctoids>false</IncludeCustomFunctoids>
    <IncludeVocabAndRules>false</IncludeVocabAndRules>
    <IncludeVirtualDirectories>true</IncludeVirtualDirectories>
    <IncludeMessagingBindings>false</IncludeMessagingBindings>
    <IncludeDeploymentTest>false</IncludeDeploymentTest>
    <Includelog4net>false</Includelog4net>
    <IncludeSSO>false</IncludeSSO>
    <IncludeBAM>false</IncludeBAM>

I created a subdirectorycalled IISDirWCFWebServices, copied the WCF web service artifacts there, and use this code in the .btdfproj file:

<ItemGroup>
      <VDirList Include="*">
          <Vdir>TFBIC.RCT.WCFWebServicesSetupBTDF</Vdir>
          <Physdir>..\IISDirWCFWebServices</Physdir>
          <AppPool>RCT</AppPool>
      </VDirList>
  </ItemGroup>

 

For the first test, I have only done a "Tools" / "Deploy BizTalk Solution" from within VS2008.

Here are my results, observations, questions:

1) It created the IIS directory fine, except it is pointing to this directory on my disk:

C:\Source\TFBIC.RCT.WCFWebServices\IISDirWCFWebServices

 

2) It didn't seem to hook up the app pool (I need to make sure this is working properly in the regular BT deployment later).

 

3) It created a dummy BizTalk Application (visible from BTAdmin Console) based on this name:

<ProjectName>TFBIC.RCT.WCFWebServices</ProjectName>

Is there anyway to avoid this?  Yea - I know it's called the BIZTALK Deployment Framework - but anyway.

 

4) When I do the undeploy, it leaves the IIS virtual directory there (this is also something I never tested with regular BT deployment).

 

5) One of my main goals is to build the web.config properly. 

I'm confused whether this process happens at all when you do a local deploy.  Here is what I set up:

<DeveloperPreProcessSettings>$(MSBuildProjectDirectory)\EnvironmentSettings\local_settings.xml</DeveloperPreProcessSettings>
<Copy SourceFiles="..\IISDirWCFWebServices\web.config" DestinationFolder="$(RedistDir)" />

 

Results of MSI:

1) Tools / Build server Deploy MSI - fails if you don't have the PortBindingsMaster.xml, so I put the dummy file back in.  Apparently it tries to copy it.

2) Created IISVirtualDir, set to proper directory: C:\Program Files (x86)\TFBIC.RCT.WCFWebServices\IISDirWCFWebServices
but appPool not set as I specified.

3) Good news is that it's similar to Biztalk install.  Bad news is that it's similar to BizTalk install.  People who install web services are probably used to running one MSI.  With this scenario, you have to run the MSI, then still run the "Deploy".

4) I still haven't mastered the settings to get the file to "preprocess" correctly (see #5 on post above).  I'll work on that first thing tomorrow.

More coming...  (I'm going to save this and come back and edit so I don't risk losing what I typed)...

Neal

 

Thanks,

Neal Walters

 

 

 

Jan 13, 2010 at 11:31 PM
Edited Jan 13, 2010 at 11:43 PM

Merged with text above.

 

 

Coordinator
Jan 13, 2010 at 11:41 PM

Hi Neil,

We're no longer talking about BizTalk and there are quite a few posts on this topic now, so I think this is getting a bit off topic for this forum.  (Sorry, no offense intended.)

One of my co-workers wrote an exporter from the settings spreadsheet that exports to a WiX include format that includes a <CustomTable>.  Then, we include the generated file into our WiX install and use the WiX <util:XmlFile> task to write the settings from that CustomTable into the web.config after the files are dropped on the target machine.

To address some of your behavioral observations:

  1. The <Physdir> path is relative to the <solution>.Deployment folder
  2. AppPools are created on IIS6+ when you do a server deployment (MSI install, deploy from Start menu)
  3. You cannot override that behavior.
  4. It always leaves the vdir in place, because there is some risk in removing it.  Maybe a sysadmin created it in advance a certain way, or something else is pointing to it.  No way to know.
  5. If you have <DeveloperPreProcessSettings> uncommented then that will be used with a Visual Studio deploy.  I don't know where the <Copy> task is, but in order to be called it would have to be inside a target like <CustomDeploy>.

Thanks,
Tom

Jan 13, 2010 at 11:54 PM

LorneH has a good blog here also about WIX and XML subsitution that is built-in to WIX: http://weblogs.asp.net/lorenh/archive/2005/10/13/427398.aspx

I'm just striving for the perfect solution that is easy to "drop" in at any client's shop.  Not everybody has personnel to learn WIX and 5 other tools.
If they are going to tool-up to learn BTDF, then why not use same technology for web service deployment.

BTDF - one tool to rule them all.

Neal