Short answer is, I don't know, but I'm not sure why you have
createdFromAPI="false" in your STSClient definition. It should be
"true"
(https://github.com/gmazza/blog-samples/blob/master/cxf_sts_tutorial/client/src/main/resources/cxf.xml)
providing you've already explicitly creating a SOAP client within your
Java code
(https://github.com/gmazza/blog-samples/blob/master/cxf_sts_tutorial/client/src/main/java/client/WSClient.java).
"false" creates a new bean, "true" applies the value of that bean to any
client sharing the conduit characteristics.
Glen
On 03/14/2013 09:00 PM, geecxf wrote:
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.