起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 16705|回复: 6

在其它java项目中调用X5的Action

  [复制链接]

88

主题

9507

帖子

5135

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5135
QQ
发表于 2011-8-1 14:45:47 | 显示全部楼层 |阅读模式
x5.2 sp2 版本开始

从X5.2 SP2开始,已经有更简单的集成调用方法了,请参看专题视频中的“系统集成”

之前版本

下面介绍在其它java项目中如何调用X5的Action,并提供完整示例。

一、说明
调用Action,需要进行权限验证,因此需要模拟客户端登录系统。
调用Action的过程分成4个部分,注册、登录、调用Action、注销

二、使用方法——见项目中的readme.txt文件
将business-client导入eclipse
1. 修改/config/config.xml文件,配置相应的信息
        > 业务服务器的地址
        > 登录平台的用户名和密码
        > 需要执行的action,在actions中可以配置多个action
2. 运行Client.java即可
3. 执行完后,可以查看控制台的输入,有action的执行结果

business-client.rar

836.36 KB, 下载次数: 4761

0

主题

1

帖子

1

积分

新手上路

Rank: 1

积分
1
发表于 2012-7-19 22:14:34 | 显示全部楼层
ok,thanks!

109

主题

2907

帖子

1564

积分

金牌会员

Rank: 6Rank: 6

积分
1564
QQ
发表于 2012-10-15 12:02:05 | 显示全部楼层
[QUOTE=zhaixin;164935393]下面介绍在其它java项目中如何调用X5的Action,并提供完整示例。

一、说明
调用Action,需要进行权限验证,因此需要模拟客户端登录系统。
调用Action的过程分成4个部分,注册、登录、调用Action、注销

二、使用方法——见项目中的readme.txt文件
将business-client导入eclipse
1. 修改/config/config.xml文件,配置相应的信息
        > 业务服务器的地址
        > 登录平台的用户名和密码
        > 需要执行的action,在actions中可以配置多个action
2. 运行Client.java即可
3. 执行完后,可以查看控制台的输入,有action的执行结果[/QUOTE]

运行结果是这个
======input:
url: http://localhost:8080/BusinessSe ... sion?language=zh_CN
======output:
<?xml version="1.0" encoding="UTF-8"?>
<root>        <flag>true</flag>        <message>operator success!</message></root>
======input:
url: http://localhost:8080/BusinessServer/login?language=zh_CN
<action name="loginAction" process="/SA/OPM/system/systemProcess" activity="mainActivity">        <parameters>           <parameter name="name">                    <simple type="http://www.w3.org/2001/XMLSchema#string">system</simple>       </parameter>   <parameter name="loginDate">            <simple type="http://www.w3.org/2001/XMLSchema#date">2011-07-29</simple>   </parameter>   <parameter name="pwd">       <simple type="http://www.w3.org/2001/XMLSchema#string">E10ADC3949BA59ABBE56E057F20F883E</simple>   </parameter>   <parameter name="lang">           <simple type="http://www.w3.org/2001/XMLSchema#string">zh_CN</simple>   </parameter>   <parameter name="ip">      <simple type="http://www.w3.org/2001/XMLSchema#string">127.0.0.1</simple>   </parameter>        </parameters></action>
======output:
<?xml version="1.0" encoding="UTF-8"?>
<root><flag>true</flag><message>operator sucessful</message><stack/><data xmlns:xbiz="http://www.justep.com/xbiz#"><xbiz:list><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">true</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SN01</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">system</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">ORG01</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">新闻总署</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/ORG01.ogn</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SYSTEM</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">127.0.0.1</xbiz:simple><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></xbiz:list></data><customer>0</customer></root>
======input:
url: http://localhost:8080/BusinessSe ... tion?language=zh_CN
<action name="getSysParamsAction" process="/SA/OPM/system/systemProcess" activity="mainActivity"/>
======output:
<?xml version="1.0" encoding="UTF-8"?>
<root><flag>true</flag><message>operator sucessful</message><stack/><data xmlns:xbiz="http://www.justep.com/xbiz#"><xbiz:map><item key="currentPersonMemberFName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/新闻总署/system</xbiz:simple></item><item key="operatorCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SYSTEM</xbiz:simple></item><item key="allPersonMemberFIDs"><xbiz:list><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/ORG01.ogn/PSN01@ORG01.psm</xbiz:simple></xbiz:list></item><item key="currentPersonMemberFCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/xwss/SYSTEM</xbiz:simple></item><item key="currentOgnID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">ORG01</xbiz:simple></item><item key="currentPersonMemberNameWithAgent"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">system</xbiz:simple></item><item key="currentPersonName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">system</xbiz:simple></item><item key="currentOrgFID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/ORG01.ogn</xbiz:simple></item><item key="currentPersonMemberFID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/ORG01.ogn/PSN01@ORG01.psm</xbiz:simple></item><item key="currentProcessLabel"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">系统调用</xbiz:simple></item><item key="currentOgnFCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/xwss</xbiz:simple></item><item key="currentActivityLabel"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">系统</xbiz:simple></item><item key="currentOgnName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">新闻总署</xbiz:simple></item><item key="currentOrgCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">xwss</xbiz:simple></item><item key="currentOgnFID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/ORG01.ogn</xbiz:simple></item><item key="loginDate"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Date">2011-07-29</xbiz:simple></item><item key="currentPersonMemberFNameWithAgent"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/新闻总署/system</xbiz:simple></item><item key="currentPersonMemberCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SYSTEM</xbiz:simple></item><item key="currentPersonCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SYSTEM</xbiz:simple></item><item key="currentPersonID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SN01</xbiz:simple></item><item key="currentOrgFName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/新闻总署</xbiz:simple></item><item key="currentPersonMemberName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">system</xbiz:simple></item><item key="currentOrgName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">新闻总署</xbiz:simple></item><item key="currentOgnCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">xwss</xbiz:simple></item><item key="operatorName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">system</xbiz:simple></item><item key="currentOgnFName"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/新闻总署</xbiz:simple></item><item key="currentPersonMemberID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SN01@ORG01</xbiz:simple></item><item key="currentOrgFCode"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">/xwss</xbiz:simple></item><item key="operatorID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">SN01</xbiz:simple></item><item key="currentOrgID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">ORG01</xbiz:simple></item></xbiz:map></data><customer>0</customer></root>
======input:
url: http://localhost:8080/BusinessServer/logout?language=zh_CN
======output:
<?xml version="1.0" encoding="UTF-8"?>
<root><flag>true</flag><message>operator sucessful</message><stack/><data xmlns:xbiz="http://www.justep.com/xbiz#"></data><customer>0</customer></root>
对么?

这个方法该怎么用啊

37

主题

713

帖子

3310

积分

内部用户

积分
3310
发表于 2012-12-19 08:50:10 | 显示全部楼层
从X5.2 SP2开始,已经有更简单的集成调用方法了,请参看专题视频中的“系统集成”

1

主题

12

帖子

20

积分

新手上路

Rank: 1

积分
20
发表于 2013-1-26 15:11:04 | 显示全部楼层
标记一下

1

主题

12

帖子

31

积分

新手上路

Rank: 1

积分
31
发表于 2013-2-20 10:17:42 | 显示全部楼层
收藏

71

主题

249

帖子

624

积分

高级会员

Rank: 4

积分
624
QQ
发表于 2013-8-5 15:55:31 | 显示全部楼层
有谁根据这个调通了?能帮助解答吗?
X5实践者
高级模式
B Color Image Link Quote Code Smilies

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-4 04:00 , Processed in 0.102019 second(s), 32 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表