I took a look at the samples and while they are very useful they don't really
address my particular problem. I was able to overcome that problem in one
way but that solution leads to more questions. Basically, I can make the
solution work by making my class ApplicationContextAware. In my bundles
module context I have declared the following beans:

    <cxf:bus name="cxf">
        <cxf:features>
            <cxf:logging />
        </cxf:features>
    </cxf:bus>

    <jaxws:client
       
name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService";
        createdFromAPI="false" username="demo" password="demo" />

    <http:conduit name="https://localhost:.*";>
        <http:tlsClientParameters
            disableCNCheck="true">
            <sec:trustManagers>
                <sec:keyStore type="jks" password="cspass"
                    resource="certs/clientKeystore.jks" />
            </sec:trustManagers>
        </http:tlsClientParameters>
    </http:conduit>

And in code:

SpringBus bus = (SpringBus) this.applicationContext.getBean("cxf");

...

STSClient stsClient = new STSClient(bus);

The http:conduit is necessary to set the trust store for the STSClient.
While this solution works it requires that I make the class
ApplicationContextAware and I'm wondering if there is a better way. For
example, is there a way for me to register the bus with CXF in spring so
that I can retrieve it in my code through some CXF API?




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724598.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to