首页 > 解决方案 > 如何使用上下文路径来访问肥皂网络服务?

问题描述

我已经更改了属性文件中的上下文路径,之后当我尝试从 SOAPUI 访问 web 服务时,我得到空白页作为响应。所以,我给出了与 jboss-web 的上下文根中相同的值。 xml。尽管如此,面对同样的问题。

server.contextPath=/myvalue

<context-root>/myvalue</context-root>

我也对 SOAPWSConfig 类进行了一些更改。

@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
    MessageDispatcherServlet servlet = new MessageDispatcherServlet();
    servlet.setApplicationContext(applicationContext);
    servlet.setTransformWsdlLocations(true);
    return new ServletRegistrationBean(servlet,"/myvalue/*");
}

以下是我在骆驼路线中所做的更改以指向 URL:

from("spring-ws:uri:http://{{webservice.ipaddress}}:{{webservice.port}}/{{server.contextPath}}/CCSWebServiceBean/GetScheduleDetailsCCS?endpointMapping=#endpointMapping")    
.unmarshal(jaxb).process(ccsServiceProcessor).marshal(jaxb);
}

它使用默认的 contextPath 值。我用来从 SOAPUI 访问的 URL 是:

http://10.80.11.65:8080/myvalue/CCSWebServiceBean/GetScheduleDetailsCCS

请帮助解决这个问题。提前致谢。

标签: web-servicessoapcontextpath

解决方案


要处理端点标头/属性依赖,您应该使用“ recipientList ”。在蓝图中,它会是这样的:

<recipientList><simple>spring-ws:uri:http://{{webservice.ipaddress}}:{{webservice.port}}/{{server.contextPath}}/CCSWebServiceBean/GetScheduleDetailsCCS?endpointMapping=#endpointMapping</simple></recipientList>

同样适用于普通的 java 骆驼路线。


推荐阅读