我正在尝试在Spring中定义服务接口bean的'handlerResolver'属性。我需要将两个处理程序的列表传递给属性。我已经尝试过各种组合,但目前却遇到此错误:

原因:java.lang.IllegalStateException:无法将属性“ handlerResolver”的[java.util.ArrayList]类型的值转换为所需的类型[javax.xml.ws.handler.HandlerResolver]:未找到匹配的编辑器或转换策略

我的定义如下:

<bean id="CustomerOffers_Service" class="com.td.springframework.ext.JaxWsPortProxyFactoryBean"
    scope="singleton">
    <property name="serviceName">
        <value>CustomerOffersService</value>
    </property>
    <property name="namespaceUri">
        <value>urn:wsc.td.com/cco/wsdl/2011/05/01</value>
    </property>
    <property name="serviceInterface">
        <value>com.td.wsc.cco.ns20110501.CustomerOffers</value>
    </property>
    <property name="connectionTimeout">
        <value>${cco.connectionTimeout}</value>
    </property>
    <property name="writeTimeout">
        <value>${cco.writeTimeout}</value>
    </property>
    <property name="responseTimeout">
        <value>${cco.responseTimeout}</value>
    </property>
    <property name="jaxbContext">
        <value>com.td.wsc.cco.ns20110501.xml</value>
    </property>
    <property name="portName">
        <value>SoapPort_20110501</value>
    </property>
    <property name="useEnvName">
        <value>true</value>
    </property>
    <property name="endpointAddress">
        <value>${com.td.wsc.cco.ns20110501_HOSTNAME}</value>
    </property>
    <property name="handlerResolver">
      <list>
          <ref bean="com_td_dcc_wss_off_OfferHandlerResolver"/>
          <ref bean="com_td_wsc_prs_ns20100601-HandlerResolver"/>
      </list>
    </property>
</bean>

<bean id="com_td_dcc_wss_off_OfferHandlerResolver" class="com.td.wss.dcc.off.v1.OfferHandlerResolver"/>

<bean id="com_td_wsc_prs_ns20100601-HandlerResolver" lazy-init="true" class="com.td.wau.waux.jws.HandlerResolverBean">
    <property name="handlers">
        <list>
            <ref local="com_td_wau_waux_jws_OutboundHeaderHandler-Handler" />
        </list>
    </property>
</bean>

<bean id="com_td_wau_waux_jws_OutboundHeaderHandler-Handler" lazy-init="true" class="com.td.wau.waux.jws.OutboundHeaderHandler">
    <property name="enableTraceabilityId">
        <value>true</value>
    </property>
    <property name="enableConsumerAppId">
        <value>true</value>
    </property>
</bean>

最佳答案

bean的handlerResolver属性不是List类型,而是HandlerResolver类型,因此尝试将其配置为XML中的列表是失败的。

07-28 00:10