Invalid wsdl generated by spring-ws when the request element doesn't end with 'Request'

前端 未结 5 1883
执念已碎
执念已碎 2021-02-13 14:08

I must prepare a webservice to accept anan already defined wsdl structure. I followed the tutorial found here, with source code for the test project downloadable here.

F

5条回答
  •  眼角桃花
    2021-02-13 14:34

    There is simpler way. In place of DefaultWsdl11Definition use ProviderBasedWsdl4jDefinition and set all default providers but one - in place of SuffixBasedPortTypesProvider use something like this:

    public class DelphiStylePortTypesProvider extends AbstractPortTypesProvider {
    
        @Override
        protected String getOperationName(Message msg) {
            if (isInputMessage(msg)) {
                return msg.getQName().getLocalPart();
            }
            if (isOutputMessage(msg)) {
                return msg.getQName().getLocalPart().replace("Response", "");
            }
            return "";
        }
    
        @Override
        protected boolean isInputMessage(Message msg) {
            return !msg.getQName().getLocalPart().endsWith("Response");
        }
    
        @Override
        protected boolean isOutputMessage(Message msg) {
            return msg.getQName().getLocalPart().endsWith("Response");
        }
    
        @Override
        protected boolean isFaultMessage(Message msg) {
            return false;
        }
    
    }
    

提交回复
热议问题