BizTalk Oracle Adapter error: The assembly required for type mapping not found.

BizTalk Oracle Adapter error: The assembly required for type mapping not found.

Today while I was developing a new BizTalk Server solution that communicates with the Oracle database, I encountered a familiar issue that I forgot to document in the past:

Microsoft.ServiceModel.Channels.Common.MetadataException: The assembly required for type mapping not found.

That forced me to once again lose time not only to remember but to find how I could solve this.

Cause

This error happens when you try to call an Oracle Procedure, function, or package that contains User-Defined Types or UDTs. The UDTs can be present in the following artifacts:

  • Interface tables and interface views containing UDT columns.
  • Database tables and views containing UDT columns.
  • Packages, stored procedures, and functions containing UDT parameters.

Oracle UDTs help represent complex entities as a “single” object that can be shared among the applications.

BizTalk Server supports Oracle UDTs, but unlike what happens with SQL Server, which natively supports these types, in Oracle, we need to configure some more properties and generate a UDT DLL.

When this error occurs, two things may happen or maybe the reason:

  • You forgot to configure, in the Schema generation, the following properties:
    • GeneratedUserTypesAssemblyFilePath
    • GeneratedUserTypesAssemblyKeyFilePath
  • Or you forgot in runtime (aka receive location or send port) to configure the following property:
    • userAssembliesLoadPath

Solution

To solve this issue, we need to guarantee to perform the following steps:

  • It is necessary to create a signed assembly (DLL) of the User-Defined Types (UDTs) created in Oracle and that correspond to those interpreted by the WCF-Oracle Adapter. To do this, when creating the schemas from the Consume Adapter Service option, these assemblies must be created specifying:
    • On the GeneratedUserTypesAssemblyFilePath property, we need to provide a full path and name of the DLL that the wizard will create for us.
    • And on the GeneratedUserTypesAssemblyKeyFilePath property, the strong name key (.snk) path that the wizard will use to sign the DLL.

Both these properties are present in the UDT .NET Type Generation – Design Time section of the Binding Properties.

Once again, this will create for us a UDT DLL on the path we define and that we need to use in runtime:

Once we deploy our schemas and create the receive location or send port, we then need to make sure that we configure the following property with the path to the UDT DLL:

  • userAssembliesLoadPath 

Notice: even if you deploy the UDT DLL to GAC (what is advisable), you still need to configure the path to the UDT DLL in this property,

After these steps, you can successfully communicate with Oracle using an Oracle Procedure, function, or package that contains User-Defined Types.

Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

BizTalk WCF-SAP Adapter error: Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.

BizTalk WCF-SAP Adapter error: Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.

A client reported to me an error that we were getting in our BizTalk Server production environment this week. We had deployed a new orchestration and a new SAP receive port to handle a new partner, something we had done several times with success, but this time, we were getting the following warning each time we sent a message from SAP to BizTalk Server:

The adapter “WCF-Custom” raised an error message. Details “System.Exception: Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkAsyncResult.End()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance.EndOperation(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance.Microsoft.BizTalk.Adapter.Wcf.Runtime.ITwoWayAsyncVoid.EndTwoWayMethod(IAsyncResult result)
at AsyncInvokeEndEndTwoWayMethod(Object , Object[] , IAsyncResult )
at System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)”.

First, it was strange to be logged as a warning since the BizTalk Server did not receive or process the message.

Also, the message can be misleading because the “error” message says Verify that the schema is deployed properly. These types of errors typically indicate that the schema or specific schema versions are not deployed in the environment, although when that happens, the error message clearly specifies the schema name and version, which is not the case in this error message.

Cause

Official documentation states that the following exception is encountered while receiving an IDOC with the EnableBizTalkCompatibilityMode binding property set to true. And if the binding property EnableBizTalkCompatibilityMode is set to true, you must add the BizTalk property schema DLL for the SAP adapter as a resource in your BizTalk application, that is, the application in which your project is deployed.

However, our receive location didn’t have the EnableBizTalkCompatibilityMode set to true. Instead, it was set to false.

With a lack of better ideas, we decided to try to apply the same solution and add the BizTalk property schema DLL for the SAP adapter as a resource in your BizTalk application, and it solved all of our problems,

Solution

So, to solve this issue, we need to add BizTalk property schema DLL for the SAP adapter called Microsoft.Adapters.SAP.BiztalkPropertySchema.dll as a resource in our BizTalk application. This DLL can be found Microsoft BizTalk Adapter Pack folder that normally is under:

  • : Program FilesMicrosoft BizTalk Adapter Packbin

or in BizTalk Server 2020 under:

  • :Program Files (x86)Microsoft BizTalk Server

You must perform the following tasks to add this assembly as a resource in your BizTalk application:

  • Start the BizTalk Server Administration console.
  • In the console tree, expand BizTalk Group, expand Applications, and then the application to which you want to add a BizTalk assembly.
  • Expand Applications and the application to which you want to add a BizTalk assembly.
  • Right-click Resources, point to Add, and then click BizTalk Assemblies.
  • Click Add, navigate to the folder containing the BizTalk assembly file, select the BizTalk assembly file, and then click Open.
  • In Options, specify the options for installing the BizTalk assembly to the GAC, and then click OK.

Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

BizTalk Server FTP issue: The FTP server did not accept a FTP command for an unexpected reason.

BizTalk Server FTP issue: The FTP server did not accept a FTP command for an unexpected reason.

This is not the first time I have worked with the FTP adapter. Almost all my clients have a File transfer solution, and FTP is used in many of them. But today was probably the first time I had the need to configure an After Put command on the FTP channel. Basically, we need to upload the file as .tmp, and after it is uploaded to the FTP we need to rename it to .xml.

The BizTalk Server FTP adapter contains an After Put property that allows you to specify the FTP commands to run after the file PUT. You can provide a chain of commands by separating each one with a semicolon (;).

So, yes, this is what I want to use. On the first approach, I try to add the following command:

rename orders.20231124115951.054.tmp orders.20231124115951.054.xml

And to my surprise, I got the following error:

The command “rename orders.20231124115951.054.tmp orders.20231124115951.054.xml” failed on the FTP server. Inner Exception details: “The FTP server did not accept a FTP command for an unexpected reason. “.

To troubleshoot the adapter, I defined a log file and tried it again, and I got the following traces:

> CWD /inbox
 PWD
 TYPE I
 PORT 10,0,0,224,228,205
 STOR orders.20231124115951.054.tmp
< 150 Opening BINARY mode data connection for orders.20231124115951.054.tmp
 rename orders.20231124115951.054.tmp orders.20231124115951.054.xml
 QUIT
< 221 Goodbye.

After a quick look at this error, I saw a post saying that mv command instead of the rename:

mv -- -orders.20231124120624.055.tmp orders.20231124120624.055.xml

But I endup receiving the same error:

> PWD
 TYPE I
 PORT 10,0,0,224,229,79
 STOR orders.20231124120624.055.tmp
< 150 Opening BINARY mode data connection for orders.20231124120624.055.tmp
 mv -- -orders.20231124120624.055.tmp orders.20231124120624.055.xml
 QUIT
< 221 Goodbye.

Causes

While using and troubleshooting the FTP adapter, it is always good to set the Log file. This will contain all the instructions made by the adapter. By doing so, I realized that the traditional commands we use, like dir, delete, or rename, are not supported in the FTP adapter.

The logs show that the commands used are CWD and STOR, which are the equivalent of dir and put or PWD to display the current directory.

CWD is the Net::FTP method name; CD is the standard FTP and shell command for changing directories. That means that the BizTalk Server FTP adapter uses Net::FTP commands.

Solutions

The solution is quite simple to accomplish:

  • Replace the rename command with the equivalent in Net::FTP that is:
    • RNFR FTP command: The RNFR command is issued when an FTP client wants to rename a file on the server. The client specifies the name of the file to be renamed along with the command. After issuing an RNFR command, an RNTO command must immediately follow.
    • RNTO FTP command: The RNTO command is used to specify the new name of a file specified in a preceding RNFR (Rename From) command.

So that means that the After Put property needs to be set as:

RNFR orders.20231124120624.055.tmp;RNTO orders.20231124120624.055.xml

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

File System permission for the BizTalk Server 2004 to 2020 File Adapters

File System permission for the BizTalk Server 2004 to 2020 File Adapters

Today, I will bring back to life another old BizTalk Server blog post, the last one, written by an old friend of mine, Thomas Canter, with his permission, that I find pretty interesting and helpful: File System permission for the BizTalk Server 2004 to 2010 File Adapters – be aware that I rename it to File System permission for the BizTalk Server 2004 to 2020 File Adapters. This was initially published on http://geekswithblogs.net/ThomasCanter, now retired.

I’m sure that over time, you’ve run into the dreaded File transport does not have read/write privileges for receive location error.

Usually, you simply go to the folder and either give the BizTalk Account Full Permission (bad) or Everyone Full Permission (really bad).

So, what are the absolute minimum permissions required for a production environment?

Receive File Adapter

For the Receive File Adapter, the explicit permissions are:

NTFS Attribute Property Name
DELETE Delete Files
FILE_READ_DATA List Folder / Read Data
FILE_WRITE_DATA Create Files / Write Data
FILE_APPEND_DATA Create Folders / Append Data
FILE_READ_EA Read Extended Attributes
FILE_WRITE_EA Write Extended Attributes
FILE_DELETE_CHILD Delete Subfolders and Files
FILE_READ_ATTRIBUTES Read Permissions
FILE_WRITE_ATTRIBUTES Write Attributes

How does this translate into what to do in the System?

Right-clicking on the folder and select Properties. In the security tab, setting Modify is not enough, though you would think so:

Strangely enough, the Delete Subfolders and Files attribute is not set when the Modify property is set. You need to add the FILE_DELETE_CHILD Delete Subfolders and Files Attribute:

Once you have added the Delete Subfolders and Files check box, you will have the minimum permissions for the file receive adapter.

Send File Adapter

The permission for the File Send adapter depends on what properties you have set in the Adapter’s Advanced properties:

If you have the Use temporary file while writing flag un-checked, then all you need are:

NTFS Attribute Property Name
FILE_WRITE_DATA Create Files / Write Data

If you have the Use temporary file while writing flag checked, then the flags you need are:

NTFS Attribute Property Name
DELETE Delete (or Delete Files)
FILE_WRITE_DATA Create Files / Write Data
FILE_DELETE_CHILD Delete Subfolders and Files
FILE_READ_ATTRIBUTES Read Permissions

Note: I couldn’t get the original pictures in good quality, so I decided to create and update the pictures to the current days but keep the essence of the original ones.

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

BizTalk Server and WinSCP Error: Could not load file or assembly ‘WinSCPnet, Version=1.12.0.12858, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ or one of its dependencies

BizTalk Server and WinSCP Error: Could not load file or assembly ‘WinSCPnet, Version=1.12.0.12858, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ or one of its dependencies

It is always fun to return to one of my favorite topics: Errors and warnings, causes and solutions – aka Troubleshooting! Regardless of the technology, language, or service, we are using. In this case, this problem occurred when configuring the SFTP adapter in BizTalk Server 2020, which means BizTalk Server and WinSCP.

After installing and configuring the pre-requirements of the SFTP adapter according to the official documentation and using the BizTalk WinSCP PowerShell Installer, you can find it here. In our case, the latest official WinSCP version 5.19.2. We got the following error while trying to send a test message using the SFTP adapter:

A message sent to adapter “SFTP” on send port “SendPort2” with URI “sftp:/FTP-SERVER:22/%SourceFileName%” is suspended.

Error details: System.IO.FileLoadException: Could not load file or assembly ‘WinSCPnet, Version=1.12.0.12858, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)

File name: ‘WinSCPnet, Version=1.12.0.12858, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ —> System.Exception: SFTP adapter requires WinSCP to be installed. Please refer http://go.microsoft.com/fwlink/?LinkID=730458&clcid=0x409 . —> System.IO.FileNotFoundException: Could not load file or assembly ‘file:///C:WINDOWSMicrosoft.NetassemblyGAC_MSILMicrosoft.BizTalk.Adapter.Sftpv4.0_3.0.1.0__31bf3856ad364e35WinSCPnet.dll‘ or one of its dependencies. The system cannot find the file specified.

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

   at System.Reflection.Assembly.LoadFrom(String assemblyFile)

   at Microsoft.BizTalk.Adapter.Sftp.SftpHelper.AssemblyResolver(Object sender, ResolveEventArgs args)

   — End of inner exception stack trace —

   at Microsoft.BizTalk.Adapter.Sftp.SftpHelper.AssemblyResolver(Object sender, ResolveEventArgs args)

   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

Server stack trace:

   at Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.Send(Message message, TimeSpan timeOut)

   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:

   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)

   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

Exception rethrown at [1]:

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at System.ServiceModel.Channels.IOutputChannel.EndSend(IAsyncResult result)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendCallback(IAsyncResult result)

I was surprised by the error because this wasn’t the first time I had installed the SFPT Adapter. I have successfully performed this configuration in many clients and never found myself in a WinSCP DLL version nightmare.

Cause

As mentioned, I never had a version issue with the WinSCP DLLs if I installed it according to the documentation. That means depending on the BizTalk Server version and cumulative we have installed, we have to select the proper WinSCP version, for example:

  • With BizTalk Server 2020 (no CU installed), we need to use WinSCP 5.15.4
  • With BizTalk Server 2020 with CU1 and/or CU2 we need to use WinSCP 5.17.6
  • With BizTalk Server 2020 with CU3 and/or CU4 we need to use WinSCP 5.19.2

To put the SFTP Adapter, we need to copy the WinSCP.exe and WinSCPnet.dll to the BizTalk installation folder, normally C:Program Files (x86)Microsoft BizTalk Server. So, by the error description, this issue was clearly a DLL version issue.

In our case, we had BizTalk Server 2020 with CU4 and correctly installed the WinSCP 5.19.2. However, this version of WinSCP brings version 1.8.3.11614 of WinSCPnet.dll instead of version 1.12.0.12858, which is asking for. WinSCPnet.dll version 1.12.0.12858 is only available in WinSCP 5.21.5.

After some investigation, we detected that WinSCP version 5.21.5 was installed on the server, and because of that, the BizTalk Server SFTP adapter was trying to look for this version on C:WINDOWSMicrosoft.NetassemblyGAC_MSILMicrosoft.BizTalk.Adapter.Sftpv4.0_3.0.1.0__31bf3856ad364e35.

Notice that you don’t need to install any WinSCP software or GAC any WinSCP DLL on the BizTalk Server machine.

Solution

In the end, this is an issue that can be fixed easily. And there are many ways to solve this:

  • First approach: This may be the correct approach, is to:
    • Uninstall the WinSCP 5.21.5 version or any other version installed on the machine.
    • Make sure that there aren’t any WinSCPnet.dll in the GAC.
    • Download the WinSCP 5.19.2 – https://winscp.net/download/WinSCP-5.19.2-Automation.zip and copy the WinSCP.exe and WinSCPnet.dll to the BizTalk installation folder, normally C:Program Files (x86)Microsoft BizTalk Server.

Note: We didn’t apply this approach because we were unsure who and what was using this WinSCP version.

  • Second approach: This second approach may not be 100% supported, but it still works like a charm.

We maybe also solve this problem by using an assembly redirect on the machine.config but I didn’t try it out.

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

PowerShell script to download a specific version of WinSCP

PowerShell script to download a specific version of WinSCP

Today I was helping a BizTalk Server customer migrate their process from using the FTP adapter to the SFTP adapter. And if you are familiar with the BizTalk SFTP adapter, you will be aware of the painful process of choosing the correct version of WinSCP and how that hell we need to do to work correctly with the BizTalk Server, which is quite simple in general:

  • Download WinSCP and the .net Library, ensuring you get the correct version!
  • Copy the .exe and .dll to the BizTalk installation folder
  • DO NOT gac anything. If you GAC the .net library, it will not work because it expects WinSCP.exe to be in the same path, so that’s why they both go into the BizTalk installation folder.

However, the biggest issue is: what is the correct WinSCP version I need for my version of BizTalk Server 2016 or 2020?

And for that reason, Thomas E. Canter, on his day as a Phidiax consultant, decided to create this fantastic PowerShell script BizTalk WinSCP Installer, which during the years, has evolved and was improved by several people like Michael Stephenson, Nicolas Blatter, Niclas Öberg and myself.

If your environment has access to the internet, then I will recommend you use that script to install WinSCP! However, my client didn’t have access to the internet from the production server, and to complicate it a little bit, it didn’t have the same Build version. Let’s say in the test environment, it did have BizTalk Server 2016 with Feature Pack 3 and Cumulative Update 9, but in production, we would find BizTalk Server 2016 with Feature Pack 3 and Cumulative Update 5. That means we couldn’t copy the files from other environments to production. We had to use a different WinSCP version.

To address this scenario, I created a simple PowerShell version that you could choose the version you want to download and that you can run on any machine with access to the internet without checking the Build version you have in your environment.

This is a simple abstract of the PowerShell script:

$checkExeExists = Test-Path $targetNugetExe
if(-not $checkExeExists)
{
    if ($PSCmdlet.ShouldProcess("$sourceNugetExe -OutFile $targetNugetExe", "Run Invoke-WebRequest ")) {
        Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
        $targetNugetExeExists = Test-Path $targetNugetExe
        if (-not $targetNugetExeExists) {
            $Continue = $false
            Write-Error "`n$bangString";
            Write-Error "The download of the Nuget EXE from";
            Write-Error $sourceNugetExe;
            Write-Error "did not succeed";
            Write-Error "$bangString";
        }
        else{
            Write-Success "nuget.exe download successfully."
        }
    }
}

if ($PSCmdlet.ShouldProcess("$getWinSCP", "Run Command")) {
    Invoke-Expression "& $getWinSCP";
    $WinSCPEXEExists = Test-Path $WinSCPEXEDownload
    $WinSCPDLLExists = Test-Path $WinSCPDllDownload
    if (-not $WinSCPDLLExists) {
        $Continue = $false
        Write-Error "`n$bangString";
        Write-Error "WinSCP $winSCPVersion was not properly downloaded.";
        Write-Error "Check the folder and error messages above:";
        Write-Error "$nugetDownloadFolder";
        Write-Error "And determine what files did download or did not download.";
        Write-Error "$bangString";
    }
    else{
        Write-Success "WinSCP $winSCPVersion was properly downloaded."
    }
}

THESE POWERSHELL SCRIPTS ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

Where can I download it?

You can download the complete Azure Function source code here:

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.

He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira

BizTalk WCF-SAP Adapter: Could not load file or assembly ‘Microsoft.Adapters.SAP.SAPGInvoker.dll’ or one of its dependencies

BizTalk WCF-SAP Adapter: Could not load file or assembly ‘Microsoft.Adapters.SAP.SAPGInvoker.dll’ or one of its dependencies

Last week I was adding new processes to an existing and old project for a client, a project that I started a few years ago, and I was caught by surprise with the following error while trying to generate a new SAP schema from Visual Studio:

Error occurred while browsing the LOB system. Adapter Message: Could not load file or assembly ‘Microsoft.Adapters.SAP.SAPGInvoker.dll’ or one of its dependencies. The specified module could not be found.

At first sight, the cause for the error is simple, and I will explain above the main causes, but in my case, the problem was that I had all the pre-requirements for the WCF-SAP adapter to work, and again that was an existing project where I had already generated several SAP Schemas.

Cause

Normally the main reason for this error is that the pre-requirements to run the WCF-SAP adapter are not installed in the environment. Even if you see the WCF-SAP adapter present and configured in the BizTalk Server Administration console, it doesn’t mean that it is ready to work. This adapter requires you to install the following SAP resources to run the adapter in the BizTalk Server box:

  • NCo3018_Net40_x64.msi
  • NCo3018_Net40_x86.msi

You can download these resources from the SAP Service Marketplace.

It is required (mandatory) to install the x86 version of the SAP Connector for Microsoft .NET. However, if you want to run the adapter under a 64-bit Host Instance, you need to install both the x86 and x64 versions of the SAP Connector for Microsoft .NET (recommended).

But once again, I knew that I had all these resources installed, and I doubled check that they were installed.

In my case, for some unknown reason, some of these DLLs got corrupted, and for that reason, I was getting this error.

Solution

To fix this issue, the solution is quite simple:

  • Reinstall the x86 and x64 versions of the SAP Connector for Microsoft .NET.
    • NCo3018_Net40_x64.msi
    • NCo3018_Net40_x86.msi
  • When asked, repair the installation of the components.

After that, I was once again able to generate SAP Schemas from my BizTalk Server Visual Studio project.

This applies to:

  • BizTalk Server 2020
  • BizTalk Server 2016
BizTalk Server 2020: Step-by-Step WCF-ORACLE Adapter installation guide

BizTalk Server 2020: Step-by-Step WCF-ORACLE Adapter installation guide

Oracle Database (commonly referred to as Oracle DBMS or simply as Oracle) is a multi-model database management system produced and marketed by Oracle Corporation. It is a database commonly used for running online transaction processing (OLTP), data warehousing (DW), and mixed (OLTP & DW) database workloads.

One of the most common scenarios we face in several organizations is to be able to integrate other systems and applications with Oracle, and for that, BizTalk Server uses the Microsoft BizTalk Adapter for Oracle Database or simply the WCF-ORACLE adapter.

The Microsoft BizTalk Adapter for Oracle Database exposes the Oracle database as a WCF service. Adapter clients can perform operations on the Oracle database by exchanging SOAP messages with the adapter. The adapter consumes the WCF message and makes appropriate ODP.NET calls to perform the requested operation. The adapter returns the response from the Oracle database back to the client in the form of SOAP messages.

The Oracle Database adapter surfaces metadata of Oracle database artifacts (tables, functions, procedures, etc.) that describes the structure of a SOAP message in the form of Web Service Description Language (WSDL).

  • It uses the Add Adapter Service Reference Visual Studio Plug-in, the Consume Adapter Service BizTalk Project Add-in, and the Add Adapter Metadata Wizard to enable adapter clients to retrieve metadata for operations and generate programming artifacts that can be used in your programming solution.
  • And it communicates with the Oracle database through the Oracle Data Provider for .NET (ODP.NET) and the Oracle client, which are part of the Oracle Data Access Components (ODAC) for Windows.

The following figure shows the end-to-end architecture for solutions that are developed by using the Oracle Database adapter:

This paper explains in detail – a step-by-step guideline – how to install and configure the WCF-OracleDB Adapter on a BizTalk Server 2020 standalone environment running Windows Server 2019.

What’s in the Whitepaper for you?

This whitepaper will give you a detailed understanding of the following:

  • Installation requirements
    • Supported systems
  • Install Oracle Data Access Components (ODAC)
    • Installation checks
    • Testing Oracle connectivities

Where can you download it

You can download the whitepaper here:

BizTalk Server 2020: Step-by-Step WCF-SAP Adapter installation guide

BizTalk Server 2020: Step-by-Step WCF-SAP Adapter installation guide

There was a lot of inconsistent and incorrect information about the BizTalk WCF-SAP Adapter installation process and how it works, especially in old versions of the adapter where there was a need to use the classic RFC library to connect to SAP.

Fortunately for us, this process is now simpler and more direct, and this is due specifically to two points:

  • The Classic RFC Library has been discontinued and is no longer supported (support ended on March 21, 2016). All customers should, if not already using, the “new” SAP .NET Connector (NCo) 

Notice that the BizTalk Adapter Pack WCF-SAP adapter has been re-engineered to use SAP .NET Connector instead of the classic SAP RFC SDK. The SAP .NET Connector is available through the ConnectorType property within the WCF-SAP binding. This feature is available from BizTalk Server 2013 and above.

  • On BizTalk Server 2020, the Microsoft BizTalk Adapter Pack x86 and x64 are now installed with the default installation process. That means that the WCF-SAP adapter is already registered on the server and present on the BizTalk Server Administration Console.

However, that does not mean that everything is ready for you to be able to use this adapter. Unfortunately, you still need to install the SAP Connector for Microsoft .NET available for you to download through the SAP Service Marketplace.

Notice that, like any other adapter, the 64-bit version of the SAP Connector for Microsoft .NET is optional, but if you have a 64-bit BizTalk environment and you want to run it under a 64-bit Host Instance, then you need to also install both versions of the SAP Connector for Microsoft .NET.

BizTalk Server 2020: Step-by-Step WCF-SAP Adapter installation guide

By reading this whitepaper, decision-makers should have more information on the following areas:

  • Pre-requirements resources that are necessary and how to install them
  • Register the adapter in BizTalk Server Administration Console

Where can I download it?

You can download the whitepaper here:

Your Guide to BizTalk Message Context Properties whitepaper

Your Guide to BizTalk Message Context Properties whitepaper

As you most likely are aware, when a document is received by a BizTalk Server adapter, the adapter creates a BizTalk message for the document. The BizTalk message contains the document that was received as well as a message context. The message context is a container for various properties that are used by BizTalk Server when processing the document. Each property in the Message Context is composed of three things, a name, a namespace, and a value.

Message context properties are added to the message context throughout the lifetime of the message as it passes through the BizTalk Server. These properties:

  • Are either extracted from the message itself, for example, order id or shipment number
  • Or added by pipelines and adapters at the receive location, for example, transport name or receive port name

There are mainly two benefits of this context:

  • The first is to provide the various components of BizTalk, an easy access to these properties, without having to parse the message
  • The second is to support content-based routing.

There are two different types of message context properties used by BizTalk as described below:

  • Distinguished Fields
  • Property Fields.

In this whitepaper, you will learn the key differences between Distinguished and Property Fields but most importantly you will have access to a complete list of known property schema and properties used internally by the BizTalk Server out-of-the-box components.

What’s in store for you?

This whitepaper will give you a detailed understanding of the following:

  • BizTalk Message Context Properties
    • What are Property fields and how to promote properties?
    • What are distinguished fields and how to create a distinguished field?
    • Summary of differences between Property Fields and Distinguished Fields
  • System property schema and properties
  • Error Report property schema and properties
  • Legacy schema and properties
  • Microsoft BizTalk XLANGs BTXEngine schema and properties
  • Message Tracking schema and properties
  • BizTalk Framework Schema and Properties
  • MIME-SMIME Property Schema and Properties
  • XML and Flat File Property Schema and Properties
  • File adapter property schema and properties
  • FTP Adapter Property Schema and Properties
  • HTTP Adapter Property Schema and Properties
  • MQSeries Adapter Property Schema and Properties
  • MSMQ Adapter Property Schema and Properties
  • POP3 Adapter Property Schema and Properties
  • SMTP Adapter Property Schema and Properties
  • SFTP Adapter Property Schema and Properties
  • SOAP Adapter Property Schema and Properties
  • SQL Adapter Property Schema and Properties
  • WCF Adapters Property Schema and Properties
  • Windows SharePoint Services Adapter Property Schema and Properties
  • Azure Service Bus Adapter Property Schema and Properties
  • Azure Blob storage Adapter Property Schema and Properties
  • Azure Event Hubs Adapter Property Schema and Properties
  • Office 365 Outlook Calendar Adapter Property Schema and Properties
  • Office 365 Outlook Contact Adapter Property Schema and Properties
  • Office 365 Outlook Email Adapter Property Schema and Properties
  • SharePoint Online Adapter Property Schema and Properties
  • Microsoft BizTalk Accelerator for HL7 (BTAHL7) Property Schema and Properties
  • How to write or promote properties in the context of a messages through the BizTalk API
    • Promote method
    • Write method
    • Property Schema Base

Where I can download it

You can download the whitepaper here:

I hope you enjoy reading this paper and any comments or suggestions are welcome.