> On Sep 16, 2016, at 10:09 AM, Akanksha Agrawal <akanksha....@gmail.com> wrote: > > Thanks Daniel. > > Here https://www.w3.org/Submission/WS-Policy/#Optional_Policy_Assertions > <https://www.w3.org/Submission/WS-Policy/#Optional_Policy_Assertions> > > Section 4.3.3 says: > > Empty > <wsp:ExactlyOne /> expresses a policy with zero policy alternatives.
Right. There are NO alternatives that can be used. No behavior is admissible. > I think this means, this is a valid policy assertion. > Also, the web service which I am trying to invoke is getting invoked from > other SOAP Clients like SOAP UIand Boomerang but I am unable to invoke > using CXF Client. Thus getting error on the CXF client side itself. > The actual web service which I am trying to invoke is exposed by SAP and it > is not giving any error if I invoke it using other SOAP Clients like SOAP > UI or Boomerang. Just because other clients can work with invalid policies does not mean CXF should. The ExactlyOne should be removed from that policy (or an All added as a child). Dan > This is the actual policy which is attached to the SAP web service: > <wsp:Policy wsu:Id="BN_ZRPMATERIAL"><!-- Exactly One is empty here > --><wsp:ExactlyOne > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy > <http://schemas.xmlsoap.org/ws/2004/09/policy>" xmlns:sapsp=" > http://www.sap.com/webas/630/soap/features/security/policy > <http://www.sap.com/webas/630/soap/features/security/policy>"xmlns:sp=" > http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702 > <http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702>" xmlns:wsa=" > http://www.w3.org/2005/08/addressing <http://www.w3.org/2005/08/addressing>" > xmlns:wsu=" > http://schemas.xmlsoap.org/ws/2002/07/utility > <http://schemas.xmlsoap.org/ws/2002/07/utility>"/> > <saptrnbnd:OptimizedXMLTransferxmlns:saptrnbnd=" > http://www.sap.com/webas/710/soap/features/transportbinding/ > <http://www.sap.com/webas/710/soap/features/transportbinding/>" uri=" > http://xml.sap.com/2006/11/esi/esp/binxml > <http://xml.sap.com/2006/11/esi/esp/binxml>" wsp:Optional="true"/> > </wsp:Policy> > If the service is getting invoked from other SOAP Clients, can we not > invoke it using CXF Client as well? > Please let me know if my understanding is wrong about this. > Thanks, > Akanksha > > On Fri, Sep 16, 2016 at 6:23 AM, Daniel Kulp <dk...@apache.org > <mailto:dk...@apache.org>> wrote: >> >> According to the WS-Policy spec: >> >> http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf >> <http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf> < > http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf > <http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf>> >> >> Section 4.1: >> >> /wsp:Policy/wsp:ExactlyOne A collection of policy alternatives. If there > are no Element Information Items in the [children] property, there are no > admissible policy alternatives, i.e., no behavior is admissible. >> >> Thus, I believe the current behavior is correct. >> >> >> Dan >> >> >> >>> On Sep 16, 2016, at 6:47 AM, Akanksha Agrawal <akanksha....@gmail.com> > wrote: >>> >>> Hello folks, >>> >>> I am trying to invoke a web service having the following policy attached: >>> >>> https://gist.github.com/Akanksha08/8acdeaf4467fc06c29a6d4f9f7f2a19d >>> >>> I am getting the following Exception: >>> >>> javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives >>> can be satisfied. >>> at org.apache.cxf.jaxws.DispatchImpl.mapException(DispatchImpl.java:290) >>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:334) >>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:246) >>> at com.ws.cxf.client.SOAPClient.invokeService(SOAPClient.java:71) >>> at com.ws.cxf.client.SOAPClient.main(SOAPClient.java:42) >>> 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:166) >>> 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:584) >>> at > org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:313) >>> at > org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:294) >>> at > org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) >>> at > org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:316) >>> at > org.apache.cxf.transport.http.HTTPConduit.getClient(HTTPConduit.java:850) >>> at > org.apache.cxf.transport.http.HTTPConduit.configureConduitFromEndpointInfo(HTTPConduit.java:347) >>> at > org.apache.cxf.transport.http.HTTPConduit.finalizeConfig(HTTPConduit.java:427) >>> at > org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:242) >>> at > org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:222) >>> at > org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:229) >>> at > org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:145) >>> at > org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:107) >>> at > org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) >>> at > org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:849) >>> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:509) >>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) >>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) >>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) >>> at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:314) >>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:327) >>> ... 3 more >>> >>> Could anyone please look into it? >>> >>> Thanks, >>> Akanksha >> >> -- >> Daniel Kulp >> dk...@apache.org <mailto:dk...@apache.org> <mailto:dk...@apache.org >> <mailto:dk...@apache.org>> - http://dankulp.com/blog >> <http://dankulp.com/blog> < > http://dankulp.com/blog <http://dankulp.com/blog>> >> Talend Community Coder - http://coders.talend.com >> <http://coders.talend.com/> < > http://coders.talend.com/ <http://coders.talend.com/>> -- Daniel Kulp dk...@apache.org <mailto:dk...@apache.org> - http://dankulp.com/blog <http://dankulp.com/blog> Talend Community Coder - http://coders.talend.com <http://coders.talend.com/>