WSP0075: Policy assertion “TransportBinding” was evaluated as “UNKNOWN”. Why?

后端 未结 4 1750
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 00:27

I am a client to a SOAP service I do not control (implemented in .NET). The service provides a WSDL. I use Apache CXF to generate the java client from the WSDL (specifically, I

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-19 01:17

    Through guesswork and looking at artifacts in maven central, I was able to hit upon a solution.

    It turns out that in order to actually understand and evaluate the policy in this wsdl, a missing runtime dependency must be provided. For me it was org.apache.cxf/cxf-rt-frontend-jaxws. I could not find this documented anywhere. This pulls in a number of other cxf dependencies and I don't know if a more minimal set of them is ok.

    Once I include this dependency, I no longer get a warning when I instantiate the client object. (Also, instantiation takes much longer!)

    However, when I try to use the service I get an exception:

    javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied.
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159)
        ...
    

    This is most likely for the reason that Willie Wheeler's answer pointed out: the policy requires 256 bit encryption on the transport, but this service's SSL is using 128 bit encryption. However, using a wsdl with Base128 instead does not resolve this exception and I did not investigate further.

    So it's quite possible that everyone who uses this service probably gets this warning or something like it, and it's impossible to use this service if the security policy is actually checked. I guess I will be living with the warning instead.

提交回复
热议问题