Hi Andrei, Thanks a lot mate your blog is actually really helpful.
Cheers, Damian. On 5 October 2012 11:51, Andrei Shakirin <[email protected]> wrote: > Hi Damian,**** > > ** ** > > You can find some additional information in my blog: > http://ashakirin.blogspot.de/2012/02/using-ws-policy-in-cxf-projects.htmland > in CXF links that I sent you. > **** > > Unfortunately CXF doesn’t deliver samples for non-standard policy > assertions at the moment.**** > > I will discuss how to do it on the best way and will start work on it.**** > > ** ** > > Regards,**** > > Andrei.**** > > ** ** > > *From:* Damian Sima [mailto:[email protected]] > *Sent:* Freitag, 5. Oktober 2012 15:11 > *To:* Andrei Shakirin > *Cc:* [email protected] > *Subject:* Re: WARNING: No assertion builder for type & > javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can > be satisfied.**** > > ** ** > > Hi there Andrei thanks for reply....**** > > ** ** > > Yes it looks like that was the answer I registered the > PolicyInterceptorPoviders and the AssertionBuilders and it work.**** > > ** ** > > One thing though, to do so I followed this blog > http://groovyjava-tom.blogspot.com.ar/2012/01/cxf-and-ms-crm-2011.htmlbut I > couldn't find any official tutorial. > **** > > ** ** > > Is there any link you guys can provide about that, I've been around the > one you sent but is not really explicit.**** > > ** ** > > Cheers, Damian.**** > > On 5 October 2012 05:27, Andrei Shakirin <[email protected]> wrote:**** > > Hi Damian, > > Could you also provide your WSDL with the policies? > It seems that you use custom policy assertions into WS-Policy ({ > http://www.sap.com/webas/710/soap/features/transportbinding/}OptimizedXMLTransfer, > etc), but don't register appropriate AssertionBuilders and > PolicyInterceptorProviders. As far as your custom assertions are not > satisfied, CXF throws exceptions. > > You can look for details in http://cxf.apache.org/docs/ws-policy.html. > > Regards, > Andrei.**** > > > -----Original Message----- > From: Damian Sima [mailto:[email protected]] > Sent: Donnerstag, 4. Oktober 2012 17:57 > To: [email protected] > Subject: WARNING: No assertion builder for type & > javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can > be satisfied. > > Hi guys, > > I've come across this issue and I'm not sure how to fix it. > > > I've have this WSDL with some policies, I've created the client with > wsdl2java and I try to execute the following code: > > ManageCustomerIn servicePort = new Service().getBinding(); > > Client client = ClientProxy.getClient(servicePort); > > HTTPConduit http = (HTTPConduit) client.getConduit(); > > AuthorizationPolicy authPolicy = new AuthorizationPolicy(); > authPolicy.setUserName("some_user"); > authPolicy.setPassword("some_password"); > authPolicy.setAuthorizationType("Basic"); > > http.setAuthorization(authPolicy); > > try { > servicePort.checkMaintainBundleV1(request); > } catch (StandardFaultMessage_Exception e) { > e.printStackTrace(); > } > > And I got this log in the console > > Oct 3, 2012 5:42:03 PM > org.apache.cxf.service.factory.ReflectionServiceFactoryBean > buildServiceFromWSDL > INFO: Creating Service {http://sap.com/xi/A1S/Global}service from WSDL: > > file:/Users/damiansima/Documents/workspace/SAPSalesOnDemandClient/src/main/resources/schema/ManageCustomerIn1.wsdl > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/webas/710/soap/features/transportbinding/}OptimizedXMLTransfer > registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/webas/630/soap/features/session/}Session registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/webas/700/soap/features/CentralAdministration/}CentralAdministration > registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/NW05/soap/features/commit/}enableCommit registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/NW05/soap/features/blocking/}enableBlocking registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/NW05/soap/features/transaction/}required registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/NW05/soap/features/wsrm/}enableWSRM registered. > Oct 3, 2012 5:42:04 PM > org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl > handleNoRegisteredBuilder > WARNING: No assertion builder for type { > http://www.sap.com/710/soap/features/idempotency/}Idempotency registered. > 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:156) > at $Proxy30.checkMaintainBundleV1(Unknown Source) > at org.mule.sap.ondemand.core.Main.main(Main.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(EndpointPolicyImpl.java:165) > at > > org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyImpl.java:145) > at > > org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:141) > at > > org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:549) > at > > org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:295) > at > > org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:278) > at > > org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) > at > > org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:319) > at > org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:304) > at > > org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:250) > at > > org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) > at > > org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:235) > 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:846) > at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:527) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) > at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) > ... 2 more > > Here you can find the WSDL: > > http://cxf.547215.n5.nabble.com/None-of-the-policy-alternatives-can-be-satisfied-Exception-tt5710035.html#a5715640 > > > Now what I did to make this work was to remove from the WSDL all policies > listed in the console under warning (the ones with no assertion filter). > > Thing is it shouldn't be that the way is it? > > Is there a way I can fix this, is this the normal behavior. > > Cheers, Damian. > -- > Damián. > - )**** > > > > **** > > ** ** > > -- > Damián. > - )**** > -- Damián. > - )
