【问题标题】:Get rid of client-config.wsdd in Axis摆脱 Axis 中的 client-config.wsdd
【发布时间】:2009-10-09 09:25:54
【问题描述】:

我正在设置我的测试环境,我需要以编程方式注册我的处理程序/传输,而不是使用 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>

你知道这是否可能吗?

提前致谢。

【问题讨论】:

    标签: java axis


    【解决方案1】:

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

    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;
        }
    }
    

    就是这样。我希望它可以帮助某人。

    【讨论】:

    • JAX-RPC client-side handler 上显示的示例在解决类似问题时给了我一些很好的见解。只是分享我的两分钱。
    【解决方案2】:

    另一方面,您可以在资源目录中添加一个新的 client-config.wsdd 文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-09
      • 1970-01-01
      • 2012-02-17
      • 2018-01-06
      • 1970-01-01
      • 1970-01-01
      • 2010-11-03
      相关资源
      最近更新 更多