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

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

问题描述

我想使用Python编程语言 PyRFC 在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:=;;;]

怎么了?

我猜<$ c $在 / etc / services 中查找了c> sapmsTE1 。但这是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天全站免登陆