Java 怎么查找具有指定名称的所有扩展性WSDL元素

2019年7月25日22:40:59Java 怎么查找具有指定名称的所有扩展性WSDL元素已关闭评论 463 1145字阅读3分49秒

1.简介

Java 怎么查找具有指定名称的所有扩展性WSDL元素?——请看下文。

2.示例代码

/**
 * 版权所有 编程十万个怎么办(www.tah1986.com)
 */

 
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import javax.wsdl.Binding;
import javax.wsdl.BindingInput;
import javax.wsdl.BindingOperation;
import javax.wsdl.BindingOutput;
import javax.wsdl.Port;
import javax.wsdl.extensions.ElementExtensible;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPHeader;
import javax.wsdl.extensions.soap.SOAPOperation;

public class Main{
    
    @SuppressWarnings("unchecked")
    protected static List<ExtensibilityElement> findExtensibilityElements(
            ElementExtensible extensibleElement, String elementType) {

        List<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>();
        List<ExtensibilityElement> extensibilityElements = extensibleElement
                .getExtensibilityElements();

        if (extensibilityElements != null) {
            for (ExtensibilityElement element : extensibilityElements) {
                if (element.getElementType().getLocalPart()
                        .equalsIgnoreCase(elementType)) {
                    elements.add(element);
                }
            }
        }
        return elements;
    }
}

 
继续阅读
编程十万个怎么办