有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

spring soap端点中未解析java soap头

<soapenv:Header>
<auth:Authentication xmlns:auth="https://memorynotfound.com/security">
     <auth:username>username</auth:username>
     <auth:password>password</auth:password>
  </auth:Authentication>
</soapenv:Header>

当我在端点方法中处理请求头时,它无法工作。但当我在身份验证中设置小写字母“a”时工作。 以下是结束点片段:

@RequestPayload GetStudentRequest request, @SoapHeader("{" + Authentication.AUTH_NS + "}authentication") SoapHeaderElement auth


共 (1) 个答案

  1. # 1 楼答案

    只需在header类的顶部添加以下代码段@annotation值。希望有帮助

    @XmlRootElement(namespace = "http://www.gooogle.com", name = "Authentication")
    public class Authentication{
    .....
    }