2013-09-02 1 views
16

축/rampart가있는 webservice에 연결하고 있으며 prefixList가 허용되지 않는 InclusiveNamespaces를 제거하라는 메시지가 표시되었습니다. 어떻게해야합니까?axis/rampart 클라이언트에서 InclusiveNamespaces 사용 안 함

부분은 그것이 비어 때 inclusivenamespace를 인쇄하지 않도록 축/성벽를 구성 할 수 있습니다

<ds:SignedInfo> 
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> 
     <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa soapenv" /> 
    </ds:CanonicalizationMethod> 
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> 
    <ds:Reference URI="#Id-289005241"> 
     <ds:Transforms> 
      <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">    
       <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="" /> 
      </ds:Transform> 
     </ds:Transforms> 
     <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />       
     <ds:DigestValue>bla bla bla=</ds:DigestValue> 
    </ds:Reference> 
</ds:SignedInfo> 

처럼 보인다?

나는 축/성벽 1.6.2을 사용하고 있습니다 및 .NET 서비스

모든 아이디어를 어떻게 보관하는 방법에 연결? 아니면 비어 있지 않은 prefixList를 렌더링하도록 만드는 방법은 무엇입니까?

답변

1

원하지 않는 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> 
  • 당신은 갈 준비가되어야합니다. 맞춤 핸들러에 대한 추가 정보는 here을 참조하십시오.
+0

감사합니다. 비 WSI 불만 모드를 사용하여 해결했습니다. 나는 시간이있을 때 이것을 시도 할 것이다. 고맙습니다 – Perre