I am not setting any policy. It is just a normal client which i generated
from wsdl using wsdl2java. then i call the methods on the stub. 

        IExternalNotification externalNotification = new
ExternalNotification().getCustomBindingIExternalNotification();
                

            org.apache.cxf.endpoint.Client cxfClient =
ClientProxy.getClient(externalNotification);
            cxfClient.getOutInterceptors().add(new
AppendTokenInterceptor(securityToken.getToken()));
            cxfClient.getOutInterceptors().add(new
WSS4jCustomOutInterceptor(properties,securityToken.getId(),securityToken.getSecret()));
            

*/
             SMSGetMessagesRequest getMessagesRequest = new
SMSGetMessagesRequest();
             getMessagesRequest.setBatchNumber(0);
             SMSGetMessagesResponse response =
externalNotification.smsGetMessages(getMessagesRequest);

10/12/2013 8:56:11 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {http://tempuri.org/}ExternalNotification from WSDL:
https://exposure.ecsn.gov.au/EXP/externalnotification.svc?wsdl
10/12/2013 8:56:14 AM org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl
handleNoRegisteredBuilder
WARNING: No assertion builder for type
{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}HttpToken registered.
10/12/2013 8:56:14 AM
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider
getElementPolicy
WARNING: Failed to build the policy
'CustomBinding_IExternalNotification_policy':org.apache.neethi.builders.PrimitiveAssertion
cannot be cast to org.apache.cxf.ws.security.policy.model.Token
javax.xml.ws.soap.SOAPFaultException:
org.apache.neethi.builders.PrimitiveAssertion cannot be cast to
org.apache.cxf.ws.security.policy.model.Token
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
        at com.sun.proxy.$Proxy43.smsGetMessages(Unknown Source)
        at CapClient.main(CapClient.java:172)
Caused by: java.lang.ClassCastException:
org.apache.neethi.builders.PrimitiveAssertion cannot be cast to
org.apache.cxf.ws.security.policy.model.Token
        at
org.apache.cxf.ws.security.policy.builders.TransportTokenBuilder.build(TransportTokenBuilder.java:61)
        at
org.apache.cxf.ws.security.policy.builders.TransportBindingBuilder.processAlternative(TransportBindingBuilder.java:85)
        at
org.apache.cxf.ws.security.policy.builders.TransportBindingBuilder.build(TransportBindingBuilder.java:57)
        at
org.apache.cxf.ws.security.policy.builders.TransportBindingBuilder.build(TransportBindingBuilder.java:41)
        at
org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:138)
        at
org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
        at
org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
        at 
org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
        at
org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
        at
org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
        at
org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
        at
org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
        at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
        at
org.apache.cxf.ws.policy.attachment.reference.LocalServiceModelReferenceResolver.resolveReference(LocalServiceModelReferenceResolver.java:53)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.resolveLocal(Wsdl11AttachmentPolicyProvider.java:292)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.resolveReference(Wsdl11AttachmentPolicyProvider.java:272)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.getElementPolicy(Wsdl11AttachmentPolicyProvider.java:220)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.getElementPolicy(Wsdl11AttachmentPolicyProvider.java:168)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.getElementPolicy(Wsdl11AttachmentPolicyProvider.java:161)
        at
org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider.getEffectivePolicy(Wsdl11AttachmentPolicyProvider.java:98)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.getAggregatedEndpointPolicy(PolicyEngineImpl.java:418)
        at
org.apache.cxf.ws.policy.EndpointPolicyImpl.initializePolicy(EndpointPolicyImpl.java:151)
        at
org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:139)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:550)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:296)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:279)
        at
org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61)
        at
org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:310)
        at 
org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:296)
        at
org.apache.cxf.transport.http.URLConnectionHTTPConduit.<init>(URLConnectionHTTPConduit.java:68)
        at
org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit.<init>(AsyncHTTPConduit.java:110)
        at
org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory.createConduit(AsyncHTTPConduitFactory.java:280)
        at
org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:255)
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:238)
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:245)
        at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103)
        at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
        at
org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:886)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:560)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
        ... 2 more







--
View this message in context: 
http://cxf.547215.n5.nabble.com/org-apache-neethi-builders-PrimitiveAssertion-cannot-be-cast-to-org-apache-cxf-ws-security-policy-mon-tp5737523p5737614.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to