我有一个带有连接细节的JDA服务器。我必须从python程序连接到这个JDA服务器并执行MOCA命令。我已经搜索过了,到目前为止还没有找到任何关于这个的文档。在
找到了一些jar文件,但没有发现Python。我的python客户端应用程序必须连接到JDA并执行命令。在
执行请求并获取会话键值。也使用会话键执行了命令,但输出没有得到反映。在
调用此特定命令以请求主体身份登录。在
<moca-request autocommit="True">
<environment>
<var name="USR_ID" value="super"/>
</environment>
<query>login user where usr_id = 'super' and usr_pswd = 'super'</query>
</moca-request>
我能够成功登录,并得到的回应为
^{pr2}$根据xml响应,我将会话密钥设置为;uid=SUPER | sid=b6698786-85dc-41ec-9e54-c0d8f99b5cbf | dt=jttyorn7 | sec=ALL;Hz1biv4HuD_Uq3g.R9QtCfwjQ0,并尝试执行这些命令。在
我就是这样执行命令的
<moca-request autocommit="True">
<environment>
<var name="USR_ID" value="super"/>
<var name="SESSION_KEY" value=";uid=SUPER|sid=b6698786-85dc-41ec-9e54-c0d8f99b5cbf|dt=jttyorn7|sec=ALL;Hz1biv4HuD_Uq3g.R9QtCfwjQ0"/>
<var name="LOCALE_ID" value="US_ENGLISH"/>
<var name="MOCA_APPL_ID" value="MYAPP"/>
</environment>
<query>
create record where table = 'alt_prtmst' and prtnum = 'TEST1' and alt_prtnum = 'TEST123' and alt_prt_typ = 'SAP' and prt_client_id = '----' </query>
</moca-request>
命令执行时没有任何错误,我也得到了响应。在
<?xml version="1.0" encoding="UTF-8"?>
<moca-response>
<session-id></session-id>
<status>0</status>
</moca-response>
但没有得到反映。在
我还在query中尝试了另一个moca命令。。在
<query>
list warehouses
</query>
即使它执行了如何获得准确的输出
我已经解释了您的问题,即您正在尝试连接到JDA(WMS)实例。 我在NodeJs中创建了一个连接到实例并执行MOCA命令的应用程序。在
我将带有请求头
'Content-Type': 'application/moca-xml'
的XML发布到<host>:<port>/service
。下面的示例XML主体将运行list user tables
MOCA命令。在
^{pr2}$SESSION_KEY
可以从登录请求的响应中获取,XML正文如下。在可以使用this从python连接到不一致服务器。示例如下:
希望对你有帮助。。。在
相关问题 更多 >
编程相关推荐