Tuesday, March 6, 2012

SAP calling RFC hosted in BizTalk

If you have been following this blog you have most likely encountered a few blog posts related to SAP integration.  I also wrote two chapters related to SAP integration in a BizTalk book last year.  In all of the journeys that I have taken with SAP, not once have I encountered a situation were I needed to receive a request from SAP that required a synchronous response.  All of my previous experience required asynchronous messaging with SAP when receiving data from SAP.  We now have a scenario that requires SAP to send BizTalk a “fetch” request and BizTalk needs to provide this information in near real-time.  What was very interesting about this scenario many people within our organization didn’t think, or know it was possible.  I guess it was tough for some to wrap their head around the concept of SAP actually needing information from another system since it tends to be a System of Record.

SAPRFC.INI HUH???

A good starting point for this scenario is in the MSDN documentation.  Initially I thought it would be pretty straight forward and would resemble a situation where BizTalk receives an IDOC.  That was until I received an error similar to the one below indicating that an saprfc.ini file could not be found when enabling the SAP Receive Location.

Log Name:      Application
Source:        BizTalk Server
Date:          3/6/2012 7:12:53 PM
Event ID:      5644
Task Category: BizTalk Server
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      SERVER

Description:
The Messaging Engine failed to add a receive location "Receive Location2" with URL "sap://CLIENT=010;LANG=EN;@a/SAPSERVER/00?ListenerDest=ZRFCADD&ListenerGwServ=sapgw00&ListenerGwHost=SAPHOST&ListenerProgramId=Biztalk_Z_Add&RfcSdkTrace=False&AbapDebug=False" to the adapter "WCF-SAP". Reason: "Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_OK. ErrorGroup=RFC_ERROR_SYSTEM_FAILURE. SapErrorMessage=Open file 'C:\SAPINI\saprfc.ini' failed: 'No such file or directory'.  AdapterErrorMessage=Error accepting incoming connection. RfcAccept returned RFC_HANDLE_NULL..
 

This really confused me since I could successfully connect to SAP and receive IDOCs.  After some digging, I discovered the following webpage that indicated: “The RFC library will read the saprfc.ini file to find out the connection type and all RFC-specific parameters needed to connect to an SAP system, or to register an RFC server program at an SAP gateway and wait for RFC calls from any SAP system.”

So how do we solve this?

  • The first thing that we need to do is to create a System Variable called RFC_INI.  We then need to provide a path and a filename.  For the purpose of my example I used C:\SAPINI\saprfc.ini.

image

  • Next we need to add the contents to our saprfc.ini file.  The values that I needed to provide include:
Field name Value  
DEST ZRFCADD In this case, this is the name of the RFC Destination that our BASIS team created for us from SM59.  More details here.
TYPE R Type R is for RFC server programs or for a client program working with another external program as RFC server program which is already registered at an SAP gateway.
GWHOST SAP_HOST_NAME In my case, this is the name of the physical server that his hosting the SAP Gateway.
GWSERVER SAP_GATEWAY_NAME The name of the SAP Gateway.  A standard naming convention is: SAPGW## where ## is the system number for the SAP instance that you are working on.
PROGID Biztalk_Z_Add This is the name of the Program ID that has also been provided by BASIS.

 

So if we compare the details between our Receive Location and our saprfc.ini we will see symmetry between the two.  However, the values in the ini file take precedence.

image

  • Now that we have have our SAPRFC.ini file and SAP Receive location in order we can run a connected client test using SM59.  To perform this test, launch the SM59 transaction and then expand the TCP/IP Connections node.

image

  • Scroll through the list to find your RFC Destination.  In my case, I am looking for ZRFCADD.  Double click on this value.

image

  • Click on the Connection Test button to execute the test.

image

  • You should see a successful Connection Test.  If not, there is no point trying to call your RFC from SAP until you get this connection issue resolved.  If SAP can’t perform this “ping test” it won’t be able to actually send you data.  To troubleshoot this you will need to ensure that the values that you have in your receive location/ini file match the values that are defined in SM59.  In most cases you will need to rely upon your BASIS Buddy to help you out.  As I mentioned in my book, I do have a good BASIS buddy so this troubleshooting usually goes smoothly.

image

  • With our connectivity issues out of the way, we can browse for our desired schemas using the BizTalk Consume Adapter Service Wizard and then add them to our solution.

image

  • We can now build out the rest of our application.  In my case I have a very simple map that will add two values that occur in the request message and provide the sum in the response message.

image

  • The only special consideration that we need to take care of is to set the WCF.Action in the Response message.  We can do this inside a Message Assignment shape.  If you don’t take care of this, you will receive a run time error.

sapResponse(WCF.Action) = "http://Microsoft.LobServices.Sap/2007/03/Rfc/ZISU_RFC_ADD/response";

We now are in a position to deploy our application and start receiving requests from SAP.

Conclusion

Overall the process was pretty similar to receiving IDOCs with the exception of the INI file and the WCF Action property requiring being populated.  Performance is similar to receiving or sending IDOCs so you won’t take any additional performance hits.

Monday, March 5, 2012

New BizTalk Book Announced - (MCTS): Microsoft BizTalk Server 2010 (70-595) Certification Guide

Today I found out that the latest book that I have been contributing to is now available for pre-order.  I got involved with this project right around the time that my  last book was published.  Our editor on that book offered us the opportunity to work on this book.  Johan Hedberg, the lead author, was also extended this opportunity.  So after a moment of weakness, and perhaps a few beers on a boat ride in Stockholm, I agreed to get involved in this book as well.  Joining us on this adventure is Morten la Cour who lives in Denmark and also has a vast amount of BizTalk experience.

The book is a preparation guide for the latest BizTalk Server 2010 Certification.  In this book you will be provided with practical examples of the skills that will be measured on this exam.  In our book we do cover each of the areas that will be tested including:

  • Configuring a Messaging Architecture
  • Developing BizTalk Artifacts
  • Debugging and Exception Handling
  • Integrating Web Services and Windows Communication Foundation (WCF) Services
  • Implementing Extended Capabilities
  • Deploying, Tracking, and Supporting a BizTalk Solution

We also include valuable sample questions at the end of each chapter and also include an entire chapter at the end of the book that should provide you with a good gauge as to whether or not you are ready to write the test.  This book is not a brain dump.  If you are looking for any easy way out you won’t find it here.  But if you already have a good base of BizTalk knowledge and are willing to put in the effort to really understand the content in this book, I am confident that you will do well on the exam.

I would also like to extend thanks to the technical reviewers that have spent hours reviewing our content which without a doubt has increased the quality of the book.  Our reviewers include:

  • Steef-Jan Wiggers
  • Mikael Hakansson
  • Jan Eliasen
  • Genuine Basil

The anticipated publish date is in May, 2012.  In the mean time, you can read more about our book on the Packt website :  http://www.packtpub.com/mcts-microsoft-biztalk-server-2010-certification-guide/book

 

4927EN_mockupcover_normal

Thursday, December 8, 2011

BizTalk Server 2010 R2 Announced

In a previous post, I discussed Microsoft’s integration road map particularly related to Microsoft BizTalk Server.  The foundation of that post was based upon Tony Meleg’s presentation from the World Partner Conference.  The good news is that today, Microsoft has given us a glimpse into what is to come with respect to BizTalk Server.  Previously, Tony cautioned us that Microsoft will continue to support BizTalk and will introduce incremental changes to the platform.  Where as most of the innovation will occur in the Azure AppFabric space.

The next version of BizTalk Server is currently called BizTalk Server 2010 R2.  I suspect they are calling this an “R2” release since it is an evolutionary release that particularly focuses on platform alignment with Windows Server 8, SQL Server 12 and Visual Studio 11.  For those of you who do follow the BizTalk scene closely you may recall that BizTalk Server 2010 was originally called BizTalk Server 2009 R2 when it was in beta.  It was renamed to BizTalk Server 2010 prior to RTM.  So who knows if the BizTalk 2010 R2 name will stick but for now that is the name we will go with.

In addition to the platform alignment that I have already mentioned, we can look forward to some new features in the areas of:

  • Adapter connectivity to new data sources including IBM Informix V11 and IBM IMS/DB V11
  • Updates to industry schemas like HIPPA, HL7, SWIFT and SWIFTNet
  • Improved Performance and Scalability
  • Tighter integration with the Azure Service Bus
  • Adjustment to licensing geared towards cloud hosting

Of the features mentioned, I certainly will not complain about improved performance and am happy to see tighter integration with Azure AppFabric.  I really hope that they introduce a smoother way of integrating with Azure AppFabric Queues and Subscriptions.

I am a little disappointed that there was no mention of fully supported REST endpoints, but it is early so I am hoping that Microsoft will surprise us with that feature.

I have only touched on some of the new features that will be available.  You can find the complete post from Microsoft here.

Saturday, October 1, 2011

BizTalk: Adding BizTalk 360 to your Environment

For those that are not familiar with BizTalk 360, it is a Rich Internet Application (RIA) that allows you to monitor and maintain your BizTalk environment via a Web browser.  From what I can see, from a high level, there are a few components that you install in your BizTalk environment that make up the solution:

  • Silverlight Application which can be accessed via a remote web browser
  • WCF Service(s) that expose the operations to the Silverlight application
  • A Windows Service that handles some of the monitoring and notification features
  • A BizTalk 360 database that will store your configuration and audit/governance

My organization recently purchased a license and support from BizTalk 360.  In this blog post I plan on explaining some of the rational and features that influenced our decision.

Requirements

Over the past 5 years our BizTalk environment continues to grow.  With this growth comes more responsibility maintaining it.  Our current middleware team consists of both developers and administrators and therefore there is an on-call rotation that is used to handle the after hours support.  After hours support requirements are very binary; BizTalk’s infrastructure is either on or off.  This would include the core components like SQL Server, SSO, Host instances and applications being online.  We are not concerned if a single message is suspended.  The reason?  There is no one from the business available to consult with in order to correctly determine a resolution to the problem.

Also, in parts of Canada the IT Market is getting hot.  Let’s face it there is nothing fun, or cool about being on-call. Even though our environment is very stable, people felt that they were still tied down to their cell phone since we have Service Availability metrics to meet and when an issue occurs response time is very important.  As all BizTalk resources know, BizTalk doesn’t have to be down to get roped into “fire fighting” triage sessions.  Sometimes your large ERP or engineering systems go down and since BizTalk connects into them you are impacted as well. 

The company that I work for is very committed to employee retention and reducing the amount of on-call is a step in the right direction for reducing turnover and keeping employee morale high.

Solution

I know Saravana from the MVP program and at the last MVP Summit Saravana was showing MVPs and some of the BizTalk Product Group an early preview of what is now BizTalk 360.  My initial thoughts included what a nice looking application and some of the features fill a void left by the BizTalk Admin Console but I wasn’t convinced that I had an immediate use for it. 

While I was in Sweden in June, with Richard Seroter,  promoting the book I contributed to, I ran into Saravana again and checked out the progress his start-up made on the product.  Once again I was impressed with the tool but wasn’t sure how I would use it.

Come July and some more concerns about the on-call situation arose and this turned on a light bulb in my head about how we could use BizTalk 360 to help support our environment after hours.  We already have contracted resources that focus on after-hours support for our core infrastructure: Servers, SAN, Network etc.  I thought what if I could piggy back on this existing agreement?  Knowing that I didn’t need BizTalk Experts to keep an eye on my servers after hours, remember the type of service I am looking for is binary: on or off.  BizTalk 360 provides this visibility in a couple ways:

  • Dashboard – By looking at this type of screen if is very obvious which artifacts are up and which are down.  Enabling these artifacts is a pretty easy action to perform so I don’t need to pay to have BizTalk Experts monitoring after hours.

Portal

 

  • Notifications – My company also uses SCOM for monitoring BizTalk and we will continue to do so even with BizTalk 360.  But the feature that I like about BizTalk 360 is the Health Summary email notification that you can configure.  I can now subscribe this after hours team to periodic notifications where they can quickly, and easily, determine the health of the environment.  I don’t want these people logged onto my BizTalk servers hitting F5 all night inside of the BizTalk Admin Console.  Using these email notifications frees them up to work on other things but also provides the visibility that we need.

(Sample email notification – note I have added the black marks to retain some privacy)

    EmailNotification
    Another area that is important to me is the Audit and Governance features that exist.  When trusting a 3rd party to provide support it is very nice to have an audit of what actions took place during support periods.  It protects both the client and the service provider and is a win-win all around.  This is a feature that has been missing from the BizTalk Admin Console that could benefit many organizations.

Overall the process of procuring the BizTalk 360 application has been very positive.  When I first tested out the product there were a few features missing that I really wanted.  Saravana took the time to review them over a Live Meeting, took my high priority needs and was able to provide me with a build on a committed timeline.  Some of my feature requests involve clustered host instances so if you use clustered host instances in your environment – you are welcome!

The BizTalk 360 team is very committed to the product and their customers.  It has been refreshing to work with a company that is so motivated.

Conclusion

Something that I have learned through this process is to always keep your eyes open to new trends and tools.  I find Twitter really helps in this regard by following likeminded individuals.  You don’t need to deep dive on every new technology that you see but it is important to know that it exists as you never know when your requirements may change and you can benefit from it.  Case in point my situation that emerged this past summer.

Friday, August 26, 2011

BizTalk: /n Software Read Only (S)FTP Locations

Another /n Software feature that I recently learned about involves Read Only FTP locations.  The idea behind this feature is the the source system does not want you to remove the file once it has been downloaded.  This could be for a variety of reasons including the file may be available to multiple consumers or the source system would like to archive the file once it has been consumed.

Read only FTP locations is a new supported scenario with BizTalk 2010.  /n Software has supported this scenario for at least a few years.  You can enable this feature by simply specifying the Delete Mode as Never on a Receive Location that is using the /n Software adapter.

image

So this is all very intriguing,  I am sure,  but it is pretty obvious so why does this deserve a blog post?  The reason for the blog post is to discuss a lesser known property called DownloadCacheFile. After scanning your receive location you will discover that this property is not visible.  This property is exposed through the Other property.  Within this property we can specify DownloadCacheFile=c:\myCacheFile.txt

image

As files are processed they will be added to this file and a record is kept so that they are not downloaded in subsequent polls of the (S)FTP location.

image

In the BizTalk 2010 implementation, Microsoft is using a database to store this type of information where as /n Software has chosen the file route.  Time will tell how well this feature works.  I would imagine that there is an upper limit where the file becomes so large that it slows performance or potentially corrupts.

Also note that if you are using a Clustered host instance to host your FTP Receive locations, this file should be in a shared storage location so that the Clustered host instance has access to it no matter which Server it is actively running on.

BizTalk: Configuring /n Software’s SFTP Adapter for Public/Private Key Security

I was recently involved in a project that required secure FTP connectivity between my organization and a partner organization.  We continue to leverage /n Software’s SFTP adapter as we are still running BizTalk 2009 in production and we also find that our partners tend to leverage Secure FTP using SSH (SFTP) as opposed to FTP over SSL (FTPS).  BizTalk 2010 now includes an FTP adapter that supports SSL so we are likely to continue to use the /n Software adapter based upon SSH requirements even once we upgrade to BizTalk 2010.

I am very far from being a Security/Certificate expert so I did learn a few things being involved in this project.  Hopefully if you have Secure FTP requirements that you will find this post helpful.

 

Generating Public and Private Keys

In my scenario, our trading partner required us to provide them with our Public key.  They wanted us to generate Private and Public keys.  They would then take our public key and install it in their SFTP server.  To generate these keys I simply used GlobalScape’s CuteFTP 8.3 Professional.

Note: Your mileage may vary here.  There are some requirements that were enforced by our Trading partner including the Key type and the number of bits required for encryption.

1. Click on Tools -> Global Options

image

2. Click on Create identity file

image

3. Use DSA

image

4. Provide a Passphrase

image

5. Enter a location for files to be generated and ensure the key length is set to 1024

image

Configuring BizTalk Receive Location

Since the Receive Location configuration is a little lengthy I am going to break it down into the various sections.

SFTP

Pretty basic settings here dealing with when we want to Delete, what file masks we want to look for and the folder on the remote SFTP server that we want to navigate to once we have successfully established connectivity.

image

SSH

The first area to focus on in the SSH section is the SSH Accept Server Host Key.  When you set the Accept Any  to Yes the SSH Accept Server Host Key property will revert to Any.  I equate this action with when you try to connect to an SFTP server using a client like CuteFTP.  You will get prompted with a dialog asking if you would like to accept the public key being pushed from the SFTP server.  The way I understand how this works is that this public key will get validated against your private key.  Should everything match up you should be able to establish a connection.

image

The next property to focus on is the SSH AuthMode.  We want to set this value to be Public Key.  There are a few different options when it comes to setting the Authentication mode.  One includes setting a password but for this particular partner they wanted to use Public Key authentication.  When we set this value we then need to provide the location of our private key which happens to be called Identity (without a file extension).

image

To provide our Private key we need to click on the ellipse button.

 image

We will now be prompted with a dialog that allows us to select our Private key from a variety of sources.  In my scenario I wanted to select my key from the file system.  In order to do so I needed to select the PEM tab and then browse to my key.  Since I have enabled my key to use a password I need to provide a password and then I can click the Open button.  Once I did this my private key would appear in the TextArea box and I can click Ok.

image

The rest of the configuration deals with some connectivity details including the name of the FICTICOUS Host and a SSH User (a tribute to Steve Jobs who has recently stepped down from being Apple’s CEO) .  The SSH Port is using the default port of 22  and even though it appears as if I have provided a password that is the default mask provided by the adapter.

image

 

Conclusion

So as much as people love to talk about the cloud these days and using the Service Bus and WCF bindings, the bottom line is that companies continue to rely upon “legacy” technologies such as SFTP.  In my scenario, this trading partner is a very large institution so it is not as if they are a little “Mom and Pop” shop. 

Thursday, August 25, 2011

BizTalk 2010 Training Kits now available

Both Developer and Administrator Training Kits have been recently released.  Inside of these training kit you can expect functional Virtual Machines, with the BizTalk software installed, training module documents and PowerPoint presentations.  This is the content that you would typically find in a Microsoft Official Curriculum course.  The best part about these kits is they are made available for free.

I had the opportunity to collaborate with Jerry Anderson from Pluralsight on the Administration course.  My contributions primarily focused on Module 6: Monitoring a BizTalk Environment with System Center Operations Manager (SCOM).

The BizTalk 2010 Developer Training Kit was released back in July and is available here.  The Administration course was released on August 21 and can be found here.

Enjoy!!!