Output Spring-WS生成的WSDL位置



这对我来说似乎是一个简单的问题:

我有一个自动生成Spring-WS WSDL的项目,如下所示:

<sws:dynamic-wsdl id="service"                                                           
    portTypeName="Service"                                                         
    locationUri="/Service/"                                                       
    targetNamespace="http://location.com/Service/schemas/Mos">                               
        <sws:xsd location="classpath:/META-INF/Service.xsd"/>                                                  
</sws:dynamic-wsdl> 

是否有一种方法,在应用程序上下文启动时,输出生成的wsdl地址,包括上下文,位置等?如果我们的集成测试开始失败,这将很方便,我们可以看到WSDL的位置是否已经更改。

据我所知,您可以在http://yourHost/yourServletContext/beanId.wsdl找到WSDL。在你的例子中,beanId是'service'。

查看3.7。在Spring-WS文档中发布WSDL,以获得有关此主题的更多信息。

如果您也打算公开XSD,那么将使用beanId.xsd(或者,在我的例子中是@Configuration类中的方法名)格式。例如:

private ClassPathResource exampleXsdResource = new ClassPathResource("example.xsd");
@Bean public SimpleXsdSchema example() {
    return new SimpleXsdSchema(exampleXsdResource);
}

这暴露了http://yourHost/yourServletContext/example.xsd的XSD

最新更新