description | title | ms.custom | ms.date | ms.service | ms.reviewer | ms.suite | ms.topic |
---|---|---|---|---|---|---|---|
Learn more about: MIME (BizTalk Server Sample) |
MIME (BizTalk Server Sample) |
06/08/2017 |
biztalk-server |
article |
The MIME sample demonstrates how to perform MIME encoding within a send pipeline.
This sample configures the folder MIMEIn as a receive location. When you place a file, such as the sample file ImageInput.gif, in this folder, [!INCLUDEbtsBizTalkServerNoVersion] processes the message in this file using the following steps:
-
Retrieve the message file from the receive location folder MIMEIn.
-
In the receive pipeline, pass the message through unchanged.
-
In the MessageBox database, route the message to the send pipeline.
-
In the send pipeline, perform MIME encoding and place the file into the send adapter folder MIMEOut.
<Samples Path>\Pipelines\MIME\
The following table shows the files in this sample and describes their purpose.
File(s) | Description |
---|---|
Cleanup.bat | Used to undeploy assemblies and remove them from the global assembly cache (GAC). Removes send and receive ports. Removes Microsoft Internet Information Services (IIS) virtual directories as needed. |
ImageInput.GIF | Sample input file. |
SampleMimeEncoding.btproj SampleMimeEncoding.sln |
Project and solution files for this sample. |
SampleMimeEncodingBinding.xml | Used for automated setup such as port binding. |
SendMimePipeline.btp | [!INCLUDEbtsBizTalkServerNoVersion] send pipeline file with the MIME Encoder component. |
Setup.bat | Used to build and initialize this sample. |
Use the following procedure to build and initialize the MIME sample.
-
In a command window, navigate to the following folder:
<Samples Path>\Pipelines\MIME
-
Run the file Setup.bat, which performs the following actions:
-
Creates the input (MIMEIn) and output (MIMEOut) folders for this sample in the folder:
<Samples Path>\Pipelines\MIME
-
Compiles the [!INCLUDEbtsVStudioNoVersion] project for this sample.
-
Creates and binds the [!INCLUDEbtsBizTalkServerNoVersion] receive location, and the send and receive ports.
[!NOTE] This sample displays the following warning when creating and binding the ports:
[!NOTE]
Warning: Receive handler not specified for receive location "MIMEReceiveLocation"; updating with first receive handler with matching transport type.
[!NOTE] You can safely ignore these warnings. (To accommodate for possible naming differences in user installations, the host name and receive handler have been omitted from the binding file.)
-
Enables the receive location, and starts the send port.
-
Note
If you run this sample from a location other than where it is installed, you must first add a reference to the Microsoft.BizTalk.Pipeline.Components assembly.
[!NOTE] You should confirm that [!INCLUDEbtsBizTalkServerNoVersion] did not report any errors during the build and initialization process before attempting to run this sample.
[!NOTE] If you choose to open and build the project in this sample without running the file Setup.bat, you must first create a strong name key pair using the .NET Framework Strong Name utility (sn.exe). Use this key pair to sign the resulting assembly. To undo changes made by Setup.bat, run Cleanup.bat. You must run Cleanup.bat before running Setup.bat a second time.
Use the following procedure to run the MIME sample.
-
Put a copy of the file ImageInput.gif into the folder MIMEIn.
-
Observe the text file created in the folder MIMEOut. The name of this text file is based on the message ID GUID. This file contains MIME-encoded content of the input file ImageInput.gif.