gpt4 book ai didi

java - 必须了解 header http ://docs. oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd 检查失败:安全性

转载 作者:行者123 更新时间:2023-11-30 03:01:23 26 4
gpt4 key购买 nike

我正在使用 .net 中开发的 Web 服务,该服务接受用户名和密码作为 SOAP header 的一部分。我创建了 SOAPHandler 来创建 header 。

我打印了如下消息:

<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

<wsse:UsernameToken>
<wsse:Username>xxxxxxxxxxx</wsse:Username>
<wsse:Password>xxxxxxxx</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

当我点击该服务时,我收到以下错误。

[4/3/16 18:53:10:342 EET] 00000027 SystemErr     R javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: Must
> Understand check failed for header
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> : Security
> [4/3/16 18:53:10:343 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
> [4/3/16 18:53:10:343 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
> [4/3/16 18:53:10:343 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
> [4/3/16 18:53:10:343 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:586)
> [4/3/16 18:53:10:343 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:130)
> [4/3/16 18:53:10:344 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
> [4/3/16 18:53:10:344 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:391)
> [4/3/16 18:53:10:344 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:208)
> [4/3/16 18:53:10:344 EET] 00000027 SystemErr R at com.sun.proxy.$Proxy37.authenticateSP(Unknown Source)
> [4/3/16 18:53:10:344 EET] 00000027 SystemErr R at com.id3global.id3gws._2013._04.IGlobalAuthenticate_BasicHttpBindingGlobalAuthenticate_Client.main(IGlobalAuthenticate_BasicHttpBindingGlobalAuthenticate_Client.java:90)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at com.eeft.ws.ppd.EwalletBalanceInquiryWSBeanPortBindingImpl.ewalletBalanceInquiry(EwalletBalanceInquiryWSBeanPortBindingImpl.java:104)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611)
> [4/3/16 18:53:10:345 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:203)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:158)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:490)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:433)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.dispatchers.java.SessionDispatcher.invoke(SessionDispatcher.java:204)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:263)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:153)
> [4/3/16 18:53:10:346 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:263)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:263)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:1246)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:344)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> [4/3/16 18:53:10:347 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1700)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:970)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:508)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3994)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
> [4/3/16 18:53:10:348 EET] 00000027 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:516)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:307)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:278)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> [4/3/16 18:53:10:349 EET] 00000027 SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1662)
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R Caused by: org.apache.axis2.AxisFault: Must Understand check failed for header
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> : Security
> [4/3/16 18:53:10:350 EET] 00000027 SystemErr R at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:127)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:191)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:581)
> [4/3/16 18:53:10:351 EET] 00000027 SystemErr R ... 50 more

我删除了 Mustunderstand 标签并将值更改为零,但仍然出现相同的错误。

最佳答案

我错过了重写处理程序中的 getHeaders() 方法。下面的帖子帮助我添加了它开始工作的处理程序。

SOAPFaultException "MustUnderstand headers (oasis-200401-wss-wssecurity-secext-1.0.xsd) are not understood"

@Override 
public Set<QName> getHeaders() {
QName securityHeader = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
"Security");
HashSet<QName> headers = new HashSet<QName>();
headers.add(securityHeader);
return headers;
}

关于java - 必须了解 header http ://docs. oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd 检查失败:安全性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35843867/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com