Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Adapters - Configuring HTTP Sends

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/28/2011 3:32:41 PM

1. Problem

You want to programmatically configure an HTTP send port from an orchestration using a Message Assignment shape.

2. Solution

This solution will describe how to post a document using a send port configured with authentication to post via a secure HTTPS site. The following solution assumes you have a BizTalk project open in Visual Studio with a BizTalk orchestration and a schema that can be used to create an orchestration message. Here are the steps to follow:

  1. Create a new orchestration message by right-clicking the Messages folder in the Orchestration View window and selecting New Message. Enter msgSend for the message name, and give it a message type (this should be the schema of the document that will be sent via HTTP).

  2. Setting HTTP properties requires constructing the message that will be sent. Drop a Message Assignment shape in the orchestration. This will create a Construct Message shape that should be configured such that the Message Constructed property is set to the message created in step 1.

  3. Double-click the Message Assignment shape, and enter the property settings as shown in Listing 1. Figure 1 shows the properties available in the Message Assignment Editor. Click OK when complete.

    Example 1. Message Assignment Code
    // Set HTTP send port properties; the username and password can be
    // configurable by using the config file or BizTalk rules engine
    // rather than hard-coded values
    msgSend(HTTP.AuthenticationScheme) = "Basic";
    msgSend(HTTP.Username) = "User"; // can be loaded from config file, also
    msgSend(HTTP.Password) = "Password"; // can be loaded from config file
    // configure additional parameters as appropriate

    Figure 1. Viewing the HTTP parameters in the Message Assignment Editor

    NOTE

    When selecting properties from the drop-down list in the Message Assignment shape, you'll see all the properties you can set. Specific to HTTP, both the Send and Receive properties are listed. A complete list of Send properties appears in Table 1.

  4. Drop a Send shape on the orchestration surface. Set the Message property to the message created in step 1.

  5. Right-click the port surface, and select New Configured Port. On the Port Binding page, set the parameters as indicated in the following substeps and shown in Figure 2:

    1. Set "Port direction of communication" to "I'll always be sending messages on this port."

    2. Set "Port binding" to "Specify now".

    3. Set Transport to HTTP.

    4. Set URI to the URL being posted to (https://Sample).

    5. Set the pipeline to the default XMLTransmit pipeline.

Figure 2. Using the Port Configuration Wizard

Table 1 describes the details of each of the port properties you can set for the HTTP port via code in an Expression shape of an orchestration. These are the same parameters you set when configuring an HTTP send port in the BizTalk Explorer.

Table 1. HTTP Port Parameters
PropertyType
AffiliateApplicationNameWhen using SSO, you can specify an affiliate application. You enter the name of the application as a string. When using this property, the UseSSO property must be set to True.
AuthenticationSchemeYou can set four types of authentication: Anonymous, Basic, Digest, and Kerberos. When using Basic and Digest, you should set the Password and Username properties.
CertificateIf you are using a certificate (for HTTPS), you should enter the thumbprint of the certificate as a string here. Thumbprints are typically found in the properties of the certificate and are 40-digit hexadecimal values.
ContentTypeThe default value is Text/XML. This is a string.
EnableChunkedEncodingBoolean value that indicates whether to send the document in chunked packets of information.
HttpCookieProperties available if using cookies.
InboundHttpHeadersThe HTTP headers may be available on inbound HTTP messages.
MaxRedirectsThe HTTP adapter can be set to allow for 0 to 10 redirects.
PasswordPassword used when posting to a secure site. AuthenticationScheme should be set to Basic or Digest.
ProxyNameIf a proxy server is used, enter the name of the server as a string.
ProxyPasswordPassword for proxy server. The UseProxy property should be set to True, and UseHandlerProxySettings should be set to False.
ProxyPortPort for proxy server. An example would be 80.
ProxyUsernameUsername for proxy server. The UseProxy property should be set to True, and UseHandlerProxySettings should be set to False.
RequestTimeoutBy default, the timeout will be managed based on the size of the document. This can be overridden with a specific timeout value entered as a numeric entry (in seconds).
ResponseStatusCodeProperties available regarding the status code of the response.
SubmissionHandleSubmission handle, if available.
UseHandlerProxySettingsIf set to True, other proxy properties that may be set are overridden, and the send port will use the proxy handler configuration.
UseProxyBoolean value. Use other proxy properties in conjunction with this value.
UserHttpHeadersHTTP headers, if available.
UsernameUsername used when posting to a secure site. AuthenticationScheme should be set to Basic or Digest.
UseSSOA Boolean value indicating whether to use the SSO server. Use the AffiliateApplicationName property in conjunction with this.

3. How It Works

When sending documents via a send port, exceptions can occur—perhaps the HTTP server is unavailable or the URL is incorrect. In such cases, it is often useful to be able to catch the exception immediately in the orchestration, especially when specific error handling routines need to occur.

By default, send ports are set up to automatically retry in case of failure. This means an orchestration will call the send port and then continue processing asynchronously while the adapter manages the transmission of the document. If an exception is thrown, it is handled by the adapter and is never bubbled up to the orchestration. With the adapter operating asynchronously from the orchestration, exceptions that are thrown can result in lost messages and unexpected error messages.

To force the adapter to execute synchronously with the orchestration moving on to the next steps only when a message has been posted successfully by the adapter, you should set the Delivery Notification property on the send port to Transmitted, as shown in Figure 3.

Figure 3. Setting the Delivery Notification property
Other -----------------
- Windows Server 2003 : Securing Network Communications Using IPSec - Troubleshooting Data Transmission Security
- Windows Server 2003 : Securing Network Communications Using IPSec - Deploying IPSec
- Transitioning from Exchange Server 2003 to Exchange Server 2010 (part 3) - Cleaning Up the Exchange Server 2003 and Exchange Server 2003 Environments
- Transitioning from Exchange Server 2003 to Exchange Server 2010 (part 2)
- Transitioning from Exchange Server 2003 to Exchange Server 2010 (part 1)
- BizTalk 2010 Recipes : Adapters - Receiving Messages with the SQL Adapter
- BizTalk 2010 Recipes : Adapters - Calling Stored Procedures
- Deploying a Prototype Lab for the Exchange Server 2010 Transition Process
- Understanding What’s New and What’s Different with Exchange Server 2010
- Understanding How to Transition to Exchange Server 2010
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server