简体   繁体   English

Apache CXF wsdl2java:使服务返回原始WSDL文件

[英]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. 我正竭尽全力提供基于从客户那里收到的WSDL文件的Web服务。 As described in details here , the WSDL file returned when appending a ?wsdl to the service URL like 至于详细描述这里 ,WSDL文件追加时返回?wsdl像服务URL

http://never.mind/SomeService?wsdl

seems to be misinterpreted by SoapUI and this again prevents the customer from using the service! 似乎被SoapUI误解了,这又使客户无法使用该服务!

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? 我现在希望有人可以帮助我理解是否有可能使get WSDL端点返回原始WSDL文件而不是某些Apache CXF摘要版本?

Update : I just read somewhere that there is a WSDLGetInterceptor taking care of the get WSDL requests - can I maybe override that one? 更新 :我刚刚读到某处有一个WSDLGetInterceptor负责处理WSDL请求的获取-我是否可以覆盖该请求?

I chose to override the getDocument method of the WSDLGetUtils class being used by the WSDLGetInterceptor . 我选择覆盖getDocument所述的方法WSDLGetUtils正在使用的类WSDLGetInterceptor My version of the utils class MyWSDLGetUtils is put into action via this interceptor: utils类MyWSDLGetUtils版本通过以下拦截器MyWSDLGetUtils

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);
    }
}

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

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