简体   繁体   中英

Apache CXF wsdl response issue

I am trying to do a POC where I am not able to change where the soap client gets their WSDL definition. This soap client has a ".wsdl" hardcoded in their code when they instantiate the service I am POCing. To start I have a pretty simple service, basically, a hello world which can be found here: https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jaxws_spring_boot/src/main/java/sample/ws

The issue I am having is that I can't figure out how to configure jaxws or apache CXF to switch the WSDL URL response from http://localhost:8080/Service/Hello?wsdl to http://localhost:8080/Service/Hello.wsdl

I removed the metrics part from the example above and my WebServiceConfig looks like this:

@Bean
public Endpoint endpoint() {
    EndpointImpl endpoint = new EndpointImpl(bus, new HelloPortImpl());
    endpoint.publish("/Hello");
    return endpoint;
}

Is there any way to get apache CXF to respond with the WSDL document from localhost/<myservice>.wsdl instead of localhost/<myservice>?wsdl

I feel like I am missing something really obvious.

The easiest thing is probably to issue a redirect or if the client doesn't honor that configure a rewrite rule.

You can also switch from a code first approach to a contract (WSDL) first approach and save the WSDL document somewhere else.

?wsdl is hard-coded in several places inside CXF and therefore not just a configuration to change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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