Skip to main content
September 7, 2023
Solved

WEBAPI through SIC ???

  • September 7, 2023
  • 5 replies
  • 0 views

Hi - Has anyone done WEBAPI through SIC ? I followed the document and I am not successful connecting to the endpoint. All I am trying to get the HTTP response. There are no issue from the firewall and thr port are open. We are able to successfully execute the endpoint from POSTMAN.

 

Any help would be appreciated.

 

Thanks

 

 

Best answer by Krishna

Jack - Here we go.

1. Created the Gateway in SIC.

2. Created the SIC rule for the webAPI

3. Calling the SIC rule from Extender rule.

The below is the Extender rule calling the SIC rule

Dim objGatewayDetails As GatewayDetails = _
    BRApi.Utilities.GetGatewayConnectionInfo(si, "sapapi")

brapi.ErrorLog.LogMessage(si, objGatewayDetails.RemoteGatewayHost)

Dim objRemoteRequestResultDto As RemoteRequestResultDto = _ 
    BRApi.Utilities.ExecRemoteGatewayBusinessRule(si, _
        "SAP_Call3", Nothing, objGatewayDetails.RemoteGatewayHost, "SAP_Call3")

'drqdbci.aoc-resins.com
If(objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.Success)

	'If (objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.RunOperationReturnObject)    
	brapi.ErrorLog.LogMessage(si, "PASS_1")

Else

	brapi.ErrorLog.LogMessage(si, "Status---" + objRemoteRequestResultDto.RemoteResultStatus.ToString + " and " + RemoteMessageResultType.RunOperationReturnObject.ToString + " and " + RemoteMessageResultType.HTTPError.ToString)

	brapi.ErrorLog.LogMessage(si, "AllSuccessValues----" & RemoteMessageResultType.AllSuccessValues)

	brapi.ErrorLog.LogMessage(si, "APIKeyInvalid----" & RemoteMessageResultType.APIKeyInvalid)

	brapi.ErrorLog.LogMessage(si, "RemoteEndPointProviderIsInvalid----" & RemoteMessageResultType.RemoteEndPointProviderIsInvalid)

	brapi.ErrorLog.LogMessage(si, "RemoteHost---" & objGatewayDetails.RemoteGatewayHost)

End If

 

 

5 replies

September 8, 2023

Can you provide a few more details, i.e. the code you're trying to execute, which endpoint you're trying to hit...?

KrishnaAuthorAnswer
September 8, 2023

Jack - Here we go.

1. Created the Gateway in SIC.

2. Created the SIC rule for the webAPI

3. Calling the SIC rule from Extender rule.

The below is the Extender rule calling the SIC rule

Dim objGatewayDetails As GatewayDetails = _
    BRApi.Utilities.GetGatewayConnectionInfo(si, "sapapi")

brapi.ErrorLog.LogMessage(si, objGatewayDetails.RemoteGatewayHost)

Dim objRemoteRequestResultDto As RemoteRequestResultDto = _ 
    BRApi.Utilities.ExecRemoteGatewayBusinessRule(si, _
        "SAP_Call3", Nothing, objGatewayDetails.RemoteGatewayHost, "SAP_Call3")

'drqdbci.aoc-resins.com
If(objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.Success)

	'If (objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.RunOperationReturnObject)    
	brapi.ErrorLog.LogMessage(si, "PASS_1")

Else

	brapi.ErrorLog.LogMessage(si, "Status---" + objRemoteRequestResultDto.RemoteResultStatus.ToString + " and " + RemoteMessageResultType.RunOperationReturnObject.ToString + " and " + RemoteMessageResultType.HTTPError.ToString)

	brapi.ErrorLog.LogMessage(si, "AllSuccessValues----" & RemoteMessageResultType.AllSuccessValues)

	brapi.ErrorLog.LogMessage(si, "APIKeyInvalid----" & RemoteMessageResultType.APIKeyInvalid)

	brapi.ErrorLog.LogMessage(si, "RemoteEndPointProviderIsInvalid----" & RemoteMessageResultType.RemoteEndPointProviderIsInvalid)

	brapi.ErrorLog.LogMessage(si, "RemoteHost---" & objGatewayDetails.RemoteGatewayHost)

End If

 

 

September 8, 2023

I think you need a Then at the end of line 11.

September 8, 2023

Hi Krishna  Did you first check the status of the SIC ? It is under SIC connector admin > Gateway Server > YourSICName and on the right window you will see the Version and Status. Is it online?

KrishnaAuthor
September 8, 2023

The Status is online.

Thanks Nicolas

KrishnaAuthor
September 12, 2023

I was able to fix it. In the BR I have to provide the localhost:PortNumber which was specified in the SIC configuration screen. Once updated. It is working as expected.

February 13, 2024

Hi JackLacava,

While we setup the direct connection for WebAPI, what details we need to provide for Bound Port at Gateway and Remote Gateway Host & Bound Port in Onestream. Please refer the screen shot below:


sakshamsharma_0-1707826610296.png

Further, is there a way to encrypt the credentials for Web API (Without  BRAPI.Utilities.encrypt text)?

do we need to create a gateway to store the credentials?

 

 

February 13, 2024

Hi sakshamsharma ,
Bound port  Bound Port at Gateway, the port of the remote service this direct connection is associated with.
Bound Port in OneStream, the port number defined within OneStream that refers/maps to the specified direct connection.
Remote Gateway Host, you can put the same then Gateway Server
For the ports, try 20433 

Regarding the ID and password, you can store them on the gateway directly. Look page 45 of SIC guide and please read this guide 🙂


NicolasArgente_1-1707828051721.png


NicolasArgente_0-1707828042986.png

Thanks

February 16, 2024

Hi NicolasArgente,

We already have SIC database gateway connection, we would like to connect to SFTP via gateway connection. Do SFTP need to be hosted on the gateway machine? If SFTP server is available at external machine, how do we connect to the gateway in such scenario?

Since we already have a SIC database connection, do we need separate getaway direct connection for SFTP? 

Once SFTP connection is established where can we find Bound Port at Gateway, the port of the remote service this direct connection and Bound Port in OneStream? Could you please provide us a screenshot?

Thanks!

February 16, 2024

sakshamsharma OS connect to the client SFTP. OS needs Winscp dll. OS is the client, so nothing to install except those DLL.
You will need to add WinSCPnet.DLL to your business rule Referenced Assemblies from the Properties tab in the business rule.
Please read the SIC guide, you will even find the Business Rules there.