This might be a good start : http://coheigea.blogspot.com/2011/05/ws-trust-sample-in-talend-service.html On Aug 1, 2011, at 3:00 PM, kishore_897 wrote:
> Hi > > I am using CXF 2.4.1. I am trying create a STS Client which can get the > token from the STS token provider (wso2 identity server).. > > Below is the soap request I am expecting the CXF STS client to generate when > it sends the token request. > > I am not having clear picture whether CXF STS client API has all the APIs to > set the data. > > Yes the WSDL (sts service ) is available. I was able to generate the token > with Axis2 - Rampart. But we found some HTTP Connection issues with it . So > we were trying to achieve with CXF Stsclient. > > If you have any documentation / example on the APIs available to set the > following configuration will be helpful > > <?xml version='1.0' encoding='UTF-8'?> > <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> > <soapenv:Header > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> > <wsse:Security > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" > soapenv:mustUnderstand="true"> > <wsu:Timestamp > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" > wsu:Id="Timestamp-1"> > <wsu:Created>2011-08-01T16:40:44.043Z</wsu:Created> > <wsu:Expires>2011-08-01T16:45:44.043Z</wsu:Expires> > </wsu:Timestamp> > <wsse:UsernameToken > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" > wsu:Id="UsernameToken-2"> > <wsse:Username>testuser</wsse:Username> > <wsse:Password > Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">testuser</wsse:Password> > </wsse:UsernameToken> > </wsse:Security> > <wsa:To>http://localhost:1443/services/wso2carbon-sts</wsa:To> > <wsa:ReplyTo> > <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> > </wsa:ReplyTo> > <wsa:MessageID>urn:uuid:D4399E13287E3814811312216843550</wsa:MessageID> > <wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action> > </soapenv:Header> > <soapenv:Body> > <wst:RequestSecurityToken > xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust"> > <wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType> > <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"> > <wsa:EndpointReference > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> > <wsa:Address>http://localhost:8080/axis2/services/SecureService</wsa:Address> > </wsa:EndpointReference> > </wsp:AppliesTo> > <wst:Lifetime> > <wsu:Created > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-01T16:40:43.495Z</wsu:Created> > <wsu:Expires > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-02T16:34:03.495Z</wsu:Expires> > </wst:Lifetime> > <wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType> > <wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</wst:KeyType> > <wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity" > Uri="http://wso2.org/claims/userid" /> > </wst:Claims></wst:RequestSecurityToken></soapenv:Body></soapenv:Envelope> > > > I have programatically created a client. I was able to send the request to > the server but it result in exception as action element is not set > > 2011-08-01 10:45:05,595] ERROR - The [action] cannot be processed at the > receiver. > rg.apache.axis2.AxisFault: The [action] cannot be processed at the receiver. > at > org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(AddressingFaultsHelper.java:373) > at > org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSupportedFault(AddressingFaultsHelper.java:336) > at > org.apache.axis2.handlers.addressing.AddressingInHandler.extractActionInformation(AddressingInHandler.java:521) > at > org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingInformation(AddressingInHandler.java:238) > at > org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:153) > at org.apache.axis2.engine.Phase.invoke(Phase.java:318) > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165) > at > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173) > at > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) > at > org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) > at > org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:154) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) > at java.lang.Thread.run(Thread.java:662) > > > Thanks > Kishore > > > > > > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4656674.html > Sent from the cxf-user mailing list archive at Nabble.com.
