简体   繁体   English

将 URL 字符串映射到 ABAP 中的 RFC 目标的标准方法?

[英]Standard way to map a URL string to RFC Destination in ABAP?

In SAP (AS ABAP 7.4) I have configured a set of RFC Destinations (Transaction SM59), including an SSL configuration using a client certificate for authentication at the service.在 SAP (AS ABAP 7.4) 中,我配置了一组 RFC 目标(事务 SM59),包括使用客户端证书进行服务身份验证的 SSL 配置。

Say, one of these RFC Destinations goes to: myserver:443 and myserver requieres SSL client certificate authentication.比如说,这些 RFC 目标之一转到: myserver:443并且myserver需要 SSL 客户端证书身份验证。

In my ABAP class I am given an arbitrary URL such as https://myserver:443/my/ressouce.xml在我的 ABAP 课程中,我获得了一个任意 URL,例如https://myserver:443/my/ressouce.xml

I am using CL_HTTP_CLIENT to fetch the ressource, but as far as I can see, there is no way to initialize the HTTP client in a way that it uses the correct SSL client certificate, except passing the appropriate RFC Destination using CL_HTTP_CLIENT.CREATE_BY_DESTINATION我正在使用CL_HTTP_CLIENT来获取资源,但据我所知,除了使用CL_HTTP_CLIENT.CREATE_BY_DESTINATION传递适当的 RFC 目标之外,无法以使用正确的 SSL 客户端证书的方式初始化 HTTP 客户端

To achieve this, one can manually read/parse the SAPs RFCDST table and map the given URL to the correct RFC destination.为了实现这一点,可以手动读取/解析 SAPs RFCDST 表并将给定的 URL 映射到正确的 RFC 目标。

My question is if there is a better way in SAP (eg a standard SAP function) than this manual approach?我的问题是 SAP 中是否有比这种手动方法更好的方法(例如标准 SAP 功能)?

The only viable way appears to be:唯一可行的方法似乎是:

  • "Manually" select the destination names from RFCDES with RFCTYPE = IF_DEST_ROOT~CO_TYPE_HTTP_EXT “手动”从RFCDES选择目标名称, RFCTYPE = IF_DEST_ROOT~CO_TYPE_HTTP_EXT
  • Parse the settings of each destination using RFC_READ_HTTP_DESTINATION使用RFC_READ_HTTP_DESTINATION解析每个目的地的设置
  • Compare the values against the given URL - you will have to strip some part from either side, so that would have to be be custom code anyway.将这些值与给定的 URL 进行比较 - 您必须从任一侧剥离一些部分,因此无论如何都必须是自定义代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM