PyRFC:通过 mshost 连接(不是 ashost) [英] PyRFC: Connect via mshost (not ashost)

查看:29
本文介绍了PyRFC:通过 mshost 连接(不是 ashost)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 PyRFC 使用 Python 编程语言在 SAP 上进行远程过程调用.

I would like to use PyRFC to do remote procedure call on SAP using the Python programming language.

conn = pyrfc.Connection(user='foouser', passwd='xxxx',
    mshost='sap.example.com', sysid='TE1', client='220',
    group='EXAMPLE',
    )

但它失败了:

RFC_COMMUNICATION_FAILURE (rc=1): key=RFC_COMMUNICATION_FAILURE, message=
ERROR       service 'sapmsTE1' unknown
TIME        Tue Dec 18 15:49:40 2018
RELEASE     753
COMPONENT   NI (network interface)
VERSION     40
RC          -3
MODULE      /bas/753_REL/src/base/ni/niuxi.c
LINE        1833
DETAIL      NiPGetServByName: 'sapmsTE1' not found
SYSTEM CALL getaddrinfo
COUNTER     1
 [MSG: class=, type=, number=, v1-4:=;;;]

怎么了?

我猜 sapmsTE1 会在 /etc/services 中查找.但是这个文件是我的linux服务器的默认(未修改)文件.

I guess sapmsTE1 gets looked up in /etc/services. But this file is the default (unmodified) file of my linux server.

推荐答案

我自己找到了答案.您需要提供参数msserv".AFAIK 这是一个常数值.这有效:

I found the answer myself. You need to supply the parameter "msserv". AFAIK this is a constant value. This worked:

conn = pyrfc.Connection(user='foouser', passwd='xxxx',
    mshost='sap.example.com', sysid='TE1', client='220',
    msserv='3600',
    group='EXAMPLE',
    )

这篇关于PyRFC:通过 mshost 连接(不是 ashost)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆