我使用的是AS400,有人要求我从绿色屏幕调用Web服务。
如何做到这一点?
任何示例COBOL或CL代码都将非常有帮助。
最佳答案
我在RPGLE中编写了一些“中间件”来调用Web服务(SOAP)并处理返回的XML数据。简而言之,这是该过程:
1) Open a socket to the web service
2) Build the XML "payload"
3) Transmit the SOAP request (wrap the payload in a SOAP body and transmit the whole through the socket opened in 1) and save the data sent back by the web service.
4) Parse the XML string returned to me (using the xml-sax BIF)
5) Process that data just like any other data.
我使用了Scott Klement的很多东西(非常感谢Klement先生!):
ERRNO_H
IFS_H
IFSUTIL_H
SOCKET_H
SOCKUTIL_H
我还必须处理将数据与EBCDIC和UTF-8之间的相互转换。我想我是在Scott也写过一些东西之后对这个过程进行建模的,但是我不确定。搜索iconv即可开始使用。
关于ibm-midrange - 从COBOL或CL调用Web服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13922626/