Tuesday, November 25, 2008

Axis: Creating Stub with custom WSDD file

And here is another Axis (1.4) tip:

In order to create a stub with a custom WSDD file you'll need to do the following:

import org.apache.axis.configuration.FileProvider;
import java.io.File;
import java.io.InputStream;
.
.
InputStream is = new FileInputStream(new File("D:/custom-client-config.wsdd"));
MyServiceLocator locator = new MyServiceLocator(new FileProvider(is));


Pay Attention!


In the client side there is a bug in parsing wsdd: when the handlers are configured in the service flow and service contains additional configuration (e.g. provider, style, user, mappings, etc.), the handler will not run. This happens since client configuration does not contain className with the service implementation class.

It's possible to put "dummy" class name. But the better solution is to configure handler in the global flow.

No comments: