阿帕奇CXF的WSDL2Java:让服务回报原来的WSDL文件 [英] Apache CXF wsdl2java: make service return original WSDL file
问题描述
我奋力大的时间提供基于从客户获得了一些WSDL文件的Web服务。至于详细描述<一个href=\"http://stackoverflow.com/questions/29500064/apache-cxf-wsdl2java-wsdl-file-returned-different-from-the-original-one\">here,追加?WSDL
来服务URL像
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
似乎是PTED了SoapUI misinter $ P $,这再次$ P $使用该服务pvents客户!
seems to be misinterpreted by SoapUI and this again prevents the customer from using the service!
我现在希望有人能帮助我了解,如果有可能使获取WSDL端点返回原来的WSDL文件,而不是某些的Apache CXF 消化的版本?
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?
更新的:我刚才读的地方,有一个WSDLGetInterceptor采取GET请求WSDL的护理 - 可我也许会覆盖一个
Update: I just read somewhere that there is a WSDLGetInterceptor taking care of the get WSDL requests - can I maybe override that one?
推荐答案
我选择了重写的 getDocument
方法 WSDLGetUtils
类正在使用的 WSDLGetInterceptor
。我的utils的类的版本 MyWSDLGetUtils
通过这个拦截付诸行动:
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);
}
}
这篇关于阿帕奇CXF的WSDL2Java:让服务回报原来的WSDL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!