'How to integrate SOLMAN with my Rest API?

I am working on a project that requires SAP Solution Manager (SOLMAN) to be integrated with Azure Devops Rest API.

Functionality:

  1. Whenever a Work Package is created in SOLMAN, I want to take the generated JSON and create a Feature in Azure Devops.
  2. Once the Feature is created in Azure Devops, I want to return back id of the Feature as EXTERNAL_ID to SOLMAN.

I have created an API and Deployed it to PCF. When I am hitting the api endpoint, the work item gets created in Azure devops.

But when I create an RFC giving the details about target host and url, I am getting an error like this(in SAP thingy, ABAP debugger or something):

A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException

In PCF logs, I am able to see this error(in PCF logs):

Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware Failed to determine the https port for redirect.

It looks like I am doing something wrong. My Rest API does not have an Auth Mechanism - I think this could be the missing link. Or May be I have to use a specific port for HTTPS. I am stuck here.

Can any one help me or share experience about this?



Solution 1:[1]

I managed to finally integrate SAP Solution Manager with Azure Devops. Since I have got the solution and the integration is working, I am writing this answer.

When I look back to the question which I am answering now, it looks like I did not properly explain my scenario and I asked a technical question. I will properly explain what I was trying to do in the later part of this answer,but for that particular problem:

A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException

Problem: I was trying to call SOLMAN External API from my .NET CORE 3.1 Web API, upon calling the SOLMAN api I was getting the aforementioned error.

Cause : SOLMAN API expects any external tool or service(api) to :

  • Have a basic authentication in place
  • Communicate over HTTPS rather than HTTP

Solution:

The solution of this problem has two parts -

1. Adding Username and Password in authentication header with the request.

Ideally you will have some kind of authentication scheme for your API. If not, then you would need one. You will have to add Authorization field in header with the user name and password. This way, you will not get any authentication error like 401 or 403.

2. Check if your API is communicating over HTTPS.

I wrote my API in .NET Core 3.1 and in .NET Core we can use HTTPSRedirection Middleware to ensure the API communicates over HTTPS. If any HTTP request comes, it redirects to HTTPS. This way you get the HTTPS communication going.

In my case I deployed my API to cloud server, which was already providing HTTPS by default and I also added the HTTPSRedirection Middleware in my API. But I started getting the error :

A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException

So I removed the middleware and it started working.

Now, that I have got that out of the way, I can explain more about what I was trying to do. I wanted to sync Work Items/ Work Packages created in SAP Solution Manager with Azure Devops backlog/board. Following were the requirements:

  • Whenever a Work Package is created in SAP Solution Manager, a Feature must be created in Azure Devops.
  • Whenever a Work Item is created in SAP Solution Manager, a User Story must be created in Azure Devops.
  • Whenever a Work Item / Work Package is updated in SAP Solution Manager, the corresponding Feature / User Story must be update.
  • Whenever status is changed in Azure Devops of any Feature/User Story, that status must be updated in corresponding Work Item/ Work Package in SAP Solution Manager.

For this requirement, I created a Web API which works in the middle of these two tools (Azure Devops and Sap Solution Manager) and establish a connection between these two. This API does following tasks :

  • Takes JSON payload recieved from Sap Solution Manager using RFC and convert that response to appropriate response required by Azure Devops.
  • Create / Update / Delete Work Items in Azure Devops
  • Takes JSON response received from Azure Devops and convert that to appropriate response required by Sap Solution Manager.

So, this API acts as a connector for these two tools. One of the comment on the question by @Jeff pointed out for a Commercial Off the shelf product as well, which could be a good alternative for this problem if you have it. But I do not know how that works since for me procuring a new Software for this wasn't possible.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pranshu Jawade