与Wss4jSecurityInterceptor的PayloadRootQNameEndpointMapping导致SOAPProcessingException [英] PayloadRootQNameEndpointMapping with Wss4jSecurityInterceptor causing SOAPProcessingException

查看:123
本文介绍了与Wss4jSecurityInterceptor的PayloadRootQNameEndpointMapping导致SOAPProcessingException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下配置,通过Wss4jSecurityInterceptor对PayloadRootQNameEndpointMapping

I am using below configuration, for PayloadRootQNameEndpointMapping with Wss4jSecurityInterceptor

<bean id="endpointMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    <property name="mappings">
        <props>
            <prop key="{http://com/clickandbuy/mywebservice/}employeeById_Request">serviceEndPoint</prop>
            <prop key="{http://com/clickandbuy/mywebservice/}employeeByFile_Request">serviceEndPoint</prop>
            <prop key="{http://com/clickandbuy/mywebservice/}employeeBySecurity_Request">serviceEndPoint</prop>
        </props>
    </property>
    <property name="interceptors">
        <list>
            <bean class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor"/>
            <ref local="wsSecurityInterceptor"/> 
        </list>
    </property>
</bean>

<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="validationActions" value="UsernameToken" />
    <property name="validationCallbackHandler" ref="springSecurityHandler" />
</bean>

<bean id="springSecurityHandler"
  class="org.springframework.ws.soap.security.wss4j.callback.SpringPlainTextPasswordValidationCallbackHandler">
    <property name="authenticationManager" ref="authenticationManager"/>
</bean>

如果未提供拦截器,

 <!--<ref local="wsSecurityInterceptor"/> -->

工作正常.但是,如果上面的行处于活动状态,即提供了拦截器,则会出现错误

It works fine. But if above line is active, that is interceptor is provided, it gives error

.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder:316||||>> Starting to process SOAP          1.1 message 
<<||2013-07-13 22:36:57,922||http-apr-8080-exec-      35|DEBUG|org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder:273||||>> Build the    OMElement Envelope by the StaxSOAPModelBuilder 
<<||2013-07-13 22:36:57,923||http-apr-8080-exec-35|DEBUG|org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder:273||||>> Build the OMElement Header by the StaxSOAPModelBuilder 
<<||2013-07-13 22:36:57,923||http-apr-8080-exec-35|DEBUG|org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder:273||||>> Build the OMElement Security by the StaxSOAPModelBuilder 
<<||2013-07-13 22:36:57,924||http-apr-8080-exec-35|DEBUG|org.springframework.ws.server.MessageDispatcher:273||||>> Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter@6e369c05] 
<<||2013-07-13 22:36:57,925||http-apr-8080-exec-35|DEBUG|org.apache.axiom.soap.impl.llom.SOAPHeaderImpl:426||||>>     org.apache.axiom.soap.SOAPProcessingException: An attempt was made to add a normal OMEl    ement as a child of a SOAPHeader.  This is not supported.  The child should be a   SOAPHeaderBlock.
at org.apache.axiom.soap.impl.llom.SOAPHeaderImpl.addChild(SOAPHeaderImpl.java:423)

如果有问题或使用Wss4jSecurityInterceptor配置spring-ws PayloadRootQNameEndpointMapping的任何正确方法,请分享

Please share if something is wrong, or any proper way to configure spring-ws PayloadRootQNameEndpointMapping with Wss4jSecurityInterceptor

谢谢

推荐答案

我认为spring-ws 1.5.6版本存在一些错误,我切换到了2.0.0版本,并且工作正常

I think there was some error with spring-ws 1.5.6 version, I switched to version 2.0.0 and it works fine

这篇关于与Wss4jSecurityInterceptor的PayloadRootQNameEndpointMapping导致SOAPProcessingException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆