摆脱Axis中的client-config.wsdd [英] Get rid of client-config.wsdd in Axis

查看:153
本文介绍了摆脱Axis中的client-config.wsdd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置测试环境,我需要以编程方式注册我的处理程序/传输方式,而不是使用client-config.wsdd:

I am setting up my test environment and I need to programmatically register my handler/transport instead of using a client-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <handler name="MyClient" type="java:foo.bar.MyClient"/>
 <transport name="MyTransport" pivot="MyClient"/>
</deployment>

您知道是否有可能?

谢谢.

推荐答案

好,我已经检查了Axis源,以下代码解决了我的问题:

OK, I've checked Axis sources and the following code solved my problem:

AxisProperties.setProperty(EngineConfigurationFactory.SYSTEM_PROPERTY_NAME, "foo.bar.MyEngineConfigurationFactory");

...

import org.apache.axis.EngineConfiguration;
import org.apache.axis.EngineConfigurationFactory;
import org.apache.axis.configuration.BasicClientConfig;

public class MyEngineConfigurationFactory implements EngineConfigurationFactory {

    public static EngineConfigurationFactory newFactory(Object param) {
        return new MyEngineConfigurationFactory();
    }

    public EngineConfiguration getClientEngineConfig() {
        BasicClientConfig cfg = new BasicClientConfig();
        cfg.deployTransport("MyTransport", new MyClient());
        return cfg;
    }

    public EngineConfiguration getServerEngineConfig() {
        return null;
    }
}

就是这样.我希望它能对某人有所帮助.

That's it. I hope it helps someone.

这篇关于摆脱Axis中的client-config.wsdd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆