gpt4 book ai didi

java - SOAP Java Axis 错误 : MustUnderstand not understood

转载 作者:行者123 更新时间:2023-12-01 21:29:30 25 4
gpt4 key购买 nike

我们必须创建一个 WS 客户端来使用远程服务。使用 WSS$J 安全配置制作 ClientHandler,使用 Axis 从 eclipse 生成 WSClient。我收到此错误,但没有找到解决该问题的信息。有什么想法吗?

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s): {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext- 1.0.xsd}Security
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at uy.gub.dgi.WS_eFacturaSoapBindingStub.EFACRECEPCIONSOBRE(WS_eFacturaSoapBindingStub.java:306)
at com.justinfact.web.ws.EFacturaClient.main(EFacturaClient.java:51)

{http://xml.apache.org/axis/}hostname:jirazazabal-pc

Did not understand "MustUnderstand" header(s):{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at uy.gub.dgi.WS_eFacturaSoapBindingStub.EFACRECEPCIONSOBRE(WS_eFacturaSoapBindingStub.java:306)
at com.justinfact.web.ws.EFacturaClient.main(EFacturaClient.java:51)
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s): {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext- 1.0.xsd}Security
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at uy.gub.dgi.WS_eFacturaSoapBindingStub.EFACRECEPCIONSOBRE(WS_eFacturaSoapBindingStub.java:306)
at com.justinfact.web.ws.EFacturaClient.main(EFacturaClient.java:51)

{http://xml.apache.org/axis/}hostname:jirazazabal-pc

Did not understand "MustUnderstand" header(s):{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at uy.gub.dgi.WS_eFacturaSoapBindingStub.EFACRECEPCIONSOBRE(WS_eFacturaSoapBindingStub.java:306)
at com.justinfact.web.ws.EFacturaClient.main(EFacturaClient.java:51)

SOAP 请求似乎没问题,但出现此错误。 SOAP 的 header 如下:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
mlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<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:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="X509-47B7B0AB8DD8408E9814649487947394">
MIIFhDCCA2ygAwIBAgIQUR762xXMDeJWWLNGuZSuszANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJVWTErMCkGA1UECgwiQURNSU5JU1RSQUNJT04gTkFDSU9OQUwgREUgQ09SUkVPUzEfMB0GA1UECwwWU0VSVklDSU9
TIEVMRUNUUk9OSUNPUzEdMBsGA1UEAwwUQ29ycmVvIFVydWd1YXlvIC0gQ0EwHhcNMTUxMTI3MTk0NzE4WhcNMTYxMTI3MTk0NzE4WjCBmzEmMCQGCSqGSIb3DQEJARYXdml0YW1pbmljby4wNUBnbWFpbC5jb20xEzARBg
NVBAoMClZJVEFNSU5JQ08xEzARBgNVBAgMCk1vbnRldmlkZW8xCzAJBgNVBAYTAlVZMRgwFgYDVQQFEw9SVUMyMTUyMTcxOTAwMTUxIDAeBgNVBAMMF1ZJTkFMUyBJVkFOSUNIIExFT05BUkRPMIGfMA0GCSqGSIb3DQEBA
QUAA4GNADCBiQKBgQC6LdZWhEJaqiFaZb1VG+o7aEckJT4hkFfTj1FqfBzbS/Ug4uXcESdmOahQPVCpJcG8jgW6HuCO1dlQ9P0Qwsxk+zjCHe+Bm4+lnFQfcn1ClMvkGJzAxE/HJb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5bFXW6YjeTNBDm60o4bTTFLLbfO1LZIM8JpubIzsE7+c4Ph4FTuW/HxOE8F8HkLk0X1bxf4o1Did3pDjXDlIafi66//F7z5gf8xJeams5/w7ToikOmW+pjpLolOT64RvY0WjQs5/FdEXu+7i
vjrOk5xRzxdnKLIr9vUOYyFfE0627yA2mS8+uUWy41BISdsXI6z
</wsse:BinarySecurityToken>

最佳答案

我以前有时遇到过这样的问题,我通过执行以下操作来解决它:

   public String callWS(String arg1 ,String arg2){
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("web service URL");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
//pay attention to line below
_call.setProperty(org.apache.axis.client.Call.CHECK_MUST_UNDERSTAND, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://zzzzz", "xxxx"));
setRequestHeaders(_call);
setAttachments(_call);

Object _resp = _call.invoke(new Object[] {arg1,arg2});
return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);

}

注意这一行:

_call.setProperty(org.apache.axis.client.Call.CHECK_MUST_UNDERSTAND, Boolean.FALSE);

希望它对你有用:)

关于java - SOAP Java Axis 错误 : MustUnderstand not understood,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37617120/

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