Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在axis/rampart客户端中禁用InclusiveNamespaces_Java_Axis2_Ws Security_Rampart - Fatal编程技术网

Java 在axis/rampart客户端中禁用InclusiveNamespaces

Java 在axis/rampart客户端中禁用InclusiveNamespaces,java,axis2,ws-security,rampart,Java,Axis2,Ws Security,Rampart,我正在使用axis/rampart连接到一个Web服务,并被告知删除InclusiveNamespaces,因为前缀列表为“”,这是不允许的。我该怎么做 这部分看起来像 呜呜呜呜= 是否可以将axis/rampart配置为在inclusivenamespace为空时不打印 我正在使用axis/rampart 1.6.2并连接到.NET服务 你知道如何存档吗?或者如何使其呈现非空前缀列表?您必须添加自定义处理程序来过滤不需要的xml标记 自定义处理程序: package com.per

我正在使用axis/rampart连接到一个Web服务,并被告知删除InclusiveNamespaces,因为前缀列表为“”,这是不允许的。我该怎么做

这部分看起来像

呜呜呜呜=
是否可以将axis/rampart配置为在inclusivenamespace为空时不打印

我正在使用axis/rampart 1.6.2并连接到.NET服务


你知道如何存档吗?或者如何使其呈现非空前缀列表?

您必须添加自定义处理程序来过滤不需要的xml标记

自定义处理程序:

    package com.perre;

        public class InclusiveNamespacesFilter extends AbstractHandler {

        public InvocationResponse invoke(MessageContext ctx) throws AxisFault {

            SOAPEnvelope msgEnvelope = ctx.getEnvelope();
            SOAPHeader msgHeader = msgEnvelope.getHeader();

            Iterator theDescendants = msgHeader.getDescendants(true);
            while(theDescendants.hasNext()){

                Object o = theDescendants.next();

                 //here, add your code to traverse DOM and get the node to filter 
                 //...
                 Node aNode = ele.getElementsByTagName("ec:InclusiveNamespacesFilter").item(0);
                 if(aNode != null){
                            ele.removeChild(aNode);
                 }
            }
            return InvocationResponse.CONTINUE;
        }
编辑axis2.xml并声明处理程序:

 <phase name="PostSecurity">
      <handler name="FilterHandler" class="com.perre.InclusiveNamespacesFilter"/> 
 </phase>

  • 你应该准备好出发了。查找有关自定义处理程序的更多阅读资料

谢谢,我使用非WSI投诉模式解决了这个问题。当我有时间的时候,我会试试这个。非常感谢。
 <phase name="PostSecurity">
      <handler name="FilterHandler" class="com.perre.InclusiveNamespacesFilter"/> 
 </phase>