Hi Ruchith,
Thank you for your reply.
If I use the security module, is it possible that we use different security policies for different client, i.e., the security policy is a contract between the service and a specific client or group of clients. What I want to do includes two kind of things: first kind is to receive a SOAPEnvelope which contains client information in the header part. According to the client information, I apply predefined security policy to the SOAPEnvelope (this may include add username token, signature, and/or encryption based on the client info), and send the SOAPEnvelope to the destination EPR.
The other scenario I want to add addressing information to the message before client send out the SOAPEnvelope. The addressing information may be retrieved from database according to the client info.
Can I still use the security module and addressing module to realize my tasks?
Regards,
Xinjun
On 3/20/06, Ruchith Fernando <[EMAIL PROTECTED]> wrote:
Hi Xinjun ,
If you are interested we already have a wss4j based security module in
Axis2. (Which has a sender handler and a receiver handler)
Code is available here:
https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/security/
When the security module is engaged on a certain service it will be
providing the classloader of the AxisService to WSS4J and the
properties file are expected to be in service archive.
See: org.apache.axis2.security.handler.WSDoAllHandler#getClassLoader()
Thanks,
Ruchith
On 3/20/06, Xinjun Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> When I write simple SecurityHandler use the StAX and WSS4J in Axis2, the
> exception appended occurs.
> I tried the following testings:
> 1. Put the crypto.properties and keys/x509.PFX.MSFT are in the same folder
> as the TestSecurity.class. I still get the exception that the
> crypto.properties cannot be loaded.
> 2. I tried to load the crypto.properties file from inside the
> TestSecurity.class, the property file can be loaded.
> 3. I tried to put the path of the directory which contains crypto.properties
> file in the classpath (set the user Environment Variable in Windows), and I
> still failed to load the crypto.properties.
> 3. I tried to put the path of the crypto.properties file in the classpath
> (set the user Environment Variable in Windows), and I failed to load the
> crypto.properties again.
>
> Could anyone point me a way out?
> PS: accidentally I posted this question in Axis maillist just now. Please
> forgive me if you have read the question in Axis-user maillist.
>
>
> Exception in thread "main"
> java.lang.ExceptionInInitializerError
> at
> com.crimsonlogic.wsgate.core.ws.handler.test.TestSecurity.test(TestSecurity.java:132)
> at
> com.crimsonlogic.wsgate.core.ws.handler.test.TestSecurity.main
> (TestSecurity.java:46)
> Caused by: java.lang.RuntimeException: CryptoFactory: Cannot load
> properties: crypto.properties
> at
> org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:150)
> at
> org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:96)
> at
> org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:54)
> at
> com.crimsonlogic.wsgate.core.ws.handler.security2.SenderHandler
> .<clinit>(SenderHandler.java :34)
> ... 2 more
>
>
> Regards,
>
> Xinjun
