我是靠谱客的博主 时尚哑铃,这篇文章主要介绍[tuxedo]jolt访问tuxedo服务,现在分享给大家,希望可以做个参考。

package test;

import bea.jolt.JoltMessage;
import bea.jolt.JoltRemoteService;
import bea.jolt.JoltSession;
import bea.jolt.JoltSessionAttributes;

public class JoltTest {

	public static void main(String[] args) {
		String userName = "";
		String userPassword = "";
		String appPassword = "";
		String userRole = "";

		System.setProperty("bea.jolt.encoding", "gbk");
		JoltSessionAttributes jsAttrs = new JoltSessionAttributes();
		// 设置IP地址和端口
		jsAttrs.setString(JoltSessionAttributes.APPADDRESS, "//192.168.1.123:9000");
		jsAttrs.setInt(JoltSessionAttributes.IDLETIMEOUT, 300);
		JoltSession jSession = new JoltSession(jsAttrs, userName, userRole, userPassword, appPassword);

		JoltRemoteService jrService = null;
		try {
			// 设置服务名
			jrService = new JoltRemoteService("SERVICE_NAME", jSession);
			// 设置参数:整型、字符型
			jrService.setInt("PARAM1", 1001);
			jrService.setString("PARAM2", "PARAM2");
			// 调用服务
			jrService.call(null);
			System.out.println("请求参数:" + jrService.getInputs());
			// 获取结果
			JoltMessage jm = jrService.getOutputs();
			System.out.println("返回结果:" + jm);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			jrService.clear();
			jSession.endSession();
		}
	}
}
备注:
1.不需要配合weblogic的jolt连接池使用
2.需要包:jolt.jar,jolti18n.jar,joltjse.jar,joltwls.jar
3.需要tuxedo服务配置好jolt访问的方式,给出端口号

最后

以上就是时尚哑铃最近收集整理的关于[tuxedo]jolt访问tuxedo服务的全部内容,更多相关[tuxedo]jolt访问tuxedo服务内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(106)

评论列表共有 0 条评论

立即
投稿
返回
顶部