简体   繁体   English

Apache CXF(带有spring boot)如何返回原始WSDL文件(不是cxf生成)?

[英]Apache CXF(with spring boot) How can I return original WSDL file(not generated by cxf)?

I have WSDL and XSD schemas. 我有WSDLXSD模式。 I generate java classes and service interface from it with CXF . 我用CXF从中生成java classesservice interface

I create SOAP endpoint with CXF: 我用CXF创建SOAP端点:

@Bean
Endpoint endpoint() {
    EndpointImpl endpoint = new EndpointImpl(bus, myEndpoint);
    endpoint.publish(path);
    return endpoint;
}

When I open service URl I get generated WSDL but I need Original WSDl. 当我打开服务URl时,会生成WSDL,但是我需要原始的WSDl。

How can I return original WSDL and not generated? 如何返回original WSDL而不生成?

AFAIK, it seems not doable (or not quite easy) as Apache CXF publishes a WS endpoint based on its implementation (and/or relevant generated sources for XML schemas). AFAIK,这似乎不可行(或不太容易),因为Apache CXF根据其实现(和/或XML模式的相关生成源)发布WS端点。 CXF does not directly used the WSDL and XSDs, and therefore, the endpoint's WSDL might be a tad different from the original WSDL. CXF没有直接使用WSDL和XSD,因此,端点的WSDL可能与原始WSDL有所不同。

I have used cxf-codegen-plugin to generate Java code from WSDL+XSD, then implemented the business logics of each service and publish them using Apache CXF <jax-ws> . 我使用cxf-codegen-plugin从WSDL + XSD生成Java代码,然后实现了每个服务的业务逻辑,并使用Apache CXF <jax-ws>发布它们。 The generated code are well annotated so that it seems JAX-WS can use these annotations to produce very close results. 生成的代码具有很好的注释,因此JAX-WS似乎可以使用这些注释产生非常接近的结果。 The published WSDLs are only slightly different from the original WSDLs but hard to notice if not expert. 已发布的WSDL与原始WSDL仅略有不同,但如果不是专家则很难注意到。 You can find the project's source here: https://github.com/htr3n/loan-approval-portal . 您可以在这里找到项目的源代码: https : //github.com/htr3n/loan-approval-portal

Perhaps, the closest you might have is using Spring WS with <static-wsdl> . 也许,最接近的方法是将Spring WS与<static-wsdl>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM