Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of client-config.wsdd in Axis

Tags:

java

axis

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>

Would you know if it's possible?

Thanks in advance.

like image 269
Tiago Fernandez Avatar asked Oct 09 '09 09:10

Tiago Fernandez


People also ask

What is server config WSDD?

The server-config. wsdd file is generated by the wsdl2java tool from Axis. So, some developer used the tool and copied the file inside your Tomcat conf, where it belongs.

What is Axis SOAP?

Introduction. Apache Axis is an implementation of the SOAP ("Simple Object Access Protocol") submission to W3C. From the draft W3C specification: SOAP is a lightweight protocol for exchanging structured information in a decentralized, distributed environment.

What is org Apache Axis?

Apache Axis (Apache eXtensible Interaction System) is an open-source, XML based Web service framework. It consists of a Java and a C++ implementation of the SOAP server, and various utilities and APIs for generating and deploying Web service applications.


1 Answers

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.

like image 149
Tiago Fernandez Avatar answered Oct 19 '22 18:10

Tiago Fernandez