Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.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
Spring integration Spring集成-需要映射SOAP头_Spring Integration_Spring Ws - Fatal编程技术网

Spring integration Spring集成-需要映射SOAP头

Spring integration Spring集成-需要映射SOAP头,spring-integration,spring-ws,Spring Integration,Spring Ws,在spring int 4.1中,我让标题映射器工作得很好,如下所示: 当我尝试升级到SpringInt4.2时,不允许使用头映射器。我之所以需要它,是因为我需要映射soap安全头。但我认为,如果不指定soapHeaderMapper,就不会映射它。请注意,我确实有以下上游来拦截soap请求,我非常确定拦截器没有删除soap头。如果您需要完整的配置,请告诉我 无操作 这仍然有效 为什么您认为标题映射器被忽略 我们有以下测试配置: <ws:inbound-gateway id="h

在spring int 4.1中,我让标题映射器工作得很好,如下所示:



当我尝试升级到SpringInt4.2时,不允许使用头映射器。我之所以需要它,是因为我需要映射soap安全头。但我认为,如果不指定soapHeaderMapper,就不会映射它。请注意,我确实有以下上游来拦截soap请求,我非常确定拦截器没有删除soap头。如果您需要完整的配置,请告诉我


无操作

这仍然有效

为什么您认为
标题映射器被忽略

我们有以下测试配置:

<ws:inbound-gateway id="headerMappingGateway" request-channel="headerMappingRequests"
        header-mapper="testHeaderMapper"/>
因此,一切都应该像SpringIntegration4.1一样工作

否则,请共享测试用例以进行复制

我们感谢任何反馈


另外,我看到,当然,我们有一个XSD未命中键入预期的和真正允许的。但这并不妨碍使用任何可能的自定义
SoapHeaderMapper
实现。

Artem,感谢您的及时回复。你说得对,它正在工作。我认为这不是因为Eclipse正在使用以下架构位置验证XSD,该位置似乎不允许标头映射器:。当将xsd更改为指向4.1时,我还有其他验证问题。事后看来,我应该使用纯Java配置,而不是处理这个XML,这有点混乱(如果我在混合中添加kafka、mongo db)。
@Autowired
private SimpleWebServiceInboundGateway headerMappingGateway;

@Autowired
private SoapHeaderMapper testHeaderMapper;

@Test
public void testHeaderMapperReference() throws Exception {
    DirectFieldAccessor accessor = new DirectFieldAccessor(headerMappingGateway);
    Object headerMapper = accessor.getPropertyValue("headerMapper");
    assertEquals(testHeaderMapper, headerMapper);
}