tags:

views:

714

answers:

1

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"&gt;
 <handler name="MyClient" type="java:foo.bar.MyClient"/>
 <transport name="MyTransport" pivot="MyClient"/>
</deployment>

Would you know if it's possible?

Thanks in advance.

+2  A: 

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.

Tiago Fernandez