Almost one month after I have released, BizTalk Scheduled Task Adapter suffered its first update in order to fix one important bug.

One of the important bug that was fixed in the previous version (5.0) was the support for timespan with more than 60 seconds, but while doing that I unintentionally create another bug.

  • The adapter was not respecting Start time property defined in the Schedule property page after restarting the Host Instance, instead it was using the Host Instance date time.

The time interval defined in the Schedule property page of the receive location must respect the Start time property defined there (and is now fixed and restored the correct behavior in this minor version)

BTS-Scheduled-tasl-adapter-5.0.4-properties

The expected behavior of the BizTalk Scheduled Task Adapter in this case is:

  • The first message will be triggered at 16:55;
  • The second at 17:00;
  • Third at 17:05… 17:10, 17:15 and so on.

However if I stop the host instance, let’s say at 17:18, and start the host instance again at 17:21, the expected behavior of the Scheduled Task Adapter is to:

  • The first message will be triggered at 17:25, because is the next 5 min interval based in start date defined in the properties, then 17:30 and so on.

 

Once again, this bug is now fixed and restored the correct behavior in this new minor version.

You can download this new version of the adapter in BizTalk Scheduled Task Adapter CodePlex project page:

V5.0.4 Change log

  • Bug fixes
    • Bug: TimeSchedule didn’t respect the start date defined in the receive location, instead it was using the host instance starting date after a restart – Solved

Release History

This adapter is available since BizTalk Server 2004.

  • Release 5.0.4: minor release for BizTalk Server 2013 R2 in March 16 2015 by Sandro Pereira: bug fixes.
  • Release 5.0: release in February 18 2015 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2013 R2. Compiled in .NET Framework 4.5
  • Release 4.0: release in June 12 2012 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2010. Compiled in .NET Framework 4.0
  • Release 3.0: release in Aug 10 2010 by Greg Forsythe, this adapter was tested to work on BizTalk Server 2009. Compiled in .NET Framework 2.0
  • Release 2.0: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 2.0
  • Release 1.02: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2004, BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 1.1

Note: The version change from V5.0 to V5.0.4 because some internal versions where made

In my last post I described Top 7 Reasons to attend BizTalk Summit London 2015 event and as I mention there this year this annual event will be even bigger and better! There are already 250 registrations (based on what I heard from the speaker update email) and we will have a capacity for 500 attendees, so if you are working in Microsoft Integration (Microsoft’s evolving (cloud) application platform, BizTalk Server on-premise and as IaaS, and many more), BizTalk Summit London 2015 is an event that you must attend!

The event will be held in April 13-14 at ExCeL London Exhibition and Convention Centre and once again is being organized by BizTalk360 in conjunction with Microsoft and the BizTalk Product group. Please visit this link for registration information.

sandro-speakers-badges

My topic is about “BizTalk Server tips and tricks for developers and admins”.  You can read the details below.

Session Abstract

It’s critical to use good tools and techniques to produce working solutions as quickly as possible and at the same time, given the increase the requirements and number of applications organizations develop today. But at the same time, it’s also critical to maintain the health of the entire platform.

In this session, which I’ll try to be a very interactive session (so be prepare to participate), I’ll address and share some useful BizTalk Server Tips and Tricks (and Workarounds) both for developers and administrators. Covering some topics like RosettaNet, SAP, database maintenance, debatching, out-of-the-box pipelines vs custom pipelines and many more.

I hope that, like me, you find it an interesting topic! See you there!

Hard to imagine that on 16th January, 2013 the “BizTalk Crew” (Steef-Jan Wiggers, Nino Crudele, Saravana Kumar, Tord Glad Nordahl and me) were starting one of the most important Integration event in the world with bit of help from the BizTalk product group (Guru Venkataraman and Ravi Krishnaswamy) The event was a huge success that time with 128 attendees from 72 companies across 15 countries.

1thEdition

Then Saravana Kumar and is his team (BizTalk360) took care of it and was able to take it to the next level! And what an amazing job they have done (doing..)

Last year BizTalk360 team took the next step by converting the one day event into two days event with 12 Microsoft Integration MVP’s from across the world and 2 Microsoft Product group members. 200 attendees and more than 100 different companies across 20 countries were present in this event. These are some of the numbers that reflect the increase and the huge success of this event! Everyone I spoke to during the event was extremely excited and appreciated the work put together by BizTalk360 team in organizing such a focused event for Microsoft Integration professionals, which was missing for a while.

So what to expect this year?

Well the answer is easy… Even bigger and better! The event will be held in ExCeL London Exhibition and Convention Centre (used in the 2012 Summer Olympics in London) and we will have a capacity for… do you want to guess?… 500 people! From what I heard from the speaker update email, there are already 250 registrations, and still 5 more weeks to go.

Let’s make the goal a reality! And create a platform for ourselves who are working in Integration space. From my experience I wanted to highlight why you should attend the event, I took top 7 reasons I can think, of course you know there are more, to attend this event:

reason1

Learn from the experts

The #1 reason people should come to this event, is to make themselves more valuable to their companies by learning new ideas and techniques from the experts. 18 speakers (combination of Microsoft product group members and Microsoft Integration MVP’s) with real world implementation experience from around the world will provide valuable information on integration topics, new trends and technologies that will benefit your firm and your clients.

360 coverage! There is something for everyone regardless of job role: developers, administrators and architects, or interest: Cloud an on premise

Get insight and answers to your questions from these real world experts.

reason2

Imagine the future of Integration

Understand the future of Microsoft integration and its role in the "Internet of Things". Microsoft public annouce BizTalk MicroService in Integrate 2014 – Global BizTalk Summit which was held last December in Redmond so it is expected to be announced new updates, we never know what to expect from Product Group they maybe have some surprises for us.

reason3

Network, Connect, and Reconnect with Colleagues

Take this amazing opportunity to get to meet the people you have been following on Twitter and blogs and network with others who are interested in the same things you are. For return attendees, another chance to hang out with the smartest people you know – and I’m not talking about the speakers! J – and meet new ones.

Don’t be afraid or shy, don’t wait for them and take your chances, engage the people you want to meet by easily saying "Hi my name is… ". This experience can be a great morale booster for you, lifelong friendships and connections have evolved from such conferences – I’m speaking for personal experience!

reason4

Face to Face, learn from one another and Develop Professionally

The knowledge and experience of all the attendees, speakers and product group members at these events is unreal!!! You will not find an opportunity like this every day.

At these events speakers are usually available to chat and answer questions. And if you are bold, remember to pull out your camera and ask if you can take a photo with them.

Take to this opportunity to connect face to face with experts and peers who will give you valuable insight to industry trends; meet influential colleagues and generate new solutions to common problems, like increasing profitability and solving staffing challenges.

I love being around great thinkers…it can really get your own mind flowing. We always have something new to learn from one another and take back with us.

reason5

The next big thing…

Last year Nino introduce us the best BizTalk Developer tool ever made: BTSG NoS addin. A tool intended to improve the developer experience and why not reduce the development time in new or existent BizTalk projects. BizTalk360 team has some surprise announcements in this area.

So what to expect this year? Will Nino surprise us once again, or is going to be another speaker with the next big “Yehhhh” by the attendees. Or you may be inspired to produce yourself, the best ideas come when you least expect it….

reason6

Business Networking and Opportunity for Partnerships

Socializing is fun but this audience is made up by experts and minded people, meeting them not only inspires but it can also create an opportunity to build partnerships. There will be people from all over the world, this can be a huge opportunity for you and your business.

Bring business cards. Lots of them.

reason7

Refresh and recharge and have some fun

Take these two days off busy work schedules to learn, refresh and recharge. And most important: Have some fun!

Once you’ve soaked in all the knowledge from the speakers and breakout sessions your day will be far from over. Use the evenings to connect with colleagues and experts in a relaxed fun environment like a Bar or speaker dinner or restaurants – sometimes the most interesting conversations happen at the very end of each day in the Lobby Bar.

And then return to work reinvigorated.

This is one conference you can’t afford to miss! See you in London. What are you waiting for, go ahead and book it.

BSL2015-register

There is a lot of inconsistent and incorrect information about the BizTalk SAP Adapter (or in this case WCF-SAP Adapter) installation process and how it works – It is normal to see comments that the adapter only runs on 32-bit, or to see indications that we have to copy DLLs to two different places (System32 and SysWOW64) but which ones?

I hope with this step-by-step installation guide to clarify a bit and document a little better this task.

So, one of the key question that we need to clarify is: Does the WCF-SAP adapter runs under 64-bit Host Instance?

And the correct response to this question is: Yes, it does! The SAP adapter supports both the 32-bit and the 64-bit versions of the SAP RFC SDK, so it can run under 32 or 64-bit Host Instances.

The second important question that we need to clarify is that: Documentation specifies that we need to add the 32-bit version of the client DLLs for the SAP adapter to C:\Windows\SysWow64 folder and the 64-bit version of the DLLs must be added to C:\Windows\System32 folder, but what this means? Do need to add the same DLL in two different folders?

Indeed, the documentation is correct and we need to add both 32 and 64-bit to different folder in our system… but this are different DLL and no the same ones – so if you only have one SDK resource, for example the SAP RFC SDK 32-bit, you just need to add this into one of the folders, copy for both places doesn’t make any difference because the adapter will only run in this case under a 32-bit Host Instance.

For each SAP Client version (6.4, 7.0 and so on) there are two SAP RFC SDK one for 32-bit and one for 64-bit and you need to download and install both… just like the BizTalk Server Adapter Pack.

There are SAP UNICODE and NON-UNICODE, so witch version of the SAP RFC SDK should I download?

The SAP adapter requires Unicode version of the RFC SDK irrespective of whether the SAP system is Unicode or non-Unicode.

Official documentation states that only the following SAP server versions are supported:

  • SAP 7.2, SAP 7.0, SAP ERP 6.0 with EHP 4.0, SAP ECC 6.0 Unicode

However earlier version, which were mentioned in previous versions of the documentation, are also supported:

  • SAP ECC 5.0 Non-Unicode, SAP ECC 5.0 Unicode, SAP R/3 4.7 Non-Unicode, SAP R/3 4.7 Unicode, SAP R/3 4.6c Non-Unicode, SAP ERP 6.0 with EHP 4.0

Also official documentation states that the only supported client version is the SAP RFC SDK 7.2 UNICODE – I always recommend to use the latest version… however, once again, as previous versions of the documentation mentioned, these client versions are also supported:

  • SAP client 6.4 version: SAP RFC SDK 6.40 UNICODE
  • SAP client 7.0 version: SAP RFC SDK 7.00 UNICODE
  • SAP client 7.1 version: SAP RFC SDK 7.10 UNICODE
  • SAP client 7.11 version: SAP RFC SDK 7.11 UNICODE

I’m not a SAP expert but I think that all depends if the SAP client version is supported in your SAP System version. For example, in one BizTalk Server 2013 R2 environment I have the SAP client 7.2 version installed and in another one, a BizTalk Server 2013, I have the 7.0 and both are working fine.

And finally: Can I install only the 64-bit version?

No, you can’t and for the exact same reason that we need to install both version of the BizTalk Server Adapter Pack: Visual Studio and BizTalk Administration console are 32-bit applications, so in order to configure the adapter in runtime (Receive Locations or Send Ports that will be using the SAP Adapter) or to use it to generate the schemas in the development phase you always need to have installed the 32-bit version of the SAP RFC SDK.

The 64-bit version of the SAP RFC SDK is optional, but, if you have a 64-bit BizTalk environment and you want to run it under 64-bit Host Instance, then you need to also install both versions of the SAP RFC SDK.

Download Prerequisites

As happen with other LOB adapters (like Oracle for example), installing the BizTalk Adapter pack is not enough and you will need the addition resources that will be specify bellow.

Download SAP Resources from SAP Service Marketplace

You need to obtain a few resources from the SAP Service Marketplace in order to properly install WCF-SAP adapter:

  • SAP RFC SDK <version> UNICODE 32-bit
  • SAP RFC SDK <version> UNICODE 64-bit
  • R3DLLINST.zip containing Microsoft run-time DLLs
  • SAPCAR – SAPCAR is a compress utility (similar to WinZip, tar and so on), that is used by SAP to compress and decompress nearly all delivered files

Unfortunately, SAP Service Marketplace is restricted, so if you like to benefit from the content and services offered in the different portals of the SAP Service Marketplace, you need to request your personal User ID otherwise you need to ask your client or your SAP team to give you this resources.

In additional to the links above you may also find useful to give these two SAP notes to your client or SAP team:

Unlike R3DLLINST.zip, that is a unique resource, on the SAP Service Marketplace portal SAP RFC SDK page you will find several resources and we must understand exactly what we need, in this case for example purposes, I’m using the SAP RFC SDK 7.20 page:

SAP-Service-Marketplace-portal-SAP-RFC-SDK-7.20

Depending in the SAP client version you want to install this may change a little, but it is practically the same for the other versions, as you can see in the case of SAP RFC SDK 7.00 page

SAP-Service-Marketplace-portal-SAP-RFC-SDK

What you need to download is the:

  • Windows Server on IA32 32bit” –> this is the SAP RFC SDK 7.00 UNICODE 32-bit
  • And the “Windows on x64bit” –> SAP RFC SDK 7.00 UNICODE 64-bit

You also need to download SAPCAR to extract (unzip) the SAP resources, I think you may found this resource at service.sap.com/patches under:

  • Download, Support Packages and Patches, Entry by Application Group, Additional Components and then SAPCAR

SAP-Service-Marketplace-portal-SAPCAR

Extract SAP Resources

Once we have downloaded all this SAP resources, we need to use the SAPCAR to extract the SAP resources, in this case (SAP RFC SDK 7.20):

  • “RFC_12-10009744.SAR” is the 64-bit SDK that we want to extract to “rfcsdk 64” folder
  • “RFC_12-100097446.SAR” is the 32-bit SDK that we want to extract to “rfcsdk 32” folder

BizTalk-Server-SAP-Software-resources

To accomplished that we need to:

  • Open a command line prompt
  • Change our directory to the location where we saved the “SAPCAR.exe” and execute the following command to extract the the SAR archive:
    • SAPCAR.exe -xfv “RFC_12-10009744.SAR”
      • This will create a folder call “rfcsdk”, rename that to “rfcsdk 64”

Extract-SAR-archive-with-SAPCAR

    • SAPCAR.exe -xfv “RFC_12-10009746.SAR”
      • This will create a folder call “rfcsdk”, rename that to “rfcsdk 32”

The final step regarding to SAP Resource is to unzip the “r3dllinst.zip” file using for example an open source Windows utility for manipulating archives like 7-Zip.

Download Microsoft Visual C++ 2005 SP1 Redistributable Package

Microsoft Visual C++ run-time DLLs, again both 32 and 64-bit are required for SAP 7.11 client or higher. This resources are available from download in the following links:

download-Microsoft-Visual-C  _2005_SP1_Redistributable_Package

download-Microsoft-Visual-C  _2005_SP1_Redistributable_Package-files

Step-by-Step WCF-SAP Adapter installation guide

The first thing you need to make sure that you have installed already is both 32 and 64-bit versions of the Microsoft BizTalk Adapter Pack.

  • The Microsoft BizTalk Adapter Pack contains adapters that enable enterprise applications and databases to interface with each other by implementing a common adapter framework. Similar to programming to Web services, adapters enable clients to program to different enterprise applications. Technically, adapters are a binding to Windows Communication Framework (WCF). The BizTalk Adapter Pack consists of the following adapters:
    • Microsoft BizTalk Adapter for Oracle Database (Oracle Database adapter).
    • Microsoft BizTalk Adapter for Oracle E-Business Suite (Oracle E-Business adapter).
    • Microsoft BizTalk Adapter for mySAP Business Suite (SAP adapter). This also includes the .NET Framework Data Provider for mySAP Business Suite (Data Provider for SAP).
    • Microsoft BizTalk Adapter for Siebel eBusiness Applications (Siebel adapter). This also includes the .NET Framework Data Provider for Siebel eBusiness Applications (Data Provider for Siebel).
    • Microsoft BizTalk Adapter for SQL Server (SQL adapter).
  • Find more about the BizTalk Adapter Pack installation process in the following articles:

Notice that, at this point, if you try to create a receive or send port using the WCF-SAP adapter you will get the following error:

Exception has been thrown by the target of an invocation. (mscorlib)
Could not load file or assembly ‘Microsoft.Adapters.SAP.SAPGInvoker.dll’ or one of its dependencies. The specified module could not be found. (Microsoft.Adapters.SAP)

Could-not-load-file-assembly-Microsoft.Adapters.SAP.SAPGInvoker.dll

This is because we need the SAP resources required to run the adapter are not install (or are i installed incorrectly).

So, now that we have install the Microsoft BizTalk Adapter Pack, we need to install the SAP Resources that we previous download in our BizTalk Server machine:

  • Open the “rfcsdk 64” folder containing the SAP RFC SDK 7.20 UNICODE 64-bit and access to the lib folder
    • “C:\SAP Resources\rfcsdk 64\lib”

SAP-rfcsdk-7.2-64-bit-lib-Resources

  • Install the SAP RFC SDK 64-bit DLLs by coping (or drag) them to the “System32” folder in your system “Windows” folder
    • “C:\Windows\System32”:

SAP-rfcsdk-7.2-64-bit-lib-Resources-Installation

  • And now we need to do the a similar process to the Open the SAP RFC SDK 7.20 UNICODE 32-bit
  • For that you need to open the “rfcsdk 32” folder containing the SAP RFC SDK 7.20 UNICODE 32-bit and access to the lib folder
    • “C:\SAP Resources\rfcsdk 32\lib”

SAP-rfcsdk-7.2-32-bit-lib-Resources

  • Install the SAP RFC SDK 32-bit DLLs by coping (or drag) them to the “SysWOW64” folder in your system “Windows” folder
    • “C:\Windows\SysWOW64”:

SAP-rfcsdk-7.2-32-bit-lib-Resources-Installation

  • Open the “r3dllinst\ ntpatch” folder containing the content of “r3dllinst.zip” file, ,and we need to execute the “R3DLLINS.EXE” tool, in order to install the SAP R/3 DLLs (Microsoft run-time DLLs):
    • msvcr71.dll
    • msvcp71.dll
    • mfc71.dll
    • mfc71u.dll

install-SAP-r3dllinst-R3DLLINS

  • The tool specifies that the DLLs were installed under “C:\Windows\System32” folder, however because I’m using a 64-bit environment instead they were installed in “c:\Windows\SysWOW64” folder

install-SAP-r3dllinst-R3DLLINS-SysWOW64

    • You should check if DLL are present in “C:\Windows\System32”, if they are not I advise you to:
      • Leave them in the ” c:\Windows\SysWOW64” folder
      • And, just to be sure, copy the same four DLLs to “C:\Windows\System32” folder

install-SAP-r3dllinst-R3DLLINS-windows-folder

  • And finally we also need to installed Microsoft Visual C++ 2005 SP1 Redistributable Package – 32-bit and 64-bit – containing the Visual C++ run-time DLLs required for SAP 7.20 (or 7.11) client:
    • Install the Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) – 32-bit – by executing the “Vcredist_x86.exe” file that we previous download
      • On the Microsoft Visual C++ 2005 SP1 Redistributable Package window, click “Yes”

Microsoft-Visual-C  -2005-SP1-Redistributable-Package-x86

    • Do the same steps to install the Microsoft Visual C++ 2005 SP1 Redistributable Package (x64) – 64-bit – by executing the “Vcredist_x64.exe” file that we previous download
      • On the Microsoft Visual C++ 2005 SP1 Redistributable Package window, click “Yes”
Add adapters to BizTalk Administration Console

As it happens with all adapters that we installed on our BizTalk Servers environment, before we can begin to use them we need to register or add the adapters. So in the next step it will be describing how can we add the enterprise adapters, or any other custom adapter, on the BizTalk Administration Console. To accomplish that we need to:

  • Open BizTalk Administration Console by pressing the “Windows key” to switch to the Start screen, type “BizTalk Server Administration” or “BizTalk”, click “BizTalk Server Administration” option from the Search menu
  • In the console left tree, expand “BizTalk Server Administration –> BizTalk Group –> Platform Settings” and then “Adapters”
  • Right-click on “Adapters” and add a new adapter by selecting the option “New –> Adapter”

BizTalk-Administration-Console-Register-WCF-SAP-adapter-add-new

  • In the “Adapter Properties” window
    • In the Name box, type a descriptive name for this adapter.
      • WCF-SAP
    • In the Adapter combo box, select the adapter from the drop-down that you want to add.
      • WCF-SAP
    • In the Description box, type a description for the adapter (this is optional).
      • The WCF-SAP adapter provides a rich metadata layer on top of SAP that enables the consumption of RFCs and enables seamless BAPI and IDOC exchange in an interoperable manner. The SAP adapter exposes the SAP system as a WCF service to client applications.

BizTalk-Administration-Console-Register-WCF-SAP-adapter

    • Click “OK” to complete the process of adding the adapter.
      • We will receive a warning message saying that we need to restart the Host Instances
      • Click “Ok”, we will deal with it in a moment

BizTalk-Administration-Console-Register-WCF-SAP-adapter-warning-message

  • Now we need to create other send and receive adapter handlers for the WCF-SAP Adapter, to accomplished that we need to:
  • Expanded the adapter list, right-click the “WCF-SAP” adapter, point to New, and then:
    • click “Send Handler to create a send handler”
    • Or click “Receive Handler” to create a receive handler.

BizTalk-Administration-Console-Register-WCF-SAP-adapter-add-receive-send-handlers

Notice: that by default the adapter already have one Receive and one Send handler that are associated to the default Host Instance – normally the “BizTalkServerApplication” Host Instance

  • Add two send handler using Dedicated Send Hosts
    • One running under 32-bit: BizTalkServerSend32Host
    • One running under 64-bit: BizTalkServerSendHost
  • Add two receive handler using Dedicated Receive Hosts
    • One running under 32-bit: BizTalkServerSend32Host
    • One running under 64-bit: BizTalkServerSendHost
  • Delete the default handlers that use the “BizTalkServerApplication” Host (in my case it was “BizTalkServerApplication64Host”)

BizTalk-Administration-Console-Register-WCF-SAP-adapter-handler-configuration

Note: Now more about Create and Configure BizTalk Server Host and Host Instances in my TechNet Wiki article: BizTalk Server Best Practices: Create and Configure BizTalk Server Host and Host Instances

  • Finally we just need to restart our BizTalk Server Host Instances, for that you need to:
    • Expand the BizTalk group, click “Platform Settings”, and then click “Host Instances”.
    • In the details pane, right-click the host instance you want to start, and then click “Start”.

BizTalk-Administration-Console-restart-host-instances-final-step

Validate if the WCF-SAP adapter is properly installed

To do a preliminary test you to your WCF-SAP Adapter installation you can create a new receive port:

  • Right-click “Receive Ports”, point to “New”, and click “One-way Receive Port”

SAP-validation-add-new-receive-port

  • Just leave the default name and click on the “Receive Locations” tab and then click “New”.

SAP-validation-add-new-receive-location

  • In the Receive Location Properties dialog box, do the following:
    • From the Type drop-down list, select the “WCF-SAP” adapter you added earlier, and then click “Configure”.

SAP-validation-add-new-receive-port-configure-receive-location

If you were able to access the WCF-SAP Transport Properties window and the URI SAP configuration windows, this is half way thru and a good indication that the adapter is properly configured in your environment

WCF-SAP-Transport Properties-adn-URI-Windows

Of course now you need to actually test it against your SAP environment to see if you actually can receive or send messages from or to SAP System.

In my opinion there are a lack of documentation, or good documentation and many of the existing one is obsolete, regarding some topics/feature of BizTalk Server – Microsoft BizTalk Accelerator for RosettaNet is one of them.

Today while I was trying to extend Microsoft BizTalk 2013 Accelerator for RosettaNet (BTARN) with a new receive Partner Interface Process (PIP) schema I was receiving the following error in the event log:

Source module:
RNDisAssembler

Correlation information:

Description:
Receive pipeline rejected incoming message due to the following RNIF exception:
UNP.SCON.VALERR: A failure occurred while validating the service content.

Details:
The document specification <MyNamespace.MyPIP> from assembly <MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=…> failed to load. Verify the schema for this document specification is deployed and is in the Global Assembly Cache.

Note: this same error can occur in previous or new versions of BizTalk Server.

Based on the received error and according to a possible cause described by Microsoft at Troubleshooting: Microsoft BizTalk Accelerator for RosettaNet Issues and Resolutions either the document namespace or the root node property the deployed schema for the instance that you are trying to extend is incorrect.

In fact this could be the issue but I found really odd because in the error details my DLL, containing the schema that I was trying to extend, was being properly referenced, nevertheless I confirmed that it was properly deployed… But as I suspected this wasn’t my problem.

Note: this behavior does not happen with PIP that include out-of-the-box with BTARN (in the Microsoft.Solutions.BTARN.Schemas.RNPIPs dll) only with new ones and only in the incoming process.

Microsoft-Solutions-BTARN-Schemas-RNPIPs

Fortunately for us we have an extended BizTalk Server: List of Errors and Warnings, Causes, and Solutions at TechNet Wiki, I usually update with some frequency and that I used as a reference, which gave me some clues to the final solution. Nick Heppleston mention in his blog that:

“RN Disassembler does in-fact attempt to validate the message contained within the Service Content against a deployed schema just like the standard XmlDisassembler. The message that our trading partner was sending did not validate and hence the RosettaNet Accelerator threw this error message; once we had corrected the schema and redeployed, the error went away.

This is certainly one to be aware of if you are developing custom PIP’s to use with the RosettaNet Accelerator: ensure that the message in the Service Content validates against your custom PIP schema”

Again this isn’t my problem, because the Schema was properly deployed in the system, I only mention this because is important for understanding how the BTARN engine/processes works.

CAUSE

By default BTARN App Pool Settings are configured to use .NET framework 2.0, doesn’t enable 32-bit applications and the application pool is in Classic mode

BTARN-App-Pool-default-Settings

Important for you to know is that the accelerator requires both an in-process and out of process host, both of which must be marked as "Authentication Trusted" and "32-bit only".

To run the BTARN End to End scenario you need two important things:

  • Enable the BTARN Application Pools for 32 bit.
  • Add a HTTP Handler for *.dll refering the IsapiModule Filters.

But what I found today is that when you want to extend BTARN with new incoming PIP’s, the artifacts generated are going to be .NET 4.0/4.5 unless Visual Studio is configured to do otherwise, which we really cannot control using BizTalk projects:

re-targeting-Visual-Studio-BizTalk-Projects-error

This means along with setting the application pools for the 32-bit the .NET setting must be set to match.

SOLUTION

To solve this issue you must:

  • Type “Internet Information Services (IIS) Manager” or “IIS” in the Windows Start screen and click in “Internet Information Services (IIS) Manager” option on Apps menu.
  • Expand the server and click on “Application Pools” to display available application pools in center panel.
  • Right-click on “BTARNAppPool” and select “Advanced Settings”.
  • On the “Advanced Settings” window:
    • Change the value of “.NET Framework version” from “v2.0” to “v4.0”.
  • Change the value of “Enable 32-bit Applications” from “False” to “True”.
  • And then click “OK”.

BTARN-App-Pool-correct-Settings

Advice: you should do the same for the “BTARNHttpReceivePool” application pool

After I fix these configurations I was able to successfully receive the PIP message from my external Partner.

Credits to LemMotlo – BTARN App Pool Settings for BizTalk 2010

Last week while trying to generate from Visual Studio 2013 a schema of a custom SAP IDOC by:

  • Right-click your BizTalk Server project, and then choose “Add | Add Generated Items | Consume Adapter Service”.
  • In the “Consume Adapter Service” Add-in screen, select the sap adapter binding.
  • You should set the connection URI to SAP server and after that click “Connect
  • From the “Select contract type” drop-down list, select “Service (Inbound operations)” option
  • In the “Select a category” box, expand the IDOC node and select the IDOC that you want to retrieve, to see the IDOC message types in the “Available categories and operations” box.
  • From the “Available categories and operations”, add the “Receive” operation to the "Added categories and operations" by selecting the operation and click the “Add” button
  • And finally click “Ok” to generate the IDOC SAP schema

I got the following error:

“Error while retrieving or generating the WSDL. Adapter message: Details: ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=SEGMENT_UNKNOWN. AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: IDOCTYPE_READ_COMPLETE..

Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=SEGMENT_UNKNOWN. AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: IDOCTYPE_READ_COMPLETE..”

Server stack trace:

at Microsoft.Adapters.SAP.RFCException.HelperThrow(Int32 retCode, String additionalErrorMessage)
at Microsoft.Adapters.SAP.RfcOutboundInvoker.Invoke()
at Microsoft.Adapters.SAP.InternalIdocMetadata..ctor(String idocType, String cimType, String release, String version, MetadataLookup metadataLookup, SAPConnection sapConnection, TimeoutHelper timeoutHelper)
at Microsoft.Adapters.SAP.SAPMetadataContract.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection& extraTypeMetadataResolved)
at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout)
at Microsoft.Adapters.SAP.SapIdocMetadata..ctor(String absName, String idocType, String cimType, String release, String version, SAPConnection sapConnection, Boolean generateFlatFileCompatibleIdocSchema, Boolean segmentTypeInFlatFileAnnotation, MetadataLookup metadataLookup, TimeoutHelper timeoutHelper)
at Microsoft.Adapters.SAP.SAPMetadataContract.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection& extraTypeMetadataResolved)
at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout)
at Microsoft.Adapters.SAP.IdocOperationMetadata.ExportXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timespan, OperationParameterDirection direction)
at Microsoft.Adapters.SAP.IdocOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timespan)
at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper)
at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper helper, MetadataRetrievalNode[] nodes, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout)
at Microsoft.Adapters.SAP.SapCustomWsdlRetrieval.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup)
at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataMessage(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup, Message& replyMessage)
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.ServiceModel.Channels.IMetadataRetrievalContract.GetMetadata(MetadataRetrievalNode[] nodes)
at Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.MetadataPanel.GetWsdl(MetadataRetrievalNode[] nodes)
at Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.MetadataUserControl.GetWsdl()

BizTalk-Generating-SAP-schema-Error-while-retrieving-generating-WSDL

CAUSE

The SAP adapter uses the IDOCTYPE_READ_COMPLETE RFC to retrieve the metadata for the Receive operation for an IDOC. Invoking this RFC requires specific user permissions in the SAP system. To generate metadata, if you have connected to the SAP system using a credential that does not have permission to invoke the IDOCTYPE_READ_COMPLETE RFC, the SAP adapter gives an error.

So in order to demystify problems you should:

  • Make sure that your connection URI are well set
  • And you should try to import a schema from a standard IDOC, like INVOIC01, STATUS or ORDER01

If you are unable to import the schemas then you have a different problem from what I’m addressing here and you probably need to contact your SAP team to try to diagnose the problem, it probably may be lack of permissions. But normally in this cases you will receive a:

  • SapErrorMessage= OBJECT_UNKNOWN.

In my case I was able to import all the standard IDOC from SAP, however as I stated before I was trying to import the schema from a custom SAP IDOC created by my customer and I got instead a:

  • SapErrorMessage=SEGMENT_UNKNOWN

Which means, that while importing the IDOCTYPE_READ_COMPLETE RFC was not properly identifying some segments of the IDOC.

After validating with my SAP team we realize that some segments were not in the state “released” in SAP, this may not be the correct SAP interface logic but just to give you an idea here are some SAP print screens:

SAP-Set-release-custom-segment

Note: that all custom segments used in the IDOC must be released in SAP before you can import and use them in BizTalk Server.

SOLUTION

Well the only solution is to contact you SAP team and they must be sure that all segments of the IDOC that you are trying to import are released correctly.

Unfortunately we don’t have the segment information in question, but more likely it is some custom segment that they created.

After many requests and many postponements, due to my unavailability and free time to take these tasks, BizTalk Scheduled Task Adapter is finally officially available (version 5.0) and optimized for BizTalk Server 2013 R2!

You can download this new version of the adapter in BizTalk Scheduled Task Adapter CodePlex project page:

The BizTalk Scheduled Task Adapter is an in-process receive adapter that executes a prescribed task on a daily, weekly or monthly schedule. The adapter is configured entirely within BizTalk, all configurations is stored within the SSODB and can be exported and imported via binding files.
The schedule capabilities are similar to those available with the Windows Scheduled Task Service.

In this new version and despite additional custom tasks can be created and I’m planning on adding more, we still have the same four simple tasks present in previous editions:

  • XmlStringStreamProvider – generates a BizTalk message from a configured Xml string
  • FileStreamProvider – generates a BizTalk message from the contents of a file
  • HttpDownload – generates a BizTalk message from data downloaded from a web site
  • SQLStreamProvider – generates a BizTalk message from the contents of a SQL Query (similar to the old SQL adapter)

 

BizTalk Scheduled Task Adapter Release 5.0 for BizTalk Server 2013 R2

Requirements

The Scheduled Task Adapter v5.0 is optimized and designed to be used with BizTalk Server 2013 R2 (Compiled in .NET Framework 4.5).

V5.0 Change log

  • Compiled in Visual Studio 2013 and .NET Framework 4.5.
  • Optimized for BizTalk Server 2013 R2.
  • Support for 32 and 64 bit Host Instances.
  • Bug fixes
    • Bug: Issues multiple messages for timespan with more than 60 seconds – Solved

BizTalk-Server-2013-R2-BizTalk-Scheduled-Task-Adapter-v5.0-timespan

    • Bug: XmlStringStreamProvider task page properties not showing XML Text Editor Box – Solved
    • Bug: FileStreamProvider task page properties not showing Open File Dialog Box – Solved
    • Bug: SQLStreamProvider task page properties not showing Data Link properties Box to easy configure the SQL Connection string – Solved
    • Bug: Find task window showing all task components disabled – Solved
  • Improvements
    • SQLStreamProvider task now enables you to define SQL Timeout property – credits to MACoronado
    • Tasks Properties are now better organized and with better descriptions

BizTalk-Server-2013-R2-BizTalk-Scheduled-Task-Adapter-v5.0

Release History

This adapter is available since BizTalk Server 2004.

  • Release 5.0: release in February 18 2015 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2013 R2. Compiled in .NET Framework 4.5
  • Release 4.0: release in June 12 2012 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2010. Compiled in .NET Framework 4.0
  • Release 3.0: release in Aug 10 2010 by Greg Forsythe, this adapter was tested to work on BizTalk Server 2009. Compiled in .NET Framework 2.0
  • Release 2.0: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 2.0
  • Release 1.02: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2004, BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 1.1

 

Download

You can download this new version of the adapter in BizTalk Scheduled Task Adapter CodePlex project page:

A few days ago I wrote a post about these same warning messages from WCF-SAP Adapter: The adapter "WCF-SAP" raised an error message. Details "System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel cannot be used for communication because it is in the Faulted state.

The adapter "WCF-SAP" raised an error message. Details "Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_INVALID_HANDLE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest..

The adapter "WCF-SAP" raised an error message. Details "The WCF service host at address "sap://CLIENT=[SAPClientID];LANG=[LANG];@A/[SAPServer]/[SystemID]?ListenerGwServ=[GWServer]&ListenerGwHost=[GwHost]&ListenerProgramId=[ProgID]&RfcSdkTrace=True&AbapDebug=False" has faulted and as a result no more messages can be received on the corresponding receive location. To fix the issue, BizTalk Server will automatically attempt to restart the service host."

The adapter "WCF-SAP" raised an error message. Details "System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1[System.ServiceModel.Channels.IReplyChannel], cannot be used for communication because it is in the Faulted state.

I told at the time that this are generic error messages and does not provide what is really the problem.

These warnings occurs, normally, when BizTalk is trying to connect to a SAP system to receive the IDOC and, again, most of the times these are related with connectivity issue or permissions between BizTalk and SAP.

CAUSE

Normally, the reason for these warnings could be any of the following options:

  • There may be a problem with the SAP system.
  • Maybe BizTalk Server don’t have the proper authorization to connect with that particular SAP program id
    • Check my previous post here
  • Also some times is a configuration problem in the Receive Location in your BizTalk Server

There are some options for you to try to find more details about this warnings:

  • You can use external tools, like Wireshark, to dig deep into network traffic and inspect individual packets for clues
  • You may enable the RfcSdkTrace in the WCF-SAP port configuration to be able to see all the traces.
  • Or another useful option is to setup WCF tracing to see the underlying error.

But what I realized today is that sometimes this warnings may occur and none of the assumptions described above fit into the actual problem.

While I was migrating and configuring one BizTalk solution, I forgot to start the incoming IDOC subscriber (in this case an orchestration) which caused my messages to stay Suspended in a Non-resumable way, raising a “no subscribers were found” error

The Messaging engine failed to process a message submitted by adapter:WCF-SAP Source URL: sap://CLIENT=[SAPClientID];LANG=[LANG];@A/[SAPServer]/[SystemID]?ListenerGwServ=[GWServer]&ListenerGwHost=[GwHost]&ListenerProgramId=[ProgID]&RfcSdkTrace=True&AbapDebug=False. Details: The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.

And as you can see in the print screen bellow this error will generate also the appearance of the WCF-SAP warnings in the event viewer… although there is no problem in connectivity between BizTalk and SAP, and all the messages (IDOC) are being received and reached BizTalk

BizTalk-Server-2013-R2-WCF-SAP-Warnings-Event-Viewer-why

SOLUTION

In this particular case the solution is really simple, just create, or set correctly, one subscribe (Orchestration or send port with a filter) for the incoming IDOCs.

Is nothing new that in the last weeks I been busy performing BizTalk projects migrations from BizTalk Server 2006 R2 to 2013 R2 and, unintentionally, it seems that I can pick up and detect all the “bugs”, problems or limitations that you might imagine… or not. The good news is that I have several topics to write about it in my blog, as you may have noticed by my recent posts.

As a BizTalk Developer when you create a new BizTalk Solution, or open an existing one, you are used to have the BizTalk solution deploy option, of course in your development environment, which will allow you to easily deploy the entire BizTalk Solution directly from Visual Studio to your BizTalk Server runtime:

BizTalk-Server-2013-R2-Visual-Studio-2013-Deploy-Solution

During these weeks I notice that when I migrated an old BizTalk Solution from Visual Studio 2005 (BizTalk Server 2006 R2 Solution) to Visual Studio 2013 (BizTalk Server 2013 R2 Solution), I will soon talk about this topic in my blog – project migration, I realized that the “Deploy Solution” option did not appear in the context menu of my Visual Studio Solution:

BizTalk-Server-2013-R2-Visual-Studio-2013-without-Deploy-Solution

CAUSE

Visual Studio allow you to store different configurations of solution and project properties to use in different kinds of builds. To create, select, modify, or delete a configuration, you can use the Configuration Manager option present in the solution context menu.

A solution configuration specifies how projects in the solution are to be built and deployed. And by default when you create a new BizTalk Solution, or add a new BizTalk project to an existent solution, the “Build” and “Deploy” options are selected for the new project.

BizTalk-Server-2013-R2-Visual-Studio-2013-solution-configuration

However, sometimes when we update (migrate) an old Visual Studio Solution to a newer one, in this case Visual Studio 2005 to Visual Studio 2013, some of this configurations may disappear, or may not be present. The curious thing is that:

  • if the “Build” option is not select in the solution configuration, the “Build Solution” option continues to appear in the solution context menu, but it does do anything;
  • But if the “Deploy” option is not select in the solution configuration, the “Deploy Solution” doesn’t appear in the solution context menu;

BizTalk-Server-2013-R2-Visual-Studio-2013-solution-Configuration-Manager

SOLUTION

To solve this problem you must select the Deploy option in your solution configuration, for that you must:

  • In Visual Studio, right-click in your BizTalk Solution and select “Configuration Manager…” option from the context menu

BizTalk-Server-2013-R2-Visual-Studio-2013-solution-Configuration-Manager-option

  • On the “Configuration Manager” window, in the “Project contexts” pane, for every project, select the Configuration and Platform you want, and select whether to Build it and whether to Deploy it.
    • In this case make sure that “Deploy” is selected

BizTalk-Server-2013-R2-Visual-Studio-2013-solution-Configuration-Manager-deploy-option

Right-click in your BizTalk Solution and the “Deploy Solution” will now be available.

BizTalk-Server-2013-R2-Visual-Studio-2013-Deploy-Solution-final

In the last few weeks I have been playing around with WCF-SAP adapter, I have many thing to write about it in terms of installation, configuration, communication and so on but I will start with this topic/problem.

While trying to create a WCF-SAP Receive port to be able to listener incoming IDOC from SAP system and despite the receive location be and stay enable in the BizTalk Administration Console I soon realized that the documents were not being picked up by BizTalk.

When I consulted the Event Viewer to check if there were additional information about the causes that were happening I found this three warning messages:

“The adapter "WCF-SAP" raised an error message. Details "System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1[System.ServiceModel.Channels.IReplyChannel], cannot be used for communication because it is in the Faulted state.
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Close()
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.Close()".

“The adapter "WCF-SAP" raised an error message. Details "The WCF service host at address "sap://CLIENT=[SAPClientID];LANG=[LANG];@A/[SAPServer]/[SystemID]?ListenerGwServ=[GWServer]&ListenerGwHost=[GwHost]&ListenerProgramId=[ProgID]&RfcSdkTrace=True&AbapDebug=False" has faulted and as a result no more messages can be received on the corresponding receive location. To fix the issue, BizTalk Server will automatically attempt to restart the service host."

“The adapter "WCF-SAP" raised an error message. Details "Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_FAILURE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest..
at Microsoft.ServiceModel.Channels.Common.Design.AdapterAsyncResult.End()
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& requestContext)
at Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1.
System.ServiceModel.Channels.IReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& context)
at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)”

BizTalk-WCF-SAP-Adapter-Event-Viewer-warnings

CAUSE

Well. unfortunately this errors are generic error messages and does not provide what is really the problem.

So my advice is to first check all the port configurations for any possible configuration mistakes. After that you should use external network tools that let you dig deep into network traffic and inspect individual packets, for example Wireshark.

On this particular case I found that the BizTalk Server didn’t have the proper authorization to connect with that particular SAP program id:

ERR*.1.registration of tp [PROGRAM ID] from host [BIZTALK SERVER] not allowed.720.SAP-Gateway.721.2.gwxxrd.c.3644..Thu Feb  5 18:46:11 2015….33844.SAP-Gateway on host [SAP SERVER] / [GWServer]…..*ERR*.

BizTalk-WCF-SAP-Adapter-wireshark-monitoring

SOLUTION

Unfortunately, I’m not a SAP expert and I don’t know exactly what to do in SAP, what I can tell you is that there is nothing wrong in your configuration, this is not a BizTalk problem Smile. What I could see in one of the SAP tools was that BizTalk was trying to connect but it was straight away disconnected.

So to solve this problem you must contact your SAP team to proper configure the access. Once is done everything will work fine, at least in this case it solved my problems.