如何为Spring Integration Web Service入站网关配置uri地址?

时间:2017-01-13 04:20:43

标签: web-services spring-integration

您知道如何为Spring Integration Web Service入站网关配置uri吗?目前,我必须使用defaultEndpoint。

这是我的配置:

<ws:inbound-gateway id="inbound-gateway" request-channel="requestChannel" reply-channel="responseChannel" marshaller="hrMarshaller" unmarshaller="hrMarshaller"></ws:inbound-gateway>

 <bean class="org.springframework.ws.server.endpoint.mapping.UriEndpointMapping">
    <property name="defaultEndpoint" ref="inbound-gateway"/>
</bean>

我已阅读Spring Integration,入站网关,但没有理解。

当我有2个入站网关时,我需要做什么?

谢谢你,最诚挚的问候,

1 个答案:

答案 0 :(得分:1)

哦,这很简单!

对于@Bean

@Bean
public UriEndpointMapping uriEndpointMapping() {
    UriEndpointMapping uriEndpointMapping = new UriEndpointMapping();
    uriEndpointMapping.setUsePath(true);
    Map<String, Object> map = new HashMap<>();
    map.put("/ws/abc", "cas-inbound-gateway");
    uriEndpointMapping.setEndpointMap(map);
    return uriEndpointMapping;
}

对于XML

<bean class="org.springframework.ws.server.endpoint.mapping.UriEndpointMapping">
    <property name="usePath"  value="true"/>
    <property name="endpointMap">
        <map>
            <entry key="/ws/abc" value="cas-inbound-gateway"></entry>
        </map>
    </property>
</bean>

@ - @