use of javax.wsdl.extensions.soap.SOAPAddress in project tesb-studio-se by Talend.
the class WSDLUtils method getPortAddress.
public static String getPortAddress(final Port port) {
final Collection<?> extensibilityElements = port.getExtensibilityElements();
SOAPAddress soapAddress = findExtensibilityElement(extensibilityElements, SOAPAddress.class);
if (null != soapAddress) {
return soapAddress.getLocationURI();
}
SOAP12Address soap12Address = findExtensibilityElement(extensibilityElements, SOAP12Address.class);
if (null != soap12Address) {
return soap12Address.getLocationURI();
}
return null;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project tomee by apache.
the class JaxRpcServiceInfoBuilder method getAddressLocation.
private String getAddressLocation(List extensibilityElements) throws OpenEJBException {
SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements);
String locationURIString = soapAddress.getLocationURI();
return locationURIString;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project tdi-studio-se by Talend.
the class ComponentBuilder method populateComponent.
private ServiceInfo populateComponent(ServiceInfo component, Service service) {
QName qName = service.getQName();
String namespace = qName.getNamespaceURI();
String name = qName.getLocalPart();
component.setServerName(name);
component.setServerNameSpace(namespace);
Map ports = service.getPorts();
Iterator portIter = ports.values().iterator();
while (portIter.hasNext()) {
Port port = (Port) portIter.next();
Binding binding = port.getBinding();
if (port.getName() != null && component.getPortNames() == null) {
List<PortNames> portNames = new ArrayList();
PortNames portName = new PortNames();
portName.setPortName(port.getName());
portNames.add(portName);
component.setPortNames(portNames);
} else if (port.getName() != null && component.getPortNames() != null) {
PortNames portName = new PortNames();
portName.setPortName(port.getName());
component.getPortNames().add(portName);
}
List operations = buildOperations(binding);
Iterator operIter = operations.iterator();
while (operIter.hasNext()) {
OperationInfo operation = (OperationInfo) operIter.next();
Vector addrElems = findExtensibilityElement(port.getExtensibilityElements(), "address");
ExtensibilityElement element = (ExtensibilityElement) addrElems.elementAt(0);
if (element != null && element instanceof SOAPAddress) {
SOAPAddress soapAddr = (SOAPAddress) element;
operation.setTargetURL(soapAddr.getLocationURI());
} else if (element != null && element instanceof SOAP12Address) {
SOAP12Address soapAddr = (SOAP12Address) element;
operation.setTargetURL(soapAddr.getLocationURI());
}
component.addOperation(operation);
}
}
return component;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project cxf by apache.
the class PartialWSDLProcessor method setAddrElement.
public static SOAPAddress setAddrElement(Definition wsdlDefinition, Port port, ExtensionRegistry extReg) throws Exception {
SOAPAddress address = SOAPBindingUtil.createSoapAddress(extReg, false);
address.setLocationURI("dummy");
return address;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project wso2-synapse by wso2.
the class WSDL11EndpointBuilder method createEndpointDefinitionFromWSDL.
private EndpointDefinition createEndpointDefinitionFromWSDL(EndpointDefinition endpointDefinition, Definition definition, String serviceName, String portName) {
if (definition == null) {
handleException("WSDL document is not specified.");
}
if (serviceName == null) {
handleException("Service name of the WSDL document is not specified.");
}
if (portName == null) {
handleException("Port name of the WSDL document is not specified.");
}
String serviceURL = null;
// get soap version from wsdl port and update endpoint definition below
// so that correct soap version is used when endpoint is called
String format = null;
assert definition != null;
String tns = definition.getTargetNamespace();
Service service = definition.getService(new QName(tns, serviceName));
if (service != null) {
Port port = service.getPort(portName);
if (port != null) {
for (Object obj : port.getExtensibilityElements()) {
if (obj instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) obj;
serviceURL = address.getLocationURI();
format = SynapseConstants.FORMAT_SOAP11;
break;
} else if (obj instanceof SOAP12Address) {
SOAP12Address address = (SOAP12Address) obj;
serviceURL = address.getLocationURI();
format = SynapseConstants.FORMAT_SOAP12;
break;
} else if (obj instanceof HTTPAddress) {
HTTPAddress address = (HTTPAddress) obj;
serviceURL = address.getLocationURI();
format = SynapseConstants.FORMAT_REST;
Binding binding = port.getBinding();
if (binding == null) {
continue;
}
for (Object portElement : binding.getExtensibilityElements()) {
if (portElement instanceof HTTPBinding) {
HTTPBinding httpBinding = (HTTPBinding) portElement;
String verb = httpBinding.getVerb();
if (verb == null || "".equals(verb)) {
continue;
}
if ("POST".equals(verb.toUpperCase())) {
format = SynapseConstants.FORMAT_REST;
} else if ("GET".equals(verb.toUpperCase())) {
format = SynapseConstants.FORMAT_GET;
}
}
}
}
}
}
}
if (serviceURL != null) {
endpointDefinition.setAddress(serviceURL);
if (SynapseConstants.FORMAT_SOAP11.equals(format)) {
endpointDefinition.setForceSOAP11(true);
} else if (SynapseConstants.FORMAT_SOAP12.equals(format)) {
endpointDefinition.setForceSOAP12(true);
} else if (SynapseConstants.FORMAT_REST.equals(format)) {
endpointDefinition.setForceREST(true);
} else if (SynapseConstants.FORMAT_GET.equals(format)) {
endpointDefinition.setForceGET(true);
} else {
handleException("format value '" + format + "' not yet implemented");
}
endpointDefinition.setFormat(format);
return endpointDefinition;
} else {
handleException("Couldn't retrieve endpoint information from the WSDL.");
}
return null;
}
Aggregations