get SOAP Address - Java javax.xml.soap

Java examples for javax.xml.soap:SOAPMessage

Description

get SOAP Address

Demo Code


import java.util.List;
import javax.wsdl.Binding;
import javax.wsdl.BindingOperation;
import javax.wsdl.Port;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPOperation;

public class Main{
    public static SOAPAddress getSOAPAddress(Port port) {
        SOAPAddress soapAddress = null;//  w  w w  .  j av a 2 s  .c  o m
        List extensibilityElements = port.getExtensibilityElements();
        for (int i = 0; i < extensibilityElements.size(); i++) {
            Object element = extensibilityElements.get(i);
            if (element instanceof SOAPAddress) {
                soapAddress = (SOAPAddress) element;
            }
        }
        return soapAddress;
    }
}

Related Tutorials