简体   繁体   中英

Apache CXF wsdl2java: make service return original WSDL file

I am struggling big time offering a web service based on some WSDL file received from a customer. As described in details here , the WSDL file returned when appending a ?wsdl to the service URL like

http://never.mind/SomeService?wsdl

seems to be misinterpreted by SoapUI and this again prevents the customer from using the service!

I was now hoping that someone could help me understand if it is possible to make the get WSDL endpoint return the original WSDL file instead of some Apache CXF digested version?

Update : I just read somewhere that there is a WSDLGetInterceptor taking care of the get WSDL requests - can I maybe override that one?

I chose to override the getDocument method of the WSDLGetUtils class being used by the WSDLGetInterceptor . My version of the utils class MyWSDLGetUtils is put into action via this interceptor:

public class WsdlGetSoapInterceptor extends AbstractSoapInterceptor {
    public WsdlGetSoapInterceptor() {
        super(Phase.READ);
        addBefore(WSDLGetInterceptor.class.getName());
    }

    /** {@inheritDoc} */
    @Override
    public void handleMessage(final SoapMessage message) throws Fault {
        message.setContextualProperty(WSDLGetUtils.class.getName(), MyWSDLGetUtils.Instance);
    }
}

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