Spring integration UriEndpointmapping使用属性setendpointmapping-Spring集成ws

Spring integration UriEndpointmapping使用属性setendpointmapping-Spring集成ws,spring-integration,spring-ws,Spring Integration,Spring Ws,我正在尝试使用具有以下值的hashmap设置对象UriEndpointmapping的属性setendpointmapping: UriEndpointMapping uriEndpointMapping = new UriEndpointMapping(); Map<String,Object> endpointMap = new HashMap<>(); endpointMap.put("/miservicio/cliente", gateway); endpoint

我正在尝试使用具有以下值的hashmap设置对象UriEndpointmapping的属性setendpointmapping:

UriEndpointMapping uriEndpointMapping = new UriEndpointMapping();
Map<String,Object> endpointMap = new HashMap<>();
endpointMap.put("/miservicio/cliente", gateway);
endpointMap.put("/miservicio/cliente.wsdl", wsdlDefinition());
uriEndpointMapping.setEndpointMap(endpointMap);
UriEndpointMapping UriEndpointMapping=new UriEndpointMapping();
Map endpointMap=newhashmap();
endpointMap.put(“/miservicio/cliente”,网关);
put(“/miservicio/cliente.wsdl”,wsdlDefinition());
uriEndpointMapping.setEndpointMap(endpointMap);
其中:gateway是int-ws:inbound-gateway类型的bean wsdlDefinition是返回DefaultWsdl11Definition的方法


因此,当我从localhost:8080/miservicio/cliente.wsdl的浏览器调用时,没有收到响应。因此,我应该如何操作它?

您对
UriEndpointMapping
逻辑有点误解:

 * Implementation of the {@code EndpointMapping} interface to map from the full request URI or request URI path to
 * endpoint beans.
WSDL定义逻辑有点不同,它就像
MessageDispatcherServlet
启动逻辑的一部分:

private void initWsdlDefinitions(ApplicationContext context) {
    wsdlDefinitions = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(context, WsdlDefinition.class, true, false);
传入请求的WSDL选择逻辑如下所示:

protected WsdlDefinition getWsdlDefinition(HttpServletRequest request) {
    if (HttpTransportConstants.METHOD_GET.equals(request.getMethod()) &&
            request.getRequestURI().endsWith(WSDL_SUFFIX_NAME)) {
        String fileName = WebUtils.extractFilenameFromUrlPath(request.getRequestURI());
        return wsdlDefinitions.get(fileName);
    }
    else {
        return null;
    }
}
让我们从Spring WS文档中获取一些示例:

<sws:dynamic-wsdl id="holiday"    
    portTypeName="HumanResource"
    locationUri="/holidayService/"
    targetNamespace="http://mycompany.com/hr/definitions"> 
  <sws:xsd location="/WEB-INF/hr.xsd"/>
</sws:dynamic-wsdl>

这句话:

id确定可以在其中检索WSDL的URL。在本例中,id为holiday,这意味着WSDL可以在servlet上下文中作为holiday.WSDL进行检索。完整的URL通常是