Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好有个问题请教一下 #1

Open
LittleYoungMan opened this issue Aug 22, 2018 · 0 comments
Open

你好有个问题请教一下 #1

LittleYoungMan opened this issue Aug 22, 2018 · 0 comments

Comments

@LittleYoungMan
Copy link

我是用python调用java的dubbo服务 把你的文件复制到我的site-package下,调用时出现如下问题
Traceback (most recent call last):
File "D:/classadmin/生涯探索/careerserv/example/tests.py", line 19, in
print (conn.invoke(interface, method, param))
File "D:\python\venv\lib\site-packages\dubbo_telnet_init_.py", line 84, in invoke
return self.do(cmd)
File "D:\python\venv\lib\site-packages\dubbo_telnet_init_.py", line 65, in do
tn.write('\n')
File "C:\Users\asdf\AppData\Local\Programs\Python\Python36\Lib\telnetlib.py", line 287, in write
if IAC in buffer:
TypeError: 'in ' requires string as left operand, not bytes
我的代码
import dubbo_telnet

if name == 'main':
Host = '127.0.0.1' # Doubble服务器IP
Port = 30885 # Doubble服务端口

# 初始化dubbo对象
conn = dubbo_telnet.connect(Host, Port)

# 设置telnet连接超时时间
conn.set_connect_timeout(10)

# 设置dubbo服务返回响应的编码
conn.set_encoding('utf-8')

interface = 'com.hqjl.scheduler.classcard.IScheduleClassCardService'
method = 'getAdminClasses',
param = '{"schoolID": "1153"}'
print (conn.invoke(interface, method, param))

# command = 'invoke com.zrj.pay.trade.api.QueryTradeService.tradeDetailQuery({"id":"nimeide"})'
# print (conn.do(command))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant