Karaf-based (and FOSS) Talend ESB http://www.talend.com/products/esb
offers two OSGi-based STS examples in its examples/cxf folder (also
viewable here:
https://github.com/Talend/tesb-rt-se/tree/master/examples/cxf). But you
first might wish to set aside the STS portion and first concentrate on
getting *any* web service w/XML files hosted on OSGi, such as my example
here: http://www.jroller.com/gmazza/entry/web_service_tutorial . Once
you're getting XML config properly detected, then you can build your STS
client with normal XML config files.
HTH,
Glen
PS: It might also help to see if you can deploy to Tomcat successfully,
to rule out your code being the problem:
http://www.jroller.com/gmazza/entry/cxf_sts_tutorial
On 03/14/2013 12:18 PM, geecxf wrote:
I've spent a day trying to figure out how to build a code only STSClient. I
would like to do the analogue of the following in code only:
<cxf:bus>
<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="alice" password="clarinet" />
<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>
SpringBusFactory bf = new SpringBusFactory();
SpringBus bus = (SpringBus) bf.createBus("clientSts.xml");
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
.....
STSClient stsClient = new STSClient(bus);
Why in code only? Because I can't figure out how to make the example as is
work in an OSGI bundle. Clearly I lack the low level understanding of these
framework that is required to get this work. I've been reading through the
documentation to figure this out. There are examples of how to create
standard REST clients and SOAP clients from code only and those I have
applied with success; however, none of those examples seem to fit with this
particular use case.
Finally, it would be nice to know what the patter is for building and using
clients in OSGI using Spring. I've grepped through the sample code looking
for a simple example of this but the only osgi sample is hosting a service
not making calls from a bundle.
I'm probably missing something or maybe I have not done enough research but
I've spent a day trying to figure this out and there's just too much to
learn. I would really appreciate some clues that would at least point me in
the right direction. Thanks in advance.
--
View this message in context:
http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575.html
Sent from the cxf-user mailing list archive at Nabble.com.