All,

I am trying to engage Rampart with JAX-WS client. I am trying to use the
example from <AXIS_HOME>\samples\jaxws-samples.

1. In this example...it creates the configurationContext and initializes the
repository and the axis2.xml as required.

 private ClientConfigurationFactory initConfigurationFactory() {
        String axis2xml =
System.getProperty("org.apache.axis2.jaxws.config.path");
        if (axis2xml == null) {
            throw new RuntimeException("Please set
org.apache.axis2.jaxws.config.path system property to a valid axis2.xml file
(with addressing module enabled)");
        }
        ClientConfigurationFactory factory = null;
        try {
            FileSystemConfigurator configurator = new
FileSystemConfigurator(null, axis2xml);
            factory = new ClientConfigurationFactory(configurator);

MetadataFactoryRegistry.setFactory(ClientConfigurationFactory.class,
factory);
        } catch (AxisFault axisFault) {
            throw new RuntimeException(axisFault);
        }
        return factory;
    }


2. Then the service call is made to the server using the following code:

void CallService() {

                    if (clientConfigurationFactory == null) {
                        ClientConfigurationFactory factory =
initConfigurationFactory();
                        *buildAsync*(uriString + urlSuffix, null, message,
timeout, wireasync);
                        destroyConfigurationFactory(factory);
                    } else {
                        buildAsync(uriString + urlSuffix, null, message,
timeout, wireasync);
                    }
    }//truncated/removed some code.

3. The buildAsync does not contain anything that engages a module or the
configContext to the  javax.xml.ws.Service. Neither is there any conversion
between  javax.xml.ws.Service and Axis's ServiceClient. So as
expected...when the request is sent...the server throws the exception that
the security header is missing.

Do you know if there is a legit way of engaging jax-ws with Rampart from the
client. Am I missing something? I was successful in doing this from the
server side. But I would like to engage jax-ws with ws-security from the
server side as well through Axis. Any help will be appreciated.

Thanks
Preetham

Reply via email to