【问题标题】:How to configure uri address for Spring Integration Web Service inbound-gateway?如何为 Spring Integration Web Service 入站网关配置 uri 地址?
【发布时间】:2017-01-13 04:20:43
【问题描述】:

你知道如何为 Spring Integration Web Service inbound-gateway 配置 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, inbound gateway,但没看懂。

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

谢谢你和最好的问候,

【问题讨论】:

    标签: web-services spring-integration


    【解决方案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>
    

    @-@

    【讨论】:

      猜你喜欢
      • 2016-05-07
      • 1970-01-01
      • 2017-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多