从 Cobol 程序调用 C 函数

发布于 2024-12-08 16:15:22 字数 212 浏览 1 评论 0原文

我们有一个共享库,它的功能是 Web 服务客户端。该客户端是使用 gsoap 创建的,旧版进步 4GL 应用程序使用该客户端来使用加密 Web 服务。

现在有人问我,同样的机制是否适用于用 Cobol 编写的其他遗留系统。

那么,如果我有这个共享库,Cobol 程序可以调用该库中的函数吗?

如果可能的话,有人可以分享参考文档的示例吗?

We have a Shared library that has a function that is a web service client. The client was created with gsoap and this client is used by legacy progress 4GL applications to consume an encryption web service.

Now I have been asked if this same mechanism is possible with other legacy systems written in Cobol.

So, if I have this Shared library, can a function from this library be called by a Cobol program?

If possible, can anyone please share an example of reference documentation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌入人心 2024-12-15 16:15:22

如果您使用的是 Micro Focus COBOL 产品,那么查看 C 示例,我希望您单独执行以下操作:

1) 对“soapH.h”执行 h2cpy 以获得“soaph.cpy”
2) 然后....

    01 ws-soap  soap.

    call "soap_init" using
         by reference ws-soap
    end-call


    call "soap_call_ns1__...." using
         by reference ws-soap
         by value omitted   *> endpoint address
         by value omitted   *> soapAcition
        .... your parameters
    end-call

    if return-code not equals SOAP-OK
      call "soap_pint_fault" using
     else
        ...
    end-if

    call "soap_destroy" using
          by reference ws-soap
    end-call

    call "soap_end" using
          by reference ws-soap
    end-call

    call "soap_done" using
          by reference ws-soap
    end-call

If you were using a Micro Focus COBOL product, then looking at an C example, I would expect you do something alone the lines of:

1) do a h2cpy on "soapH.h" to get "soaph.cpy"
2) then....

    01 ws-soap  soap.

    call "soap_init" using
         by reference ws-soap
    end-call


    call "soap_call_ns1__...." using
         by reference ws-soap
         by value omitted   *> endpoint address
         by value omitted   *> soapAcition
        .... your parameters
    end-call

    if return-code not equals SOAP-OK
      call "soap_pint_fault" using
     else
        ...
    end-if

    call "soap_destroy" using
          by reference ws-soap
    end-call

    call "soap_end" using
          by reference ws-soap
    end-call

    call "soap_done" using
          by reference ws-soap
    end-call
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文