Recovering SAP BAPI Transactions with Custom Pipelines

Published 12-29-2020 10:21 AM 1,007 Views

Introduction

 

One of the ways that BizTalk can access SAP servers is by using Business Application Programming Interfaces (BAPIs), as documented in Operations on BAPIs in SAP. SAP introduced BAPIs as an object-oriented way to structure business data and processes.  It is assumed that the reader has some familiarity with how to use this functionality in BizTalk. 

 

In this article, we conclude our series on BAPI transactions by presenting, step-by-step, another implementation of the sales orders received in batches and created in SAP by using BAPI transactions. Reading the past articles is not required (but encouraged) as there is some background covered here.

The following was covered in past articles:

The design here is a combination of the previous concepts into a solution that integrates the powerful BizTalk pipeline features such as batch processing, XML disassembly, XML validation, and Recoverable Interchange Processing (RIP). It is also the opportunity to provide more details on topics that were briefly touched upon, in the same step by step style - the intent being to serve as the "missing documentation" for SAP BAPI transactions in BizTalk. We present how to:

  • Leverage XML disassembler and XML validator in the receive location in order to "front-load" the verifications previously done in the orchestration presented in  Handling Errors in SAP BAPI Transactions.
  • Write a custom pipeline component to promote properties (such as BTS.InterchangeID) needed for the same orchestration instance to process all messages in a batch as a single SAP Logical Unit of Work (LUW).
  • Implement layered verifications to improve the granularity of error handling presented in Handling Errors in SAP BAPI Transactions and find errors before they get to the send adapter.

All code is provided in the archive attached to this blog post.

NOTE: Starting with BizTalk Server 2016 CU6 and BizTalk Server 2020 CU1, BAPI transactions need to be enabled explicitly, by creating the registry value HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0\Configuration\EnableBizTalkSapSessionProvider of type DWORD and setting it to '1', as documented in the fix page.

 

1. BAPI Operations and Schemas

 

In the demo scenario, sales orders are received under the form of XML documents and transformed to BAPI Sales Order (BUS2032). The first pre-requisite is to download schemas and metadata for BAPI transactions by using the "Consume Adapter Service" in Visual Studio, as explained in this section of the SAP Adapter documentation.

 

The figure below depicts the generated schemas for the BAPI methods BUS2032.CREATEFROMDAT2 (shortened to CREATEFROMDAT2 in the rest of this article) and BAPI_TRANSACTION_COMMIT. 

 

BAPI Schema GenerationBAPI Schema Generation

On the receiving side of BizTalk, we consider the general case where sales orders follow a simplified schema (Order) that may not necessarily correspond to the BAPI schema. A single XML document contains multiple orders, which are debatched in the receive location.

 

Order SchemaOrder Schema

The first step for using a debatching pipeline is to define an envelope schema to represent multiple orders. This is done according to the following process, initially documented in Calling a pipeline inside an orchestration:

  1. Add a new schema file to the project.
  2. Change the root node name to "Orders".
  3. In the properties window for the <schema> treeview node: (a) change the Envelope property to Yes, and (b) import the Order schema.
  4. In the properties window for the "Orders" root node, set the Body XPath property to /*[local-name()='Orders' and namespace-uri()='<namespace of the schema here'
  5. Insert a child record under the root node.
  6. In the child record properties, set the data structure type field to Order. As a result, the Order definition will appear under Orders.

 

Creating the Orders Envelope SchemaCreating the Orders Envelope Schema

The message flow with the different schemas is shown in the following figure.

 

Message FlowMessage Flow

Note: The send port is actually a Static Solicit-Response port. Responses from SAP are not shown here.

 

We assumed that received messages follow a simplified client-defined schema (Orders/Order) rather than CREATEFROMDAT2 directly, in order to make the demo scenario more general. Everything presented below is applicable with minor changes if batches of CREATEFROMDAT2 are received instead. A client schema makes sense in an integration context, where the source is decoupled from the destination; for instance, if the organization sending sales orders does not need to be aware that these sales orders are processed in BizTalk by creating CREATEFROMDAT2 BAPI transactions. Furthermore, BAPI schemas depend on the SAP system, and they can contain several hundreds of elements, many of them not necessarily applicable to every sales orders.

 

2. From Interchanges to LUWs

 

The key to understanding what designs can accommodate BAPI transactions is interchanges

As explained in Run BAPI Transactions in SAP using BizTalk Server, the message context property Microsoft.Adapters.SAP.BiztalkPropertySchema.ConnectionState is used to associate a BAPI transaction to a Logical Unit of Work (LUW) on the SAP server. So, the first transaction has the property set to "OPEN", subsequent transactions set it to "REUSE", and the last transactions have either "CLOSE" or "ABORT". This implies that messages are (1) grouped, and (2) ordered, to the extent that we can differentiate between first message, middle messages, and last message.

 

A series of transaction messages (i.e. OPEN-REUSE-REUSE-…-CLOSE) requires the same connection for outbound communication with the SAP server, and this connection is mapped to an LUW on the SAP server side by interchange id and send port id. The message properties look like:

 

BAPI Messages Context PropertiesBAPI Messages Context Properties

To put it in layman's terms, for BAPI transactions to be in the same LUW from OPEN to CLOSE/ABORT, they need to come from the same "place" (the interchange id) and to be sent out  to the same "destination" (the send port) with the same route (the "session"). The use of {interchange id + send port id} is compatible with the "session" paradigm provided by the SAP Connector for Microsoft .NET (NCo) to expose the BAPI Transaction Model documented by SAP

 

Common interchange id means that outbound messages are part of the same interchanges, which is achieved in the following setups:

  1. If messages are received by the same orchestration instance. It is the design presented in SAP BAPI Transactions Walkthrough, where incoming order messages provide a promoted id property used as correlation set in order to use the same orchestration instance for a series of related orders.
  2. If messages are debatched, as in Debatching SAP BAPI Transactions where debatching was done by an in-orchestration receive pipeline.

The current design is a combination of 1 and 2: Messages are debatched in the receive location and their BTS.InterchangeID property is used as correlation set by orchestration instances. Details are presented next.

 

3. Debatching Orders in the Receive Location

 

Let's look at the receive location settings.

Receive Location SettingsReceive Location Settings

We use a custom pipeline, shown below, in order to promote the BTS.InterchangeID property, which is otherwise not accessible from within orchestrations.

 

Custom Receive PipelineCustom Receive Pipeline

The custom pipeline uses the default XML disassembler and validator, which provides access to Recoverable Interchange Processing (RIP), feature which allows processing to go on if some messages within a batch are invalid. With standard interchange processing, the existence of any invalid message in a given interchange causes the entire interchange to be suspended even if it contains one or more valid messages. In the configuration of XML disassembler and validator, schemas and envelope schemas can be left blank; BizTalk automatically resolves the envelope and inner schemas from the messages.

 

The last validation stage is the custom pipeline component itself, which is based on a reusable pattern introduced in the WCF LOB Adapter SDK. 

The relevant portions of the code (which may be found in the attached archive) are shown below. A class called NotifyingStream designed as a decorator of the Stream class, is used to invoke callbacks for specific events corresponding to when the stream is read. In our case, the custom pipeline component PromoteInterchangeId receives a notification when the entire stream has been read, thereby guaranteeing that all promoted properties from the message have been populated to the message context. 

 

public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
IBaseMessage outmsg = inmsg;
Stream notifyingStream = new NotifyingStream(inmsg.BodyPart.Data, null, null, new NotifyingStream.LastReadOccurred(EndOfStream));
outmsg.BodyPart.Data = notifyingStream;
mBaseMessage = outmsg;return outmsg;
}

internal void EndOfStream()
{
string interchangeId = (string)mBaseMessage.Context.Read("InterchangeID", "http://schemas.microsoft.com/BizTalk/2003/system-properties");
mBaseMessage.Context.Promote("InterchangeID", "http://schemas.microsoft.com/BizTalk/2003/system-properties", interchangeId);

// This is the place to add more promotions as needed, as explained in the blog post
}
public class NotifyingStream : Stream
{
Stream mBaseStream;
public delegate void LastReadOccurred();

public NotifyingStream(Stream BaseStream, ..., LastReadOccurred LastReadCallback)
{
mBaseStream = BaseStream;
mLastReadCallback = LastReadCallback;
}

public override int Read(byte[] buffer, int offset, int count)
{
if (mBaseStream.Read(buffer, offset, count) == 0 && mLastReadCallback != null)
{
mLastReadCallback();
}
}
// All other methods call the ones from Stream directly.

Sample Code for Custom Receive PipelineSample Code for Custom Receive Pipeline

In addition to the promotion of BTS.InterchangeID, the custom pipeline component also sets the following properties, added for illustration purposes and for design alternatives considered later on:

- BatchId, which can be used as an alternative to using BTS.InterchangeID directly.

- BTS.SuspendMessageOnMappingFailure property, which can be used to add RIP behavior at the mapping phase in a receive port, as documented in Mapping Phase (Recoverable Interchange Processing).

- BTS.LastInterchangeMessage, which is used to indicate the last message in a batch. It is by default not set for other messages, thereby causing an exception if accessed from an expression in an orchestration. Adding the property to each message simplifies the orchestration later on.

The custom component was installed according to Deploying Custom Pipeline Components.

 

4. Orchestration Overview

 

The long-running orchestration relies on (1) the interchange id to pin messages within a batch to the same instance, and (2) Ordered Delivery of Messages to differentiate first-middle-last messages of the interchange. Processing can be decomposed into four stages, illustrated below:

  1. Validation
  2. LOB send/receive
  3. If last message, commit and exit
  4. Other messages: loop.

 

Orchestration StagesOrchestration Stages

As previously mentioned, a single orchestration instance processes all messages in a batch, which are correlated based on their interchange id. More info regarding correlations may be found in Sequential Convoy & Singleton Orchestration. This is illustrated in the following figure:

 

BTS.InterchangeID as Orchestration CorrelationBTS.InterchangeID as Orchestration Correlation

An alternative to promoting and using the system property BTS.InterchangeID directly (for instance because we don't want to change it by mistake) is to use a custom context property (BatchId) as depicted below.

 

BatchId User-Created Context PropertyBatchId User-Created Context Property

BatchId can be set to the BTS.InterchangeID value inside the custom pipeline component:

mBaseMessage.Context.Write("BatchId", "https://SapBAPITxClientDebatching.PropertySchema1", interchangeId);

 

Discussion: Logging and Error Handling

 

Before presenting each orchestration stage in detail, it is worth mentioning that logging is for demo purposes, to show the different places of interest that could be adapted to "real-world" applications, where further processing could be hooked up. 

At each stage, whether it is in the regular flow or in exception handling, we keep track of the order status with the following schema and expression:

 

Expression Shape for Logging Exceptions and MessagesExpression Shape for Logging Exceptions and Messages

A sequence of successful order creations looks like:

Status for Successful Transaction SequencesStatus for Successful Transaction Sequences

 

5. Orchestration Validation Stage

 

The receive port takes care of validating Order messages. The goal of the validation stage in the orchestration is to further validate data during and after transformation of Order to CREATEFROMDAT2, rather than letting the SAP adapter take care of it, as we saw in Handling Errors in SAP BAPI Transactions. This is not to say that one way is better than another, just that processing is distributed differently. For instance in the current design, errors caused by invalid data are caught before the data is handled in the adapter, which results in a simpler design later on, while limiting exception processing at the LOB stage to more systemic errors like connectivity. As illustrated in the figure below, in the current design, validation is layered

 

Validation Phases in OrchestrationValidation Phases in Orchestration

Each validation phase is explained in detail next.

 

5.1 Mapping Phase

 

First, the mapping of Order to CREATEFROMDAT2 is also a place where value verification can happen, for instance with script functoids.

 

Using Script Functoids for ValidationsUsing Script Functoids for Validations

As an example, purchase and requisition dates can be enforced to be in the past. The script functoid in the provided code looks like:

public static string CheckDateIsValid1(string param1)
{
if (string.IsNullOrWhiteSpace(param1))
{
return DateTime.Now.ToString("o");
}

DateTime outValue;
bool isValid = DateTime.TryParse(param1, out outValue);
if (!isValid || outValue > DateTime.Now)
{
// For demo purposes: throw an exception explicitly.
throw new Exception("Invalid PURCH_DATE.");
}
// Make sure the datetime follows the xsd datatype
return outValue.ToString("o");
}

There is a similar functoid for other data fields.

Note: Even if script functoids are identical for different fields, the method names need to be different for each pair of fields linked by a functoid.

 

Discussion: Transform at port level?

 

The receive port can be configured to do the mapping instead of letting it done in the orchestration. The setting is:

 

Transform in Receive PortTransform in Receive Port

In this case, the custom pipeline component also needs to set the BTS.SuspendMessageOnMappingFailure to make sure that processing goes on if a failure happens on a single Order, as documented in Mapping Phase (Recoverable Interchange Processing) It would be done as follows:

// Set recoverability to true for the mapping phase in case the receiver wants to transform from client to BAPI in the RL.
mBaseMessage.Context.Write("SuspendMessageOnMappingFailure", "http://schemas.microsoft.com/BizTalk/2003/system-properties", true);

The reason for doing the mapping in the orchestration in our demo scenario is that it allows all BAPI validations to happen in a single orchestration stage.

 

5.2 BAPI Validating Pipeline

 

We need the XML validator in order to catch additional restrictions in the BAPI schemas. For instance, dates have these restrictions:

 

Constraint on Date Format from Generated SchemaConstraint on Date Format from Generated Schema

More restrictions are documented in SAP Adapter Binding Properties and Basic SAP Data Types.

Note: In the current scenario, we assume that the SAP send port binding property EnableSafeTyping is set to false (cf. Basic SAP Data Types). The examples of dates/times validations would not make sense otherwise.

 

Similarly to Debatching SAP BAPI Transaction Requests, a pipeline is called from the orchestration. This time however, a custom pipeline is needed in order to add XML validation to the default XML Receive Pipeline, which does not have XML validation by default (BizTalk Server: Default Pipelines).

 

BAPI Validating PipelineBAPI Validating Pipeline

Before using the pipeline, the following dependencies must be added to the BizTalk project:

  • Microsoft.XLANGs.Pipeline.dll
  • Microsoft.BizTalk.Pipeline.dll

The pipeline must be inside a scope of type Atomic because it is of non-serializable type. As a result, the orchestration has to be of type "Long-Running". Inside the atomic scope, the first expression starts the pipeline execution:

ValidatingPipelineType = System.Type.GetType("SapBAPITxClientDebatching.BAPIValidatingPipeline, SapBAPITxClientDebatching, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c30d143e3d921fe");
PipelineOutputMessageVar = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(ValidatingPipelineType, BAPIRequest);
PipelineOutputMessageVar.MoveNext();

where PipelineOutputMessageVar is a variable of type Microsoft.XLANGs.Pipeline.ReceivePipelineOutputMessages.

 

The CREATEFROMDAT2 output of the pipeline is obtained with the expression:

BAPIRequestValidated = null;
PipelineOutputMessageVar.GetCurrent(BAPIRequestValidated);

 

Discussion: What would happen without validations

 

The alternative to validation at this stage is to let data format errors happen in the SAP adapter and handle them later on, as shown in Handling Errors in SAP BAPI Transactions. If we did not handle them, we would see the following on the first message:

A message sent to adapter "WCF-SAP" on send port "BAPI2032SalesOrdersSP" with URI "sap://CLIENT=800;LANG=EN;@a/..." is suspended.
 Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException:
An error occurred when trying to convert the XML string thisistoolong of RFCTYPE RFCTYPE_CHAR
with length 4 and decimals 0 to a .NET type. Parameter/field name: SALES_ORG  
Error message: The length of the value for the field exceeds the allowed value. Value: 13  Field:
SALES_ORG Allowed value: 4. ---> Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException:
The length of the value for the field exceeds the allowed value. Value: 13 
Field: SALES_ORG Allowed value: 4
   at Microsoft.Adapters.SAP.SapMetadataUtilities.ConvertXmlStringToRfcStringNCo(
String data, RfcTypes type, Int32 singleByteLength, Int32 decimals, String fieldname,
Encoding encoding, Encoding realPartnerEncoding, Boolean padToExactLength, SAPConnection sapconnection)

and subsequent messages would fail due to the WCF channel left in an inconsistent state in the SAP adapter, typically with exceptions in the event log like:

A message sent to adapter "WCF-SAP" on send port "BAPI2032SalesOrdersSP" with URI "sap://CLIENT=800;LANG=EN;@a/..." is suspended.
Error details: System.InvalidOperationException: The Inner Channel to use was not found for the key
{0A73F66F-31FA-4E48-BAC5-14EAED9571D4}_{27D07099-1874-47C3-9E69-2AD1FA42DE8D};URI=sap://CLIENT=800;LANG=EN;@a/....
Specify a valid key.

 

5.3 Caching BAPI Messages

 

CREATEFROMDAT2 messages are saved in a list object to be used outside the pipeline scope:

TempXmlDocument = BAPIRequestValidated;
BAPIOrders.AddFromXMLString(TempXmlDocument);

where TempXmlDocument is a variable of type XmlDocument, and BAPIOrders is of custom type BAPIOrderList added in a helper library:

 

BAPIOrdersList ClassBAPIOrdersList Class

The helper library also contains C# classes corresponding to the BAPI transactions schemas generated by running the Xsd.exe utility on the BAPI schemas generated in Visual Studio.

 

5.4 Validation Examples

 

The following logs were obtained from the various validation layers:

Examples of Validation FailuresExamples of Validation Failures

Note the use of CDATA to prevent parsing of characters that would otherwise invalidate the xml format. 

 

6. Orchestration LOB Send/Receive Stage

 

The subsequent orchestration stage is similar to what has been presented in Handling Errors in SAP BAPI Transactions. Here is a visual overview before getting into the details:

 

LOBSendReceiveScope.png

Note that the connection state is set to REUSE only after a successful send.

 

We look at the messages being constructed and the data being logged. What gets saved:

1. CREATEFROMDAT2Response documents received from SAP; 

2. Errors contained in CREATEFROMDAT2Response documents, formatted as strings;

3. Exception strings.

 

As explained in Using BAPIs in Distributed Systems (ALE), a value of "E" in any of the TYPE fields of BAPIRET2 in a CREATEFROMDAT2Response indicates transaction failure. For example:

<RETURN>
<BAPIRET2 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">
<TYPE>E</TYPE>
<ID>CZ</ID>
<NUMBER>95</NUMBER>
<MESSAGE>Sales organization abcd does not exist</MESSAGE>
...
</BAPIRET2>
<BAPIRET2 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">
<TYPE>E</TYPE>
<ID>V4</ID>
<NUMBER>219</NUMBER>
<MESSAGE>Sales document was not changed</MESSAGE>
...
</BAPIRET2>
</RETURN>

Errors are extracted by the orchestration with the following helper class (complete code in attached archive):

BAPIReturnValues ClassBAPIReturnValues Class

which is used as in the expression:

BAPIResponseRetVal.Set(BAPIResponse);

where BAPIResponse is of type CREATEFROMDAT2Response. 

 

The method BAPIReturnValues.GetErrorString() produces the error string logged to a file by using the RawString class documented in Sending string to file location in BizTalk and included in the BizTalk code attached to this blog post.

DataValueErrorMessage = new Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString(
System.String.Format("Message {0}", BAPIResponseRetVal.GetErrorString()));

 

Handling Failures

 

Given that the data being sent to the server has been "sanitized" in previous stages, failures at this stage are expected to be more general, such as connectivity issues.

 

Connection ErrorConnection Error

Although not done here to keep the design as simple as it can be, it is possible to handle errors by re-enqueueing CREATEFROMDAT2 messages in the BAPIOrders cached list, as was done in Handling Errors in SAP BAPI Transactions and resetting the connection state to "OPEN" so a new WCF channel may be opened to restart a new LUW. This is can be done with minor changes to the existing orchestration.

 

7. Last Message in Batch and Commit Stage

 

The last message in a batch is identified by the BTS.LastInterchangeMessage property, which by default does not exist in other messages. This causes the following decision expression:

OrderReceived(BTS.LastInterchangeMessage) == true

to throw a PropertyNotFound exception. Catching the exception indicates that a message is not the last in the batch. As an alternative, is is possible to add the property to all messages by doing the following in the custom pipeline component:

// BTS.LastInterchangeMessage only exist on the last message. Populate it here for all other message so we don't get the exception in the orch.
bool isLastInterchangeMessage = false;
try
{
isLastInterchangeMessage = (bool)mBaseMessage.Context.Read("LastInterchangeMessage", "http://schemas.microsoft.com/BizTalk/2003/system-properties");
}
catch(Exception)
{
mBaseMessage.Context.Write("LastInterchangeMessage", "http://schemas.microsoft.com/BizTalk/2003/system-properties", isLastInterchangeMessage);
}

 

BAPI transactions are committed once the last message in the batch has been processed, regardless of whether the last transaction was successful, if at least one transaction in the batch was successful. The processing at this stage is shown below.

 

Processing the Last MessageProcessing the Last Message

Close-up of the Commit Scope:

Commit ScopeCommit Scope

 

8. Exiting the orchestration

 

In the general case, the orchestration instance either terminates after the commit has been sent, or gets suspended if something truly unexpected happens, i.e., something that is not handled by the catch blocks in place (we did not implement general exception handlers for this reason). The orchestration flow is such that successful BAPI transactions will be committed even if the last message in the batch is invalid and causes validation error(s). 

 

If the last message fails validation in the receive port, the orchestration instance for the batch will never receive the last message, which is suspended. To address the issue, the receive shape for the next message in a batch is placed in one of the branches of a listen shape, and in the other branch of the same shape, a delay (currently one minute) determines the maximum amount of time to wait until a commit is issued for all transactions received thus far. This is depicted in the figure below, where the CommitScope is identical to the CommitScope in the previous section.

 

Exit or LoopExit or Loop

9. Orchestration Summary

 

The orchestration is depicted below with all stages and connected ports.

Orchestration at a GlanceOrchestration at a Glance

The bindings file for the BizTalk artifacts (below) is provided in the attached archive.

BizTalk ArtifactsBizTalk Artifacts

 

10. Concluding Remarks

 

Here is a non-exhaustive list of "nice to have" features that did not make it to this article:

- Re-enqueueing of BAPI transactions in the orchestration to make it more "RIP" in the stages post validations.

- Instead of logging just one error, concatenate all errors for a given document. This can be done in the custom pipelines with the techniques presented in BizTalk custom XML validation to get error summary

- Instead of using a timer for the last message in a batch to be processed by, re-route messages suspended in the receive port to the orchestration (basically, take advantage of RIP).

- Simplify the design to debatch CREATEFROMDAT2 messages directly. 

 

The underlying motivation for the current design was to investigate how to provide recoverable interchange processing for BAPI in the general BizTalk sense of Automatic recovery from failures of messages within a data interchange . It is a pertinent question given that (1) BAPIs in the same LUW are essentially an interchange, and (2) BAPIs can be applied to situations where best-effort is acceptable and some transactions should not block the processing of other messages. As an example of latter, BAPIs are used for high-performance mass data transfer by maximizing the number of requests before commits. A "RecoverableInterchangeProcessing"-like property on the SAP send port configuration would be a very nice feature to have, especially given the complexity of what was presented here.

 

References

 

Related blog articles

SAP BAPI Transactions Walkthrough

Debatching SAP BAPI Transactions

Scatter-Gather Pattern with SAP BAPI Transactions

Handling Errors in SAP BAPI Transactions

 

BAPI in BizTalk

Registry setting to enable BAPI transactions

Operations on BAPIs in SAP

Run BAPI Transactions in SAP using BizTalk Server

SAP Connector for Microsoft .NET

SAP Adapter Binding Properties

Get Metadata for SAP Operations in Visual Studio

Browse, search, and retrieve metadata from SAP for BAPI operations

Message Schemas for BAPI Operations

Basic SAP Data Types

 

Orchestrations

Calling a pipeline inside an orchestration

Ordered Delivery of Messages

Sequential Convoy & Singleton Orchestration

Using Correlations in Orchestrations

Working with Convoy Scenarios

Walkthrough: Correlations in BizTalk Orchestration

 

Pipelines

Recoverable Interchange Processing

Mapping Phase (Recoverable Interchange Processing)

Deploying Custom Pipeline Components

BizTalk Server: Default Pipelines

 

SAP

BAPI Transaction Model documented by SAP

Using BAPIs in Distributed Systems (ALE)

 

Other

WCF LOB Adapter SDK

Automatic recovery from failures of messages within a data interchange

BizTalk custom XML validation to get error summary

Xsd.exe utility

Sending string to file location in BizTalk

%3CLINGO-SUB%20id%3D%22lingo-sub-2016190%22%20slang%3D%22en-US%22%3ERecovering%20SAP%20BAPI%20Transactions%20with%20Custom%20Pipelines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2016190%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3EIntroduction%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20ways%20that%20BizTalk%20can%20access%20SAP%20servers%20is%20by%20using%20Business%20Application%20Programming%20Interfaces%20(BAPIs)%2C%20as%20documented%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Foperations-on-bapis-in-sap%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOperations%20on%20BAPIs%20in%20SAP%3C%2FA%3E.%20SAP%20introduced%20BAPIs%20as%20an%20object-oriented%20way%20to%20structure%20business%20data%20and%20processes.%26nbsp%3B%20It%20is%20assumed%20that%20the%20reader%20has%20some%20familiarity%20with%20how%20to%20use%20this%20functionality%20in%20BizTalk.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20article%2C%20we%20conclude%20our%20series%20on%20BAPI%20transactions%20by%20presenting%2C%20step-by-step%2C%20another%20implementation%20of%20the%20sales%20orders%20received%20in%20batches%20and%20created%20in%20SAP%20by%20using%20BAPI%20transactions.%20Reading%20the%20past%20articles%20is%20not%20required%20(but%20encouraged)%20as%20there%20is%20some%20background%20covered%20here.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20following%20was%20covered%20in%20past%20articles%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EIn%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fsap-bapi-transactions-walkthrough%2Fba-p%2F1772148%22%20target%3D%22_blank%22%3ESAP%20BAPI%20Transactions%20Walkthrough%3C%2FA%3E%2C%20BAPI%20transactions%20are%20received%20separately%20but%20as%20part%20of%20the%20same%20%3CEM%3ELogical%20Unit%20of%20Work%3C%2FEM%3E%20(LUW)%20on%20the%20SAP%20server.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EIn%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fdebatching-sap-bapi-transaction-requests%2Fba-p%2F1786613%22%20target%3D%22_blank%22%3EDebatching%20SAP%20BAPI%20Transactions%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fscatter-gather-pattern-with-sap-bapi-transactions%2Fba-p%2F1810936%22%20target%3D%22_blank%22%3EScatter-Gather%20Pattern%20with%20SAP%20BAPI%20Transactions%3C%2FA%3E%2C%20BAPI%20transactions%20are%20received%20in%20batches%20which%20are%20then%20disassembled%20by%20the%20default%20XML%20receive%20pipeline%20called%20from%20the%20orchestration.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E%26nbsp%3Badds%20error-handling%26nbsp%3B%20to%20filter%20data%20containing%20fields%20that%20are%20not%20of%20the%20right%20formats%2C%20or%20that%20do%20not%20have%20expected%20values.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20design%20here%20is%20a%20combination%20of%20the%20previous%20concepts%20into%20a%20solution%20that%20integrates%20the%20powerful%20BizTalk%20pipeline%20features%20such%20as%20batch%20processing%2C%20XML%20disassembly%2C%20XML%20validation%2C%20and%20Recoverable%20Interchange%20Processing%20(RIP).%20It%20is%20also%20the%20opportunity%20to%20provide%20more%20details%20on%20topics%20that%20were%20briefly%20touched%20upon%2C%20in%20the%20same%20step%20by%20step%20style%20-%20the%20intent%20being%20to%20serve%20as%20the%20%22missing%20documentation%22%20for%20SAP%20BAPI%20transactions%20in%20BizTalk.%20W%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3Ee%20present%20how%20to%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3ELeverage%20XML%20disassembler%20and%20XML%20validator%20%3CEM%3Ein%20the%20receive%20location%3C%2FEM%3E%20in%20order%20to%20%22front-load%22%20the%20verifications%20previously%20done%20in%20the%20orchestration%20presented%20in%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EWrite%20a%20custom%20pipeline%20component%20to%20promote%20properties%20(such%20as%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E)%20needed%20for%20the%20same%20orchestration%20instance%20to%20process%20all%20messages%20in%20a%20batch%20as%20a%20single%20SAP%20Logical%20Unit%20of%20Work%20(LUW).%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EImplement%20layered%20verifications%20to%20improve%20the%20granularity%20of%20error%20handling%20presented%20in%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E%20and%20find%20errors%20before%20they%20get%20to%20the%20send%20adapter.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EAll%20code%20is%20provided%20in%20the%20archive%20attached%20to%20this%20blog%20post.%3C%2FP%3E%0A%3CTABLE%20class%3D%22%20lia-align-left%22%20style%3D%22border-style%3A%20solid%3B%20background-color%3A%20whitesmoke%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3ENOTE%3C%2FSTRONG%3E%3A%20Starting%20with%20BizTalk%20Server%202016%20CU6%20and%20BizTalk%20Server%202020%20CU1%2C%20BAPI%20transactions%20need%20to%20be%20enabled%20explicitly%2C%20by%20creating%20the%20registry%20value%26nbsp%3B%3CSTRONG%3EHKLM%5CSOFTWARE%5CMicrosoft%5CBizTalk%20Server%5C3.0%5CConfiguration%5CEnableBizTalkSapSessionProvider%3C%2FSTRONG%3E%26nbsp%3Bof%20type%20DWORD%20and%20setting%20it%20to%26nbsp%3B'1'%2C%20as%20documented%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F4491648%2Ffix-bapi-transactions-are-not-committed-when-you-use-wcf-sap-nco-conne%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Efix%20page%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1942301879%22%20id%3D%22toc-hId-1941527590%22%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%3CFONT%20size%3D%224%22%3E1.%20BAPI%20Operations%20and%20Schemas%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20demo%20scenario%2C%20sales%20orders%20are%20received%20u%3CFONT%20size%3D%223%22%3Ender%20the%20form%20of%20XML%20documents%20and%20transformed%20to%20BAPI%20Sales%20Order%20(%3CEM%3EBUS2032%3C%2FEM%3E).%20The%20first%20pre-requisite%20is%20to%20download%20schemas%20and%20metadata%20for%20BAPI%20transactions%20by%20using%20the%20%22Consume%20Adapter%20Service%22%20in%20Visual%20Studio%2C%20as%20explained%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fbrowse-search-and-get-metadata-for-bapi-operations-in-sap%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20section%20of%20the%20SAP%20Adapter%20documentation%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20figure%20below%20depicts%20the%20generated%20schemas%20for%20the%20BAPI%20methods%20BUS2032.CREATEFROMDAT2%20(shortened%20to%20CREATEFROMDAT2%20in%20the%20rest%20of%20this%20article)%20and%20BAPI_TRANSACTION_COMMIT.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Article1ConsumeAdapterServiceRedux.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242900iCCE31818251E142A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Article1ConsumeAdapterServiceRedux.png%22%20alt%3D%22BAPI%20Schema%20Generation%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBAPI%20Schema%20Generation%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EOn%20the%20receiving%20side%20of%20BizTalk%2C%20we%20consider%20the%20general%20case%20where%20sales%20orders%20follow%20a%20simplified%20schema%20(%3CEM%3EOrder%3C%2FEM%3E)%20that%20may%20not%20necessarily%20correspond%20to%20the%20BAPI%20schema.%20A%20single%20XML%20document%20contains%20multiple%20orders%2C%20which%20are%20debatched%20in%20the%20receive%20location.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OrderShema.PNG%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242898i7CA8EA3219ECED47%2Fimage-size%2Fsmall%3Fv%3Dv2%26amp%3Bpx%3D200%22%20role%3D%22button%22%20title%3D%22OrderShema.PNG%22%20alt%3D%22Order%20Schema%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOrder%20Schema%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThe%20first%20step%20for%20using%20a%20debatching%20pipeline%20is%20to%20define%20an%20envelope%20schema%20to%20represent%20multiple%20orders.%20This%20is%20done%20according%20to%20the%20following%20process%2C%20initially%20documented%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F31367.biztalk-de-batching-options.aspx%23Calling_a_pipeline_inside_an_orchestration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECalling%20a%20pipeline%20inside%20an%20orchestration%3A%3C%2FA%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%20class%3D%22lia-align-left%22%3EAdd%20a%20new%20schema%20file%20to%20the%20project.%3C%2FLI%3E%0A%3CLI%20class%3D%22lia-align-left%22%3EChange%20the%20root%20node%20name%20to%20%22Orders%22.%3C%2FLI%3E%0A%3CLI%20class%3D%22lia-align-left%22%3EIn%20the%20properties%20window%20for%20the%20%3CSCHEMA%3E%20treeview%20node%3A%20(a)%20change%20the%20Envelope%20property%20to%20Yes%2C%20and%20(b)%20import%20the%20Order%20schema.%3C%2FSCHEMA%3E%3C%2FLI%3E%0A%3CLI%20class%3D%22lia-align-left%22%3EIn%20the%20properties%20window%20for%20the%20%22Orders%22%20root%20node%2C%20set%20the%20Body%20XPath%20property%20to%20%2F*%5Blocal-name()%3D'Orders'%20and%20namespace-uri()%3D'%3CNAMESPACE%20of%3D%22%22%20the%3D%22%22%20schema%3D%22%22%20here%3D%22%22%3E%0A%3C%2FNAMESPACE%3E%3C%2FLI%3E%3CLI%20class%3D%22lia-align-left%22%3EInsert%20a%20child%20record%20under%20the%20root%20node.%3C%2FLI%3E%0A%3CLI%20class%3D%22lia-align-left%22%3EIn%20the%20child%20record%20properties%2C%20set%20the%20data%20structure%20type%20field%20to%20Order.%20As%20a%20result%2C%20the%20Order%20definition%20will%20appear%20under%20Orders.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%20background%3A%20white%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CreateEnvelopeSchemaREDUX.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242899iBA88AB5DF61F91AE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CreateEnvelopeSchemaREDUX.png%22%20alt%3D%22Creating%20the%20Orders%20Envelope%20Schema%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECreating%20the%20Orders%20Envelope%20Schema%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20message%20flow%20with%20the%20different%20schemas%20is%20shown%20in%20the%20following%20figure.%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22IntegratedHighLevel.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242901i0F9253A86716C089%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IntegratedHighLevel.png%22%20alt%3D%22Message%20Flow%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EMessage%20Flow%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20The%20send%20port%20is%20actually%20a%20Static%20Solicit-Response%20port.%20Responses%20from%20SAP%20are%20not%20shown%20here.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20assumed%20that%20received%20messages%20follow%20a%20simplified%20client-defined%20schema%20(%3CEM%3EOrders%2FOrder%3C%2FEM%3E)%20rather%20than%20CREATEFROMDAT2%20directly%2C%20in%20order%20to%20make%20the%20demo%20scenario%20more%20general.%20Everything%20presented%20below%20is%20applicable%20with%20minor%20changes%20if%20batches%20of%20CREATEFROMDAT2%20are%20received%20instead.%26nbsp%3BA%20client%20schema%20makes%20sense%20in%20an%20integration%20context%2C%20where%20the%20source%20is%20decoupled%20from%20the%20destination%3B%20for%20instance%2C%20if%20the%20organization%20sending%20sales%20orders%20does%20not%20need%20to%20be%20aware%20that%20these%20sales%20orders%20are%20processed%20in%20BizTalk%20by%20creating%20CREATEFROMDAT2%20BAPI%20transactions.%20Furthermore%2C%20BAPI%20schemas%20depend%20on%20the%20SAP%20system%2C%20and%20they%20can%20contain%20several%20hundreds%20of%20elements%2C%20many%20of%20them%20not%20necessarily%20applicable%20to%20every%20sales%20orders.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2012.0pt%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3E2.%20From%20Interchanges%20to%20LUWs%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2012.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20key%20to%20understanding%20what%20designs%20can%20accommodate%20BAPI%20transactions%20is%20%3CEM%3Einterchanges%3C%2FEM%3E.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20explained%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Frun-bapi-transactions-in-sap-using-biztalk-server%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERun%20BAPI%20Transactions%20in%20SAP%20using%20BizTalk%20Server%3C%2FA%3E%2C%20the%20message%20context%20property%26nbsp%3BMicrosoft.Adapters.SAP.BiztalkPropertySchema.ConnectionState%26nbsp%3Bis%20used%20to%20associate%20a%20BAPI%20transaction%20to%20a%20Logical%20Unit%20of%20Work%20(LUW)%20on%20the%20SAP%20server.%20So%2C%20the%20first%20transaction%20has%20the%20property%20set%20to%20%22OPEN%22%2C%20subsequent%20transactions%20set%20it%20to%20%22REUSE%22%2C%20and%20the%20last%20transactions%20have%20either%20%22CLOSE%22%20or%20%22ABORT%22.%20This%20implies%20that%20messages%20are%20(1)%20grouped%2C%20and%20(2)%20ordered%2C%20to%20the%20extent%20that%20we%20can%20differentiate%20between%20first%20message%2C%20middle%20messages%2C%20and%20last%20message.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20series%20of%20transaction%20messages%20(i.e.%20OPEN-REUSE-REUSE-%E2%80%A6-CLOSE)%20requires%20the%20same%20connection%20for%20outbound%20communication%20with%20the%20SAP%20server%2C%20and%20this%20connection%20is%20mapped%20to%20an%20LUW%20on%20the%20SAP%20server%20side%20%3CEM%3Eby%26nbsp%3Binterchange%20id%20and%20send%20port%20id%3C%2FEM%3E.%20The%20message%20properties%20look%20like%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%20color%3A%20%23333333%3B%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Article1InterchangeId.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242902i720E1A5511BAF0E9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Article1InterchangeId.png%22%20alt%3D%22BAPI%20Messages%20Context%20Properties%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBAPI%20Messages%20Context%20Properties%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ETo%20put%20it%20in%20layman's%20terms%2C%20for%20BAPI%20transactions%20to%20be%20in%20the%20same%20LUW%20from%20OPEN%20to%20CLOSE%2FABORT%2C%20they%20need%20to%20come%20from%20the%20same%20%22place%22%20(the%20interchange%20id)%20and%20to%20be%20sent%20out%26nbsp%3B%20to%20the%20same%20%22destination%22%20(the%20send%20port)%20with%20the%20same%20route%20(the%20%22session%22).%26nbsp%3BThe%20use%20of%26nbsp%3B%7Binterchange%20id%20%2B%20send%20port%20id%7D%26nbsp%3Bis%20compatible%20with%20the%20%22session%22%20paradigm%20provided%20by%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.sap.com%2Fen%2Fproduct%2Fconnectors%2Fmsnet.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESAP%20Connector%20for%20Microsoft%20.NET%3C%2FA%3E%26nbsp%3B(NCo)%20to%20expose%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fhelp.sap.com%2Fsaphelp_46c%2Fhelpdata%2Fen%2Fa5%2F3ec88c4ac011d1894e0000e829fbbd%2Fframeset.htm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EBAPI%20Transaction%20Model%20documented%20by%20SAP%3C%2FA%3E.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECommon%20interchange%20id%20means%20that%20outbound%20messages%20are%20part%20of%20the%20same%20interchanges%2C%20which%20is%20achieved%20in%20the%20following%20setups%3A%3C%2FP%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%20value%3D%221%22%3E%3CEM%3EIf%20messages%20are%20received%20by%20the%20same%20orchestration%20instance.%3C%2FEM%3E%20It%20is%20the%20design%20presented%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fsap-bapi-transactions-walkthrough%2Fba-p%2F1772148%22%20target%3D%22_blank%22%3ESAP%20BAPI%20Transactions%20Walkthrough%3C%2FA%3E%2C%20where%20incoming%20order%20messages%20provide%20a%20promoted%20id%20property%20used%20as%20correlation%20set%20in%20order%20to%20use%20the%20same%20orchestration%20instance%20for%20a%20series%20of%20related%20orders.%3C%2FLI%3E%0A%3CLI%3E%3CEM%3EIf%20messages%20are%20debatched%3C%2FEM%3E%2C%20as%26nbsp%3Bin%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fdebatching-sap-bapi-transaction-requests%2Fba-p%2F1786613%22%20target%3D%22_blank%22%3EDebatching%20SAP%20BAPI%20Transactions%3C%2FA%3E%26nbsp%3Bwhere%20debatching%20was%20done%20by%20an%20in-orchestration%20receive%20pipeline.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20current%20design%20is%20a%20combination%20of%201%20and%202%3A%20Messages%20are%20debatched%20in%20the%20receive%20location%20and%20their%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E%20property%20is%20used%20as%20correlation%20set%20by%20orchestration%20instances.%20Details%20are%20presented%20next.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%20color%3A%20%23333333%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%3CFONT%20size%3D%224%22%3E3.%20Debatching%20Orders%20in%20the%20Receive%20Location%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ELet's%20look%20at%20the%20receive%20location%20settings.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ReceiveLocationSettings.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242903iD39B9B3C40E9C76A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ReceiveLocationSettings.png%22%20alt%3D%22Receive%20Location%20Settings%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EReceive%20Location%20Settings%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EWe%20use%20a%20custom%20pipeline%2C%20shown%20below%2C%20in%20order%20to%20promote%20the%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E%20property%2C%20which%20is%20otherwise%20not%20accessible%20from%20within%20orchestrations.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CustomPipelineComponentDetails.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242904i5566B697D48379F2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CustomPipelineComponentDetails.png%22%20alt%3D%22Custom%20Receive%20Pipeline%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECustom%20Receive%20Pipeline%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20custom%20pipeline%20uses%20the%20default%20XML%20disassembler%20and%20validator%2C%20which%20provides%20access%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Frecoverable-interchange-processing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERecoverable%20Interchange%20Processing%3C%2FA%3E%20(RIP)%2C%20feature%20which%20allows%20processing%20to%20go%20on%20if%20some%20messages%20within%20a%20batch%20are%20invalid.%26nbsp%3B%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3EWith%20standard%20interchange%20processing%2C%20the%20existence%20of%20any%20invalid%20message%20in%20a%20given%20interchange%20causes%20the%20entire%20interchange%20to%20be%20suspended%20even%20if%20it%20contains%20one%20or%20more%20valid%20messages.%20In%20the%20configuration%20of%20XML%20disassembler%20and%20validator%2C%20schemas%20and%20envelope%20schemas%20can%20be%20left%20blank%3B%26nbsp%3B%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3EBizTalk%20automatically%20resolves%20the%20envelope%20and%20inner%20schemas%20from%20the%20messages.%20%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20last%20validation%20stage%20is%20the%20custom%20pipeline%20component%20itself%2C%20which%20is%20based%20on%20a%20reusable%20pattern%20introduced%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D38173%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWCF%20LOB%20Adapter%20SDK.%3C%2FA%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20relevant%20portions%20of%20the%20code%20(which%20may%20be%20found%20in%20the%20attached%20archive)%20are%20shown%20below.%20A%20class%20called%20%3CEM%3ENotifyingStream%3C%2FEM%3E%20designed%20as%20a%20decorator%20of%20the%20%3CEM%3EStream%3C%2FEM%3E%20class%2C%20is%20used%20to%20invoke%20callbacks%20for%20specific%20events%20corresponding%20to%20when%20the%20stream%20is%20read.%20In%20our%20case%2C%20the%20custom%20pipeline%20component%20%3CEM%3EPromoteInterchangeId%3C%2FEM%3E%20receives%20a%20notification%20when%20the%20entire%20stream%20has%20been%20read%2C%20thereby%20guaranteeing%26nbsp%3Bthat%20all%20promoted%20properties%20from%20the%20message%20have%20been%20populated%20to%20the%20message%20context.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Epublic%20IBaseMessage%20Execute(IPipelineContext%20pc%2C%20IBaseMessage%20inmsg)%3C%2FSTRONG%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20%20%20IBaseMessage%20outmsg%20%3D%20inmsg%3B%3CBR%20%2F%3E%20%20%20%20Stream%20notifyingStream%20%3D%20new%20NotifyingStream(inmsg.BodyPart.Data%2C%20null%2C%20null%2C%20new%20NotifyingStream.LastReadOccurred(EndOfStream))%3B%3CBR%20%2F%3E%20%20%20%20outmsg.BodyPart.Data%20%3D%20notifyingStream%3B%3CBR%20%2F%3E%20%20%20%20mBaseMessage%20%3D%20outmsg%3Breturn%20outmsg%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3Einternal%20void%20EndOfStream()%3C%2FSTRONG%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20%20%20string%20interchangeId%20%3D%20(string)mBaseMessage.Context.Read(%22InterchangeID%22%2C%20%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2F2003%2Fsystem-properties%22)%3B%3CBR%20%2F%3E%20%20%20%20mBaseMessage.Context.Promote(%22InterchangeID%22%2C%20%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2F2003%2Fsystem-properties%22%2C%20interchangeId)%3B%3CBR%20%2F%3E%20%20%20%20%3CBR%20%2F%3E%20%20%20%20%2F%2F%20This%20is%20the%20place%20to%20add%20more%20promotions%20as%20needed%2C%20as%20explained%20in%20the%20blog%20post%3CBR%20%2F%3E%7D%3C%2FPRE%3E%0A%3CPRE%3E%3CSTRONG%3Epublic%20class%20NotifyingStream%20%3A%20Stream%3C%2FSTRONG%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20%20%20Stream%20mBaseStream%3B%3CBR%20%2F%3E%20%20%20%20public%20delegate%20void%20LastReadOccurred()%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%20%20%20%20public%20NotifyingStream(Stream%20BaseStream%2C%20...%2C%20LastReadOccurred%20LastReadCallback)%3CBR%20%2F%3E%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20%20%20mBaseStream%20%3D%20BaseStream%3B%3CBR%20%2F%3E%20%20%20%20%20%20%20%20mLastReadCallback%20%3D%20LastReadCallback%3B%3CBR%20%2F%3E%20%20%20%20%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%20%20%20%20%3CSTRONG%3Epublic%20override%20int%20Read(byte%5B%5D%20buffer%2C%20int%20offset%2C%20int%20count)%3C%2FSTRONG%3E%3CBR%20%2F%3E%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20%20%20if%20(mBaseStream.Read(buffer%2C%20offset%2C%20count)%20%3D%3D%200%20%26amp%3B%26amp%3B%20mLastReadCallback%20!%3D%20null%3CSTRONG%3E)%3C%2FSTRONG%3E%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20mLastReadCallback()%3B%3CBR%20%2F%3E%3CSTRONG%3E%20%20%20%20%20%20%20%20%7D%3CBR%20%2F%3E%3C%2FSTRONG%3E%20%20%20%20%7D%3CBR%20%2F%3E%20%20%20%20%2F%2F%20All%20other%20methods%20call%20the%20ones%20from%20Stream%20directly.%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CustomPipelineCode.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242956iD75289BD5F4D1729%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CustomPipelineCode.png%22%20alt%3D%22Sample%20Code%20for%20Custom%20Receive%20Pipeline%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESample%20Code%20for%20Custom%20Receive%20Pipeline%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20addition%20to%20the%20promotion%20of%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E%2C%20the%20custom%20pipeline%20component%20also%20sets%20the%20following%20properties%2C%20added%20for%20illustration%20purposes%20and%20for%20design%20alternatives%20considered%20later%20on%3A%3C%2FP%3E%0A%3CP%3E-%20%3CEM%3EBatchId%3C%2FEM%3E%2C%20which%20can%20be%20used%20as%20an%20alternative%20to%20using%20BTS.InterchangeID%20directly.%3C%2FP%3E%0A%3CP%3E-%20%3CEM%3EBTS.SuspendMessageOnMappingFailure%3C%2FEM%3E%20property%2C%20which%20can%20be%20used%20to%20add%20RIP%20behavior%20at%20the%20mapping%20phase%20in%20a%20receive%20port%2C%20as%20documented%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fmapping-phase-recoverable-interchange-processing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMapping%20Phase%20(Recoverable%20Interchange%20Processing)%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E-%20%3CEM%3EBTS.LastInterchangeMessage%3C%2FEM%3E%2C%20which%20is%20used%20to%20indicate%20the%20last%20message%20in%20a%20batch.%20It%20is%20by%20default%20not%20set%20for%20other%20messages%2C%20thereby%20causing%20an%20exception%20if%20accessed%20from%20an%20expression%20in%20an%20orchestration.%20Adding%20the%20property%20to%20each%20message%20simplifies%20the%20orchestration%20later%20on.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20custom%20component%20was%20installed%20according%20to%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F26404.biztalk-server-deploying-custom-pipeline-components-in-biztalk-server-2006-and-higher.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDeploying%20Custom%20Pipeline%20Components%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1662103943%22%20id%3D%22toc-hId--1662878232%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSTRONG%3E4.%20Orchestration%20Overview%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20long-running%20orchestration%20relies%20on%20(1)%20the%20interchange%20id%20to%20pin%20messages%20within%20a%20batch%20to%20the%20same%20instance%2C%20and%20(2)%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fordered-delivery-of-messages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOrdered%20Delivery%20of%20Messages%3C%2FA%3E%26nbsp%3Bto%20differentiate%20first-middle-last%20messages%20of%20the%20interchange.%26nbsp%3B%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3EProcessing%20can%20be%20decomposed%20into%20four%20stages%2C%20illustrated%20below%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%20value%3D%221%22%3E%3CFONT%20size%3D%223%22%3EValidation%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3ELOB%20send%2Freceive%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EIf%20last%20message%2C%20commit%20and%20exit%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3EOther%20messages%3A%20loop.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OrchestrationSummary.png%22%20style%3D%22width%3A%20732px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242905iCFE9DD6F3DE4F069%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22OrchestrationSummary.png%22%20alt%3D%22Orchestration%20Stages%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOrchestration%20Stages%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EAs%20previously%20mentioned%2C%20a%20single%20orchestration%20instance%20processes%20all%20messages%20in%20a%20batch%2C%20which%20are%20correlated%20based%20on%20their%20interchange%20id.%20More%20info%20regarding%20correlations%20may%20be%20found%20in%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F35522.biztalk-demo-sequential-convoys-singleton-orchestration.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESequential%20Convoy%20%26amp%3B%20Singleton%20Orchestration%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E.%20This%20is%20illustrated%20in%20the%20following%20figure%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CorrelationSet.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242906i16C42E8FE486C425%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CorrelationSet.png%22%20alt%3D%22BTS.InterchangeID%20as%20Orchestration%20Correlation%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBTS.InterchangeID%20as%20Orchestration%20Correlation%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EAn%20alternative%20to%20promoting%20and%20using%20the%20system%20property%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E%20directly%20(for%20instance%20because%20we%20don't%20want%20to%20change%20it%20by%20mistake)%20is%20to%20use%20a%20custom%20context%20property%20(%3CEM%3EBatchId%3C%2FEM%3E)%20as%20depicted%20below.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BatchIdProperty.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242908i7FEAA9769BCDCEC0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22BatchIdProperty.png%22%20alt%3D%22BatchId%20User-Created%20Context%20Property%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBatchId%20User-Created%20Context%20Property%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CEM%3EBatchId%3C%2FEM%3E%20can%20be%20set%20to%20the%20%3CEM%3EBTS.InterchangeID%3C%2FEM%3E%20value%20inside%20the%20custom%20pipeline%20component%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3EmBaseMessage.Context.Write(%22BatchId%22%2C%20%22https%3A%2F%2FSapBAPITxClientDebatching.PropertySchema1%22%2C%20interchangeId)%3B%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EDiscussion%3A%20Logging%20and%20Error%20Handling%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20presenting%20each%20orchestration%20stage%20in%20detail%2C%20it%20is%20worth%20mentioning%20that%20logging%20is%20for%20demo%20purposes%2C%20to%20show%26nbsp%3B%3CSPAN%3Ethe%20different%20places%20of%20interest%20that%20could%20be%20adapted%20to%20%22real-world%22%20applications%2C%20where%20further%20processing%20could%20be%20hooked%20up.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAt%20each%20stage%2C%20whether%20it%20is%20in%20the%20regular%20flow%20or%20in%20exception%20handling%2C%20we%20keep%20track%20of%20the%20order%20status%20with%20the%20following%20schema%20and%20expression%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22StatusLogging.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242957i402214D9E19237AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22StatusLogging.png%22%20alt%3D%22Expression%20Shape%20for%20Logging%20Exceptions%20and%20Messages%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExpression%20Shape%20for%20Logging%20Exceptions%20and%20Messages%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EA%20sequence%20of%20successful%20order%20creations%20looks%20like%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SuccessfulStatus.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242972i33CE2F8EC3007425%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22SuccessfulStatus.png%22%20alt%3D%22Status%20for%20Successful%20Transaction%20Sequences%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EStatus%20for%20Successful%20Transaction%20Sequences%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%20color%3A%20%230070c0%3B%22%20id%3D%22toc-hId-825408890%22%20id%3D%22toc-hId-824634601%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3E5.%20Orchestration%20Validation%20Stage%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20receive%20port%20takes%20care%20of%20validating%20Order%20messages.%20The%20goal%20of%20the%20validation%20stage%20in%20the%20orchestration%20is%20to%20%3CEM%3Efurther%20validate%3C%2FEM%3E%26nbsp%3Bdata%20during%20and%20after%20transformation%20of%20%3CEM%3EOrder%3C%2FEM%3E%20to%20CREATEFROMDAT2%2C%20rather%20than%20letting%20the%20SAP%20adapter%20take%20care%20of%20it%2C%20as%20we%20saw%20in%26nbsp%3B%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E.%20This%20is%20not%20to%20say%20that%20one%20way%20is%20better%20than%20another%2C%20just%20that%20processing%20is%20distributed%20differently.%20For%20instance%20in%20the%20current%20design%2C%20errors%20caused%20by%20invalid%20data%20are%20caught%20before%20the%20data%20is%20handled%20in%20the%20adapter%2C%20which%20results%20in%20a%20simpler%20design%20later%20on%2C%20while%20limiting%20exception%20processing%20at%20the%20LOB%20stage%20to%20more%20systemic%20errors%20like%20connectivity.%20As%20illustrated%20in%20the%20figure%20below%2C%20in%20the%20current%20design%2C%20validation%20is%20%3CEM%3Elayered%3C%2FEM%3E.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ValidationScope.png%22%20style%3D%22width%3A%20841px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243282i147DAF7CEB90DFAE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ValidationScope.png%22%20alt%3D%22Validation%20Phases%20in%20Orchestration%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EValidation%20Phases%20in%20Orchestration%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EEach%20validation%20phase%20is%20explained%20in%20detail%20next.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3E5.1%20Mapping%20Phase%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20the%20mapping%20of%20%3CEM%3EOrder%3C%2FEM%3E%20to%20CREATEFROMDAT2%20is%20also%20a%20place%20where%20value%20verification%20can%20happen%2C%20for%20instance%20with%20%3CEM%3Escript%20functoids%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ValidationsInTransform.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242974i856C7D72DC1BB791%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ValidationsInTransform.png%22%20alt%3D%22Using%20Script%20Functoids%20for%20Validations%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EUsing%20Script%20Functoids%20for%20Validations%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAs%20an%20example%2C%20purchase%20and%20requisition%20dates%20can%20be%20enforced%20to%20be%20in%20the%20past.%20The%20script%20functoid%20in%20the%20provided%20code%20looks%20like%3A%3C%2FP%3E%0A%3CPRE%3E%3CSTRONG%3Epublic%20static%20string%20CheckDateIsValid1(string%20param1)%3C%2FSTRONG%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20if%20(string.IsNullOrWhiteSpace(param1))%3CBR%20%2F%3E%20%20%7B%3CBR%20%2F%3E%20%20%20%20return%20DateTime.Now.ToString(%22o%22)%3B%3CBR%20%2F%3E%20%20%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%20%20DateTime%20outValue%3B%3CBR%20%2F%3E%20%20bool%20isValid%20%3D%20DateTime.TryParse(param1%2C%20out%20outValue)%3B%3CBR%20%2F%3E%20%20if%20(!isValid%20%7C%7C%20outValue%20%26gt%3B%20DateTime.Now)%3CBR%20%2F%3E%20%20%7B%3CBR%20%2F%3E%20%20%20%20%2F%2F%20For%20demo%20purposes%3A%20throw%20an%20exception%20explicitly.%3CBR%20%2F%3E%20%20%20%20throw%20new%20Exception(%22Invalid%20PURCH_DATE.%22)%3B%3CBR%20%2F%3E%20%20%7D%3CBR%20%2F%3E%20%20%2F%2F%20Make%20sure%20the%20datetime%20follows%20the%20xsd%20datatype%3CBR%20%2F%3E%20%20return%20outValue.ToString(%22o%22)%3B%3CBR%20%2F%3E%7D%3C%2FPRE%3E%0A%3CP%3EThere%20is%20a%20similar%20functoid%20for%20other%20data%20fields.%3C%2FP%3E%0A%3CTABLE%20style%3D%22background-color%3A%20whitesmoke%3B%20width%3A%20100%25%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3CSPAN%3E%3A%20Even%20if%20script%20functoids%20are%20identical%20for%20different%20fields%2C%20the%20method%20names%20need%20to%20be%20different%20for%20each%20pair%20of%20fields%20linked%20by%20a%20functoid.%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3EDiscussion%3A%20Transform%20at%20port%20level%3F%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20receive%20port%20can%20be%20configured%20to%20do%20the%20mapping%20instead%20of%20letting%20it%20done%20in%20the%20orchestration.%20The%20setting%20is%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TransformAtPortLevel.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242914iB10705976100A154%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22TransformAtPortLevel.PNG%22%20alt%3D%22Transform%20in%20Receive%20Port%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ETransform%20in%20Receive%20Port%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EIn%20this%20case%2C%20the%20custom%20pipeline%20component%20also%20needs%20to%20set%20the%20%3CEM%3EBTS.SuspendMessageOnMappingFailure%3C%2FEM%3E%20to%20make%20sure%20that%20processing%20goes%20on%20if%20a%20failure%20happens%20on%20a%20single%20Order%2C%20as%20documented%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fmapping-phase-recoverable-interchange-processing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMapping%20Phase%20(Recoverable%20Interchange%20Processing)%3C%2FA%3E%26nbsp%3BIt%20would%20be%20done%20as%20follows%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3E%2F%2F%20Set%20recoverability%20to%20true%20for%20the%20mapping%20phase%20in%20case%20the%20receiver%20wants%20to%20transform%20from%20client%20to%20BAPI%20in%20the%20RL.%3CBR%20%2F%3EmBaseMessage.Context.Write(%22SuspendMessageOnMappingFailure%22%2C%20%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2F2003%2Fsystem-properties%22%2C%20true)%3B%3C%2FPRE%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20reason%20for%20doing%20the%20mapping%20in%20the%20orchestration%20in%20our%20demo%20scenario%26nbsp%3Bis%20that%20it%20allows%20all%20BAPI%20validations%20to%20happen%20in%20a%20single%20orchestration%20stage.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3E5.2%20BAPI%20Validating%20Pipeline%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20need%20the%20XML%20validator%20in%20order%20to%20catch%20additional%20restrictions%20in%20the%20BAPI%20schemas.%20For%20instance%2C%20dates%20have%20these%20restrictions%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ValidDate.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242913iB300C9A80DE7EF9F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ValidDate.png%22%20alt%3D%22Constraint%20on%20Date%20Format%20from%20Generated%20Schema%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EConstraint%20on%20Date%20Format%20from%20Generated%20Schema%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EMore%20restrictions%20are%20documented%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fread-about-biztalk-adapter-for-mysap-business-suite-binding-properties%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESAP%20Adapter%20Binding%20Properties%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fbasic-sap-data-types%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBasic%20SAP%20Data%20Types%3C%2FA%3E.%3C%2FP%3E%0A%3CTABLE%20style%3D%22background-color%3A%20whitesmoke%3B%20width%3A%20100%25%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%3E%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20In%20the%20current%20scenario%2C%20we%20assume%20that%20the%20SAP%20send%20port%20binding%20property%20%3CEM%3EEnableSafeTyping%3C%2FEM%3E%20is%20set%20to%20false%20(cf.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fbasic-sap-data-types%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBasic%20SAP%20Data%20Types%3C%2FA%3E).%20The%20examples%20of%20dates%2Ftimes%20validations%20would%20not%20make%20sense%20otherwise.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESimilarly%20to%26nbsp%3B%3CA%20id%3D%22link_6%22%20class%3D%22page-link%20lia-link-navigation%20lia-custom-event%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fdebatching-sap-bapi-transaction-requests%2Fba-p%2F1786613%22%20target%3D%22_blank%22%3EDebatching%20SAP%20BAPI%20Transaction%20Requests%2C%3C%2FA%3E%26nbsp%3Ba%20pipeline%20is%20called%20from%20the%20orchestration.%20This%20time%20however%2C%20a%20custom%20pipeline%20is%20needed%20in%20order%20to%20add%20XML%20validation%20to%20the%20default%20XML%20Receive%20Pipeline%2C%20which%20does%20not%20have%20XML%20validation%20by%20default%20(%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F26634.biztalk-server-default-pipelines.aspx%23C_EnvelopeSpecNames%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBizTalk%20Server%3A%20Default%20Pipelines)%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BAPIValidatingPipeline.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242911iD62996446DC6ED7D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22BAPIValidatingPipeline.png%22%20alt%3D%22BAPI%20Validating%20Pipeline%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBAPI%20Validating%20Pipeline%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EB%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3Eefore%20using%20the%20pipeline%2C%20the%20following%20dependencies%20must%20be%20added%20to%20the%20BizTalk%20project%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%20type%3D%22disc%22%3E%0A%3CLI%3E%3CEM%3E%3CFONT%20size%3D%223%22%3EMicrosoft.XLANGs.Pipeline.dll%3C%2FFONT%3E%3C%2FEM%3E%3C%2FLI%3E%0A%3CLI%3E%3CEM%3E%3CFONT%20size%3D%223%22%3EMicrosoft.BizTalk.Pipeline.dll%3C%2FFONT%3E%3C%2FEM%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20pipeline%20must%20be%20inside%20a%20scope%20of%20type%20Atomic%20because%20it%20is%20of%20non-serializable%20type.%20As%20a%20result%2C%20the%20orchestration%20has%20to%20be%20of%20type%20%22Long-Running%22.%20Inside%20the%20atomic%20scope%2C%20the%20first%20expression%20starts%20the%20pipeline%20execution%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3EValidatingPipelineType%20%3D%20System.Type.GetType(%22SapBAPITxClientDebatching.BAPIValidatingPipeline%2C%20SapBAPITxClientDebatching%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D9c30d143e3d921fe%22)%3B%3CBR%20%2F%3EPipelineOutputMessageVar%20%3D%20Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(ValidatingPipelineType%2C%20BAPIRequest)%3B%3CBR%20%2F%3EPipelineOutputMessageVar.MoveNext()%3B%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3Ewhere%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EPipelineOutputMessageVar%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FEM%3E%3CSPAN%3Eis%20a%20variable%20of%20type%20%3CEM%3EMicrosoft.XLANGs.Pipeline.ReceivePipelineOutputMessages%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20CREATEFROMDAT2%20output%20of%20the%20pipeline%20is%20obtained%20with%20the%20expression%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3EBAPIRequestValidated%20%3D%20null%3B%3CBR%20%2F%3EPipelineOutputMessageVar.GetCurrent(BAPIRequestValidated)%3B%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EDiscussion%3A%20What%20would%20happen%20without%20validations%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20alternative%20to%20validation%20at%20this%20stage%20is%20to%20let%20data%20format%20errors%20happen%20in%20the%20SAP%20adapter%20and%20handle%20them%20later%20on%2C%20as%20shown%20in%20%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E%3C%2FFONT%3E.%20If%20we%20did%20not%20handle%20them%2C%20we%20would%20see%20the%20following%20on%20the%20first%20message%3A%3C%2FP%3E%0A%3CPRE%3EA%20message%20sent%20to%20adapter%20%22WCF-SAP%22%20on%20send%20port%20%22BAPI2032SalesOrdersSP%22%20with%20URI%20%22sap%3A%2F%2FCLIENT%3D800%3BLANG%3DEN%3B%40a%2F...%22%20is%20suspended.%3CBR%20%2F%3E%26nbsp%3BError%20details%3A%20Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException%3A%20%3CBR%20%2F%3EAn%20error%20occurred%20when%20trying%20to%20convert%20the%20XML%20string%20thisistoolong%20of%20RFCTYPE%20RFCTYPE_CHAR%20%3CBR%20%2F%3Ewith%20length%204%20and%20decimals%200%20to%20a%20.NET%20type.%20Parameter%2Ffield%20name%3A%20SALES_ORG%26nbsp%3B%26nbsp%3B%20%3CBR%20%2F%3EError%20message%3A%20The%20length%20of%20the%20value%20for%20the%20field%20exceeds%20the%20allowed%20value.%20Value%3A%2013%26nbsp%3B%20Field%3A%20%3CBR%20%2F%3ESALES_ORG%20Allowed%20value%3A%204.%20---%26gt%3B%20Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException%3A%20%3CBR%20%2F%3EThe%20length%20of%20the%20value%20for%20the%20field%20exceeds%20the%20allowed%20value.%20Value%3A%2013%26nbsp%3B%20%3CBR%20%2F%3EField%3A%20SALES_ORG%20Allowed%20value%3A%204%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20Microsoft.Adapters.SAP.SapMetadataUtilities.ConvertXmlStringToRfcStringNCo(%3CBR%20%2F%3EString%20data%2C%20RfcTypes%20type%2C%20Int32%20singleByteLength%2C%20Int32%20decimals%2C%20String%20fieldname%2C%20%3CBR%20%2F%3EEncoding%20encoding%2C%20Encoding%20realPartnerEncoding%2C%20Boolean%20padToExactLength%2C%20SAPConnection%20sapconnection)%3C%2FPRE%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3Eand%20subsequent%20messages%20would%20fail%20due%20to%20the%20WCF%20channel%20left%20in%20an%20inconsistent%20state%20in%20the%20SAP%20adapter%2C%26nbsp%3B%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3Etypically%20with%20exceptions%20in%20the%20event%20log%20like%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3E%3CFONT%20size%3D%222%22%3EA%20message%20sent%20to%20adapter%20%22WCF-SAP%22%20on%20send%20port%20%22BAPI2032SalesOrdersSP%22%20with%20URI%20%22sap%3A%2F%2FCLIENT%3D800%3BLANG%3DEN%3B%40a%2F...%22%20is%20suspended.%3CBR%20%2F%3EError%20details%3A%20System.InvalidOperationException%3A%20The%20Inner%20Channel%20to%20use%20was%20not%20found%20for%20the%20key%20%3CBR%20%2F%3E%7B0A73F66F-31FA-4E48-BAC5-14EAED9571D4%7D_%7B27D07099-1874-47C3-9E69-2AD1FA42DE8D%7D%3BURI%3Dsap%3A%2F%2FCLIENT%3D800%3BLANG%3DEN%3B%40a%2F....%20%3CBR%20%2F%3ESpecify%20a%20valid%20key.%3CEM%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FFONT%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3E5.3%20Caching%20BAPI%20Messages%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECREATEFROMDAT2%20messages%26nbsp%3B%3CSPAN%3Eare%20saved%20in%20a%20list%20object%20to%20be%20used%20outside%20the%20pipeline%20scope%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3ETempXmlDocument%20%3D%20BAPIRequestValidated%3B%3CBR%20%2F%3EBAPIOrders.AddFromXMLString(TempXmlDocument)%3B%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3Ewhere%26nbsp%3B%3C%2FSPAN%3E%3CEM%3ETempXmlDocument%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FEM%3E%3CSPAN%3Eis%20a%20variable%20of%20type%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EXmlDocument%3C%2FEM%3E%3CSPAN%3E%2C%20and%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EBAPIOrders%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FEM%3E%3CSPAN%3Eis%20of%20custom%20type%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EBAPIOrderList%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FEM%3E%3CSPAN%3Eadded%20in%20a%20helper%20library%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BAPIOrderListCode.png%22%20style%3D%22width%3A%20885px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242976i2183300F56A8C8C9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22BAPIOrderListCode.png%22%20alt%3D%22BAPIOrdersList%20Class%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBAPIOrdersList%20Class%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%3EThe%20helper%20library%20also%20contains%20C%23%20classes%20corresponding%20to%20the%20BAPI%20transactions%20schemas%20generated%20by%20running%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fstandard%2Fserialization%2Fxml-schema-definition-tool-xsd-exe%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EXsd.exe%20utility%3C%2FA%3E%20on%20the%20BAPI%20schemas%20generated%20in%20Visual%20Studio.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3E5.4%20Validation%20Examples%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20logs%20were%20obtained%20from%20the%20various%20validation%20layers%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ExceptionStatus.png%22%20style%3D%22width%3A%20840px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243023i0D021286C5517A4E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ExceptionStatus.png%22%20alt%3D%22Examples%20of%20Validation%20Failures%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExamples%20of%20Validation%20Failures%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENote%20the%20use%20of%20%3CEM%3ECDATA%3C%2FEM%3E%20to%20prevent%20parsing%20of%20characters%20that%20would%20otherwise%20invalidate%20the%20xml%20format.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%20color%3A%20%230070c0%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3E6.%20Orchestration%20LOB%20Send%2FReceive%20Stage%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20subsequent%20orchestration%20stage%20is%20similar%20to%20what%20has%20been%20presented%20in%26nbsp%3B%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E.%20Here%20is%20a%20visual%20overview%20before%20getting%20into%20the%20details%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LOBSendReceiveScope.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242915i14BA96285AEA3486%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22LOBSendReceiveScope.png%22%20alt%3D%22LOBSendReceiveScope.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ENote%20that%20the%20connection%20state%20is%20set%20to%20REUSE%20%3CEM%3Eonly%20after%20a%20successful%20send%3C%2FEM%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3EWe%20look%20at%20the%20messages%20being%20constructed%20and%20the%20data%20being%20logged.%20What%20gets%20saved%3A%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3E1.%20%3C%2FSPAN%3E%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3ECREATEFROMDAT2Response%20documents%20received%20from%20SAP%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3E2.%20Errors%20contained%20in%26nbsp%3BCREATEFROMDAT2Response%20documents%2C%20formatted%20as%20strings%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3E3.%20Exception%20strings.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAs%20explained%20in%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fremote-database.com%2F00000217%2Fa53eca474ac011d1894e0000e829fbbd.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EUsing%20BAPIs%20in%20Distributed%20Systems%20(ALE)%3C%2FA%3E%3CSPAN%3E%2C%20a%20value%20of%20%22E%22%20in%20any%20of%20the%20TYPE%20fields%20of%20BAPIRET2%20in%20a%20%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22background%3A%20white%3B%22%3ECREATEFROMDAT2Response%20%3C%2FSPAN%3E%3C%2FFONT%3Eindicates%20transaction%20failure.%20For%20example%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CRETURN%3E%3CBR%20%2F%3E%3CBAPIRET2%20xmlns%3D%22http%3A%2F%2FMicrosoft.LobServices.Sap%2F2007%2F03%2FTypes%2FRfc%2F%22%3E%3CBR%20%2F%3E%3CTYPE%3E%3CSTRONG%3EE%3C%2FSTRONG%3E%3C%2FTYPE%3E%3CBR%20%2F%3E%3CID%3ECZ%3C%2FID%3E%3CBR%20%2F%3E%3CNUMBER%3E95%3C%2FNUMBER%3E%3CBR%20%2F%3E%3CMESSAGE%3ESales%20organization%20abcd%20does%20not%20exist%3C%2FMESSAGE%3E%3CBR%20%2F%3E...%3CBR%20%2F%3E%3C%2FBAPIRET2%3E%3CBR%20%2F%3E%3CBAPIRET2%20xmlns%3D%22http%3A%2F%2FMicrosoft.LobServices.Sap%2F2007%2F03%2FTypes%2FRfc%2F%22%3E%3CBR%20%2F%3E%3CTYPE%3E%3CSTRONG%3EE%3C%2FSTRONG%3E%3C%2FTYPE%3E%3CBR%20%2F%3E%3CID%3EV4%3C%2FID%3E%3CBR%20%2F%3E%3CNUMBER%3E219%3C%2FNUMBER%3E%3CBR%20%2F%3E%3CMESSAGE%3ESales%20document%20was%20not%20changed%3C%2FMESSAGE%3E%3CBR%20%2F%3E...%3CBR%20%2F%3E%3C%2FBAPIRET2%3E%3CBR%20%2F%3E%26lt%3B%2FRETURN%26gt%3B%3C%2FRETURN%3E%3C%2FPRE%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EErrors%20are%20extracted%20by%20the%20orchestration%20with%20the%20following%20helper%20class%20(complete%20code%20in%20attached%20archive)%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BAPIReturnValuesCode.png%22%20style%3D%22width%3A%20870px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242978i3799EF216C96AAF1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22BAPIReturnValuesCode.png%22%20alt%3D%22BAPIReturnValues%20Class%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBAPIReturnValues%20Class%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Ewhich%20is%20used%20as%20in%20the%20expression%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3EBAPIResponseRetVal.Set(BAPIResponse)%3B%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3Ewhere%26nbsp%3B%3CEM%3EBAPIResponse%3C%2FEM%3E%26nbsp%3Bis%20of%20type%20CREATEFROMDAT2Response.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20method%26nbsp%3B%3CEM%3EBAPIReturnValues.GetErrorString()%3C%2FEM%3E%26nbsp%3Bproduces%20the%20error%20string%20logged%20to%20a%20file%20by%20using%20the%26nbsp%3B%3CEM%3ERawString%3C%2FEM%3E%26nbsp%3Bclass%20documented%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2Fa82eab63-db47-4666-a642-b41aa28b923a%2Fsending-string-to-file-location-in-biztalk%3Fforum%3Dbiztalkgeneral%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESending%20string%20to%20file%20location%20in%20BizTalk%3C%2FA%3E%26nbsp%3Band%20included%20in%20the%20BizTalk%20code%20attached%20to%20this%20blog%20post.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3EDataValueErrorMessage%20%3D%20new%20Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString(%3CBR%20%2F%3ESystem.String.Format(%22Message%20%7B0%7D%22%2C%20BAPIResponseRetVal.GetErrorString()))%3B%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3EHandling%20Failures%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGiven%20that%20the%20data%20being%20sent%20to%20the%20server%20has%20been%20%22sanitized%22%20in%20previous%20stages%2C%20failures%20at%20this%20stage%20are%20expected%20to%20be%20more%20general%2C%20such%20as%20connectivity%20issues.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ConnectionException.png%22%20style%3D%22width%3A%20720px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243234iD2B21952728BD255%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ConnectionException.png%22%20alt%3D%22Connection%20Error%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EConnection%20Error%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAlthough%20not%20done%20here%20to%20keep%20the%20design%20as%20simple%20as%20it%20can%20be%2C%20it%20is%20possible%20to%20handle%20errors%20by%20re-enqueueing%20CREATEFROMDAT2%20messages%20in%20the%20%3CEM%3EBAPIOrders%3C%2FEM%3E%20cached%20list%2C%20as%20was%20done%20in%26nbsp%3B%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E%26nbsp%3Band%20resetting%20the%20connection%20state%20to%20%22OPEN%22%20so%20a%20new%20WCF%20channel%20may%20be%20opened%20to%20restart%20a%20new%20LUW.%20This%20is%20can%20be%20done%20with%20minor%20changes%20to%20the%20existing%20orchestration.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3E7.%20Last%20Message%20in%20Batch%20and%20Commit%20Stage%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20last%20message%20in%20a%20batch%20is%20identified%20by%20the%20%3CEM%3EBTS.LastInterchangeMessage%3C%2FEM%3E%20property%2C%20which%20by%20default%20does%20not%20exist%20in%20other%20messages.%20This%20causes%20the%20following%20decision%20expression%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3EOrderReceived(BTS.LastInterchangeMessage)%20%3D%3D%20true%3C%2FPRE%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3Eto%20throw%20a%20%3CEM%3EPropertyNotFound%3C%2FEM%3E%20exception.%20Catching%20the%20exception%20indicates%20that%20a%20message%20is%20not%20the%20last%20in%20the%20batch.%20As%20an%20alternative%2C%20is%20is%20possible%20to%20add%20the%20property%20to%20all%20messages%20by%20doing%20the%20following%20in%20the%20custom%20pipeline%20component%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3E%2F%2F%20BTS.LastInterchangeMessage%20only%20exist%20on%20the%20last%20message.%20Populate%20it%20here%20for%20all%20other%20message%20so%20we%20don't%20get%20the%20exception%20in%20the%20orch.%3CBR%20%2F%3Ebool%20isLastInterchangeMessage%20%3D%20false%3B%3CBR%20%2F%3Etry%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20%20%20isLastInterchangeMessage%20%3D%20(bool)mBaseMessage.Context.Read(%22LastInterchangeMessage%22%2C%20%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2F2003%2Fsystem-properties%22)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3Ecatch(Exception)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20%20%20mBaseMessage.Context.Write(%22LastInterchangeMessage%22%2C%20%22http%3A%2F%2Fschemas.microsoft.com%2FBizTalk%2F2003%2Fsystem-properties%22%2C%20isLastInterchangeMessage)%3B%3CBR%20%2F%3E%7D%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBAPI%20transactions%20are%20committed%20once%20the%20last%20message%20in%20the%20batch%20has%20been%20processed%2C%20regardless%20of%20whether%20the%20last%20transaction%20was%20successful%2C%20if%20at%20least%20one%20transaction%20in%20the%20batch%20was%20successful.%20The%20processing%20at%20this%20stage%20is%20shown%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CommitScope.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242916iBBB21F00DB735AA3%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CommitScope.png%22%20alt%3D%22Processing%20the%20Last%20Message%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EProcessing%20the%20Last%20Message%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EClose-up%20of%20the%20Commit%20Scope%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CommitScopeDetails.png%22%20style%3D%22width%3A%20914px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242917iD47EECE4D620BCD9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CommitScopeDetails.png%22%20alt%3D%22Commit%20Scope%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECommit%20Scope%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--982045573%22%20id%3D%22toc-hId--982819862%22%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E8.%20Exiting%20the%20orchestration%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EIn%20the%20general%20case%2C%20the%20orchestration%20instance%20either%20terminates%20after%20the%20commit%20has%20been%20sent%2C%20or%20gets%20suspended%20if%20something%20truly%20unexpected%20happens%2C%20i.e.%2C%20something%20that%20is%20not%20handled%20by%20the%20catch%20blocks%20in%20place%20(we%20did%20not%20implement%20general%20exception%20handlers%20for%20this%20reason).%20The%20orchestration%20flow%20is%20such%20that%20successful%20BAPI%20transactions%20will%20be%20committed%20even%20if%20the%20last%20message%20in%20the%20batch%20is%20invalid%20and%20causes%20validation%20error(s).%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EIf%20the%20last%20message%20fails%20validation%20in%20the%20receive%20port%2C%20the%20orchestration%20instance%20for%20the%20batch%20will%20never%20receive%20the%20last%20message%2C%20which%20is%20suspended.%20To%20address%20the%20issue%2C%20the%20receive%20shape%20for%20the%20next%20message%20in%20a%20batch%20is%20placed%20in%20one%20of%20the%20branches%20of%20a%20listen%20shape%2C%20and%20in%20the%20other%20branch%20of%20the%20same%20shape%2C%20a%20delay%20(currently%20one%20minute)%20determines%20the%20maximum%20amount%20of%20time%20to%20wait%20until%20a%20commit%20is%20issued%20for%20all%20transactions%20received%20thus%20far.%20This%20is%20depicted%20in%20the%20figure%20below%2C%20where%20the%20CommitScope%20is%20identical%20to%20the%20CommitScope%20in%20the%20previous%20section.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ListenForNextOrder.png%22%20style%3D%22width%3A%20855px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242918i18259998F921F23E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ListenForNextOrder.png%22%20alt%3D%22Exit%20or%20Loop%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExit%20or%20Loop%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%20color%3A%20%230070c0%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3E9.%20Orchestration%20Summary%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20orchestration%20is%20depicted%20below%20with%20all%20stages%20and%20connected%20ports.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OrchestrationOverview.png%22%20style%3D%22width%3A%20784px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242919i40BCC70C9F80FEC2%2Fimage-dimensions%2F784x1164%3Fv%3Dv2%22%20width%3D%22784%22%20height%3D%221164%22%20role%3D%22button%22%20title%3D%22OrchestrationOverview.png%22%20alt%3D%22Orchestration%20at%20a%20Glance%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOrchestration%20at%20a%20Glance%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20bindings%20file%20for%20the%20BizTalk%20artifacts%20(below)%20is%20provided%20in%20the%20attached%20archive.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Artifacts.png%22%20style%3D%22width%3A%20932px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243391i96BA2642781F376C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Artifacts.png%22%20alt%3D%22BizTalk%20Artifacts%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EBizTalk%20Artifacts%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1505467260%22%20id%3D%22toc-hId-1504692971%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3E10.%20Concluding%20Remarks%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20a%20non-exhaustive%20list%20of%20%22nice%20to%20have%22%20features%20that%20did%20not%20make%20it%20to%20this%20article%3A%3C%2FP%3E%0A%3CP%3E-%20Re-enqueueing%20of%20BAPI%20transactions%20in%20the%20orchestration%20to%20make%20it%20more%20%22RIP%22%20in%20the%20stages%20post%20validations.%3C%2FP%3E%0A%3CP%3E-%20Instead%20of%20logging%20just%20one%20error%2C%20concatenate%20all%20errors%20for%20a%20given%20document.%20This%20can%20be%20done%20in%20the%20custom%20pipelines%20with%20the%20techniques%20presented%20in%26nbsp%3B%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F32712.biztalk-custom-xml-validation-to-get-error-summary.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBizTalk%20custom%20XML%20validation%20to%20get%20error%20summary%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E-%20Instead%20of%20using%20a%20timer%20for%20the%20last%20message%20in%20a%20batch%20to%20be%20processed%20by%2C%20re-route%20messages%20suspended%20in%20the%20receive%20port%20to%20the%20orchestration%20(basically%2C%20take%20advantage%20of%20RIP).%3C%2FP%3E%0A%3CP%3E-%20Simplify%20the%20design%20to%20debatch%20CREATEFROMDAT2%20messages%20directly.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20underlying%20motivation%20for%20the%20current%20design%20was%20to%20investigate%20how%20to%20provide%20recoverable%20interchange%20processing%20for%20BAPI%20in%20the%20general%20BizTalk%20sense%20of%26nbsp%3B%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22http%3A%2F%2Fpatft.uspto.gov%2Fnetacgi%2Fnph-Parser%3FSect1%3DPTO1%26amp%3BSect2%3DHITOFF%26amp%3Bd%3DPALL%26amp%3Bp%3D1%26amp%3Bu%3D%252Fnetahtml%252FPTO%252Fsrchnum.htm%26amp%3Br%3D1%26amp%3Bf%3DG%26amp%3Bl%3D50%26amp%3Bs1%3D7%2C954%2C112.PN.%26amp%3BOS%3DPN%2F7%2C954%2C112%26amp%3BRS%3DPN%2F7%2C954%2C112%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAutomatic%20recovery%20from%20failures%20of%20messages%20within%20a%20data%20interchange%20%3C%2FA%3E%3C%2FFONT%3E.%20It%20is%20a%20pertinent%20question%20given%20that%20(1)%20BAPIs%20in%20the%20same%20LUW%20are%20essentially%20an%20interchange%2C%20and%20(2)%20BAPIs%20can%20be%20applied%20to%20situations%20where%20best-effort%20is%20acceptable%20and%20some%20transactions%20should%20not%20block%20the%20processing%20of%20other%20messages.%20As%20an%20example%20of%20latter%2C%20BAPIs%20are%20used%20for%20high-performance%20mass%20data%20transfer%20by%20maximizing%20the%20number%20of%20requests%20before%20commits.%26nbsp%3BA%20%22%3CEM%3ERecoverableInterchangeProcessing%3C%2FEM%3E%22-like%20property%20on%20the%20SAP%20send%20port%20configuration%20would%20be%20a%20very%20nice%20feature%20to%20have%2C%20especially%20given%20the%20complexity%20of%20what%20was%20presented%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2014.0pt%3B%20color%3A%20%230070c0%3B%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EReferences%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3ERelated%20blog%20articles%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fsap-bapi-transactions-walkthrough%2Fba-p%2F1772148%22%20target%3D%22_blank%22%3ESAP%20BAPI%20Transactions%20Walkthrough%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fdebatching-sap-bapi-transaction-requests%2Fba-p%2F1786613%22%20target%3D%22_blank%22%3EDebatching%20SAP%20BAPI%20Transactions%3C%2FA%3E%20%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fscatter-gather-pattern-with-sap-bapi-transactions%2Fba-p%2F1810936%22%20target%3D%22_blank%22%3EScatter-Gather%20Pattern%20with%20SAP%20BAPI%20Transactions%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Fhandling-errors-in-sap-bapi-transactions%2Fba-p%2F1909185%22%20target%3D%22_blank%22%3EHandling%20Errors%20in%20SAP%20BAPI%20Transactions%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EBAPI%20in%20BizTalk%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F4491648%2Ffix-bapi-transactions-are-not-committed-when-you-use-wcf-sap-nco-conne%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERegistry%20setting%20to%20enable%20BAPI%20transactions%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Foperations-on-bapis-in-sap%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOperations%20on%20BAPIs%20in%20SAP%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Frun-bapi-transactions-in-sap-using-biztalk-server%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERun%20BAPI%20Transactions%20in%20SAP%20using%20BizTalk%20Server%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.sap.com%2Fen%2Fproduct%2Fconnectors%2Fmsnet.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESAP%20Connector%20for%20Microsoft%20.NET%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fread-about-biztalk-adapter-for-mysap-business-suite-binding-properties%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESAP%20Adapter%20Binding%20Properties%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fget-metadata-for-sap-operations-in-visual-studio%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGet%20Metadata%20for%20SAP%20Operations%20in%20Visual%20Studio%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fbrowse-search-and-get-metadata-for-bapi-operations-in-sap%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBrowse%2C%20search%2C%20and%20retrieve%20metadata%20from%20SAP%20for%20BAPI%20operations%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fmessage-schemas-for-bapi-operations%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMessage%20Schemas%20for%20BAPI%20Operations%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fadapters-and-accelerators%2Fadapter-sap%2Fbasic-sap-data-types%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBasic%20SAP%20Data%20Types%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EOrchestrations%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F31367.biztalk-de-batching-options.aspx%23Calling_a_pipeline_inside_an_orchestration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECalling%20a%20pipeline%20inside%20an%20orchestration%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fordered-delivery-of-messages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOrdered%20Delivery%20of%20Messages%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F35522.biztalk-demo-sequential-convoys-singleton-orchestration.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESequential%20Convoy%20%26amp%3B%20Singleton%20Orchestration%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fusing-correlations-in-orchestrations%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EUsing%20Correlations%20in%20Orchestrations%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fworking-with-convoy-scenarios%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWorking%20with%20Convoy%20Scenarios%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F13729.walkthrough-correlations-in-biztalk-orchestration.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWalkthrough%3A%20Correlations%20in%20BizTalk%20Orchestration%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EPipelines%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Frecoverable-interchange-processing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERecoverable%20Interchange%20Processing%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fmapping-phase-recoverable-interchange-processing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMapping%20Phase%20(Recoverable%20Interchange%20Processing)%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F26404.biztalk-server-deploying-custom-pipeline-components-in-biztalk-server-2006-and-higher.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDeploying%20Custom%20Pipeline%20Components%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F26634.biztalk-server-default-pipelines.aspx%23C_EnvelopeSpecNames%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBizTalk%20Server%3A%20Default%20Pipelines%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3ESAP%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fhelp.sap.com%2Fsaphelp_46c%2Fhelpdata%2Fen%2Fa5%2F3ec88c4ac011d1894e0000e829fbbd%2Fframeset.htm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EBAPI%20Transaction%20Model%20documented%20by%20SAP%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22http%3A%2F%2Fremote-database.com%2F00000217%2Fa53eca474ac011d1894e0000e829fbbd.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EUsing%20BAPIs%20in%20Distributed%20Systems%20(ALE)%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EOther%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D38173%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWCF%20LOB%20Adapter%20SDK%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22http%3A%2F%2Fpatft.uspto.gov%2Fnetacgi%2Fnph-Parser%3FSect1%3DPTO1%26amp%3BSect2%3DHITOFF%26amp%3Bd%3DPALL%26amp%3Bp%3D1%26amp%3Bu%3D%252Fnetahtml%252FPTO%252Fsrchnum.htm%26amp%3Br%3D1%26amp%3Bf%3DG%26amp%3Bl%3D50%26amp%3Bs1%3D7%2C954%2C112.PN.%26amp%3BOS%3DPN%2F7%2C954%2C112%26amp%3BRS%3DPN%2F7%2C954%2C112%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAutomatic%20recovery%20from%20failures%20of%20messages%20within%20a%20data%20interchange%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F32712.biztalk-custom-xml-validation-to-get-error-summary.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBizTalk%20custom%20XML%20validation%20to%20get%20error%20summary%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fstandard%2Fserialization%2Fxml-schema-definition-tool-xsd-exe%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EXsd.exe%20utility%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2Fa82eab63-db47-4666-a642-b41aa28b923a%2Fsending-string-to-file-location-in-biztalk%3Fforum%3Dbiztalkgeneral%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESending%20string%20to%20file%20location%20in%20BizTalk%3C%2FA%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2016190%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20wrap%20up%20the%20series%20of%20articles%20on%20SAP%20BAPI%20transactions%20by%20presenting%2C%20step%20by%20step%2C%20another%20implementation%20of%20BAPI%20sales%20orders%20received%20in%20batches%20and%20created%20in%20SAP.%26nbsp%3BThe%20design%20is%20a%20combination%20of%20the%20previous%20concepts%20into%20a%20solution%20that%20leverages%20BizTalk%20pipeline%20features%20such%20as%20batch%20processing%2C%20XML%20disassembly%2C%20XML%20validation%2C%20and%20recoverable%20interchange%20processing%20(RIP).%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22IntegratedHighLevel.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F247518i397AEF854F334E2F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IntegratedHighLevel.png%22%20alt%3D%22IntegratedHighLevel.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2016190%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBizTalk%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBizTalk%20Adapters%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EComponents%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntegration%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOrchestrations%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPipelines%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESAP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eschemas%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETransactions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EXSL%20Transform%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jan 19 2021 10:01 AM