What JVM are you running on? The generated clients require Java 1.5, so
maybe that is the issue?

- Dan

On 1/19/07, Dave Kallstrom <[EMAIL PROTECTED]> wrote:

I am having some problems getting WS-Security up and running. I am getting
a UnsupportedClassVersionError Bad version in .class file. From the stack
trace it appears to be coming from
WSSecEncryptedKey.java I was wondering if anyone else has run into this
problem. I am assuming it is a classpath issue. Perhaps I have to wrong jar
included someplace.

I used WindowsXP keytool to generate the keystore file.
My Client test code looks like this
       CollectiveServicesClient service = new CollectiveServicesClient();
        CollectiveServices client =  service.getCollectiveServicesHttpPort();
        Client proxy =
((XFireProxy)Proxy.getInvocationHandler(client)).getClient();
        proxy.addOutHandler(new DOMOutHandler());

        Properties props = new Properties();
        props.setProperty (WSHandlerConstants.ACTION,
WSHandlerConstants.ENCRYPT);
        props.setProperty(WSHandlerConstants.USER, "myAlias");
        props.setProperty(WSHandlerConstants.ENC_PROP_FILE,
"collective/webservices/insecurity_enc.properties");

        proxy.addOutHandler(new WSS4JOutHandler(props));

        try
        {
            session = client.login("username", "password");
        }
        catch (CollectiveServicesException_Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
I created the key file and key store with keytool according to the xfire
instructions.
my services.xml file looks like this..
<service>
        <name>CollectiveServices</name>
        <serviceBean>#serviceBean</serviceBean>
        <style>wrapped</style>
        <serviceFactory>jsr181</serviceFactory>
        <inHandlers>
            <handler handlerClass="
org.codehaus.xfire.util.dom.DOMInHandler"/>
            <bean class=" org.codehaus.xfire.security.wss4j.WSS4JInHandler"
xmlns="">
                <property name="properties">
                    <props>
                        <prop key="action">Encrypt</prop>
                        <prop
key="decryptionPropFile">insecurity_enc.properties</prop>
                        <prop key="passwordCallbackClass">
collective.webservices.PasswordCallback </prop>
                    </props>
                </property>
            </bean>
        </inHandlers>
    </service>
--
Dave Kallstrom




--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Reply via email to