Hi,

Obviously you have Microsoft specific assertions in WS-Policy that CXF doesn't 
understand by default.

Regards,
Andrei.

> -----Original Message-----
> From: Walters, Jay M [mailto:[email protected]]
> Sent: Mittwoch, 15. Januar 2014 15:26
> To: [email protected]
> Subject: Question on using CXF STS with 3rd party server without Spring
> 
> I have poked around a bit and not found a good example of what I need to
> do to get this working. I have a WCF C# webservice I am trying to call.  I 
> have
> working Metro code and also C# code calling the service (a third party
> product), but not getting any traction with CXF.  So far all the examples
> appear to use Spring which I cannot use.
> 
> I am trying to use CXF 2.7.8 with JDK 1.6.0_21.
> 
> Do I need to instantiate an STSClient object, or does this happen
> automatically?  If automatic, what do I need to configure in order to make it
> work. I have a X509 certificate as a byte stream, I do not have a keystore
> though I suppose I could make it if required to use CXF.
> 
> So far I have uses wsdl2java to generate loads of stuff which I try to use as
> follows.
> 
>     SymbolService_Service factory = new SymbolService_Service();
>     SymbolService ss = factory.getSymbolServiceHttp();
>     ArrayOfSymbolContract array = ss.queryForAll();
> 
> This yields the following output/trace
> 
> [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] - Creating
> Service
> {...<http://www.sungard.com/vpm/core/tables/Symbol/>}SymbolService
> from WSDL:
> http://bosdvpmapp1:8010/VPM/Core/Tables/SymbolService?wsdl
> [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] - No assertion
> builder for type
> {http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1}BinaryEnc
> oding registered.
> [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] - No assertion
> builder for type
> {http://schemas.microsoft.com/ws/2006/05/framing/policy}SslTransportSec
> urity registered.
> org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvid
> er] - Failed to build the policy
> 'SymbolServiceTcp_policy':org.apache.neethi.builders.PrimitiveAssertion
> cannot be cast to org.apache.cxf.ws.security.policy.model.Token
> 
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: None of
> the policy alternatives can be satisfied.
>     at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
>     at $Proxy44.queryForAll(Unknown Source)
>     at Client.main(Client.java:112)
> Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy
> alternatives can be satisfied.
>     at
> org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPoli
> cyImpl.java:166)
>     at
> org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyIm
> pl.java:145)
>     at
> org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.jav
> a:141)
> ....
> 
> Thanks for any help

Reply via email to