Hi,

I have the following problem:
(I'm using Axis2 1.3 in combination with rampart 1.3)

I want to write a webservice-client running inside a j2ee-environment
(packed in an ear-file)
(The webservice-call is triggered by a MDB inside the J2EE-environment)

The webservice-provider demands a secured call.
Thus I had to add the following to the axis2.xml:

    <module ref="rampart-1.3"/>
    <parameter name="OutflowSecurity">
      <action>
        <items>Timestamp Signature</items>
        <user>client</user>
        <passwordC allbackClass>abc.def.PWCBHandler</passwordCallbackClass>
        <signaturePropFile>abc/def/crypto.properties</signaturePropFile>
        <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
      </action>
    </parameter>

My test-client, written as POJO:
 ...
 WSStub stub=null;
 String url = "http://rst.xyz:8000/axis2/services/WS";;
 String AXIS2_PATH="C:\\ws\\axis2-1.3";
 String CLIENT_REPO_PATH=AXIS2_PATH+"\\repository <file://repository/>";
 String CLIENT_CONFIG_PATH=AXIS2_PATH+"\\conf\\axis2.xml<file://conf//axis2.xml>
";
 ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,
CLIENT_CONFI G_PATH);
 stub = new WSStub(ctx,url);
 stub._getServiceClient().engageModule("rampart-1.3");
 stub.aMethod();
 ...

works without any problems!

But when I want to put this coding into a J2EE-environment, then the
following problem arise:
It is not allowed to access the file-system inside J2EE-environment, thus
using "ConfigurationContextFactory.createConfigurationContextFromFileSystem"
is not possible.
Using "ConfigurationContextFactory.createConfigurationContextFromURIs" is
also not possible, because I can not make any further assumptions about the
destination-environment.
(thus accessing the axis2.xml via file-url or http-url is not preferably)

I wish to put the axis2.xml into the jar (inside the ear-file) and access it
via "getSystemRessourceAsStream" or something like that. Thus the ear-file
itself would contains everything it needs.
But the ConfigurationContextFactory-class has no API for this.

In my understanding the only way to set outflow-security is via axis2.xml
and the only way to change this global behaviour is via axis2.xml. Or am I
wrong? (I found a Class "OutflowConfiguration" for programmatically setting
this, but that class is deprecated.)

What do you recommend to load the axis2-configurationcontext (axis2.xml)
inside a J2EE-application acting as WS-client?
Many thanks in advance!!

KR
Torsten Goncz

Reply via email to