当前位置: 首页 > 知识库问答 >
问题:

CXF webservice客户端抛出IllegalArgumentExc0019算法套件"Basic128Exn256"未注册

姜志
2023-03-14

寻找关于CXF webservice客户端的指导

Cxf版本:3.2.1 Web service client是一个独立的java程序。没有配置web服务器。

我有来自服务提供商的wsdl文件

<sp:AlgorithmSuite>
   <wsp:Policy>
      <sp:Basic128Exn256/>
   </wsp:Policy>
</sp:AlgorithmSuite>

内<代码>

然而,当启动cxf客户机时,我会遇到如下异常

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Algorithm suite "Basic128Exn256" is not registered
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
    at com.sun.proxy.$Proxy50.importAndLoadData(Unknown Source)
    at temp.test.SoapServiceTest.main(SoapServiceTest.java:70)
Caused by: java.lang.IllegalArgumentException: Algorithm suite "Basic128Exn256" is not registered
    at org.apache.cxf.ws.security.policy.custom.AlgorithmSuiteBuilder.build(AlgorithmSuiteBuilder.java:68)
    at org.apache.cxf.ws.security.policy.custom.AlgorithmSuiteBuilder.build(AlgorithmSuiteBuilder.java:37)
    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.getPolicyOperator(PolicyBuilder.java:174)
    at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:108)
    at org.apache.wss4j.policy.builders.SymmetricBindingBuilder.build(SymmetricBindingBuilder.java:44)
    at org.apache.wss4j.policy.builders.SymmetricBindingBuilder.build(SymmetricBindingBuilder.java:34)
    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:464)
    at org.apache.cxf.ws.policy.EndpointPolicyImpl.initializePolicy(EndpointPolicyImpl.java:152)
    at org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:140)
    at org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:604)
    at org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:316)
    at org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:303)
    at org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61)
    at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:325)
    at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:345)
    at org.apache.cxf.transport.http.HTTPConduit.getClient(HTTPConduit.java:879)
    at org.apache.cxf.transport.http.HTTPConduit.configureConduitFromEndpointInfo(HTTPConduit.java:367)
    at org.apache.cxf.transport.http.HTTPConduit.finalizeConfig(HTTPConduit.java:447)
    at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:248)
    at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:226)
    at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:233)
    at org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:146)
    at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:108)
    at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
    at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:853)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:511)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)

同样的wsdl,当我编写一个没有cxf的纯jax ws客户机时,它也能工作。任何帮助都将不胜感激

共有1个答案

华懿轩
2023-03-14

"Basic128Exn256"不是规范中定义的标准算法套件。如果你想在CXF中支持它,你必须编写一个自定义算法套件(例如http://coheigea.blogspot.ie/2011/09/specifying-custom-algorithmsuite.html)

 类似资料:
  • 本规范不排除使用未注册的客户端。然而,使用这样的客户端超出了本规范的范围,并需要额外的安全性分析并审查其互操作性影响。

  • 我有一个Spring启动1.5.1服务和一个Spring启动管理2.0.1。 考虑到这个留档(http://codecentric.github.io/spring-boot-admin/2.0.0/#monitoring-spring-boot-1.5.x),它们是兼容的。 这是我的客户端设置 我的入口 build.gradle 应用yml 对于服务器设置,我遵循了这里的入门指南http://c

  • 我正在使用VisualStudio。NET4.6和Robomongo连接到我的数据库没有问题 我的进口为MongoDB 正在执行的代码: 完整错误消息: 类型System的未处理异常。出现在mscorlib.dll 其他信息:无法加载文件或程序集System.运行时。InteropServices.RuntimeInformation,Version=4.0.0.0,区域性=中性,PublicKe

  • 我需要多次调用服务(>50次)并聚合响应。因此,我决定使用,使用Async和CustomExecuter(它自己的线程池)来提高速度,而不是等待服务响应。 我在类路径上使用带有ApacheHTTP和Hystrix的feign客户机。我可以看到它有时是工作的,有时我得到例外,因为电路是开放的。

  • 在开始协议前,客户端在授权服务器注册。客户端在授权服务器上注册所通过的方式超出了本规范,但典型的涉及到最终用户与HTML注册表单的交互。 客户端注册不要求客户端与授权服务器之间的直接交互。在授权服务器支持时,注册可以依靠其他方式来建立信任关系并获取客户端的属性(如重定向URI、客户端类型)。例如,注册可以使用自发行或第三方发行声明或通过授权服务器使用信任通道执行客户端发现完成。 当注册客户端时,客

  • 我正在使用具有以下配置的Redisson连接到哨兵服务器: