use of org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress in project cxf by apache.
the class SoapAddressPlugin method createExtension.
public ExtensibilityElement createExtension(final boolean isSOAP12, final String address) throws WSDLException {
SoapAddress soapAddress = SOAPBindingUtil.createSoapAddress(registry, isSOAP12);
soapAddress.setLocationURI(address);
return soapAddress;
}
use of org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress in project cxf by apache.
the class ServiceImpl method initializePorts.
private void initializePorts() {
try {
Definition def = bus.getExtension(WSDLManager.class).getDefinition(wsdlURL);
javax.wsdl.Service serv = def.getService(serviceName);
if (serv == null) {
throw new WebServiceException("Could not find service named " + serviceName + " in wsdl " + wsdlURL);
}
Map<String, Port> wsdlports = CastUtils.cast(serv.getPorts());
for (Port port : wsdlports.values()) {
QName name = new QName(serviceName.getNamespaceURI(), port.getName());
String address = null;
String bindingID = null;
List<? extends ExtensibilityElement> extensions = CastUtils.cast(port.getBinding().getExtensibilityElements());
if (!extensions.isEmpty()) {
ExtensibilityElement e = extensions.get(0);
if (e instanceof SoapBinding) {
bindingID = SOAPBinding.SOAP11HTTP_BINDING;
} else if (e instanceof SOAP12Binding) {
bindingID = SOAPBinding.SOAP12HTTP_BINDING;
} else if (e instanceof javax.wsdl.extensions.soap.SOAPBinding) {
bindingID = SOAPBinding.SOAP11HTTP_BINDING;
}
}
extensions = CastUtils.cast(port.getExtensibilityElements());
if (!extensions.isEmpty()) {
ExtensibilityElement e = extensions.get(0);
if (e instanceof SoapAddress) {
address = ((SoapAddress) e).getLocationURI();
} else if (e instanceof AddressType) {
address = ((AddressType) e).getLocation();
} else if (e instanceof SOAP12Address) {
address = ((SOAP12Address) e).getLocationURI();
} else if (e instanceof SOAPAddress) {
address = ((SOAPAddress) e).getLocationURI();
} else if (e instanceof HTTPAddress) {
address = ((HTTPAddress) e).getLocationURI();
}
}
addPort(name, bindingID, address);
}
} catch (WebServiceException e) {
throw e;
} catch (Throwable e) {
if (e instanceof UncheckedException && LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, e.getLocalizedMessage(), e);
}
WSDLServiceFactory sf = new WSDLServiceFactory(bus, wsdlURL, serviceName);
Service service = sf.create();
for (ServiceInfo si : service.getServiceInfos()) {
for (EndpointInfo ei : si.getEndpoints()) {
String bindingID = BindingID.getJaxwsBindingID(ei.getTransportId());
addPort(ei.getName(), bindingID, ei.getAddress());
}
}
}
}
use of org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress in project cxf by apache.
the class SoapTransportFactory method createEndpointInfo.
public EndpointInfo createEndpointInfo(Bus bus, ServiceInfo serviceInfo, BindingInfo b, List<?> ees) {
String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
if (b instanceof SoapBindingInfo) {
SoapBindingInfo sbi = (SoapBindingInfo) b;
transportURI = sbi.getTransportURI();
}
EndpointInfo info = new SoapEndpointInfo(serviceInfo, transportURI);
if (ees != null) {
for (Iterator<?> itr = ees.iterator(); itr.hasNext(); ) {
Object extensor = itr.next();
if (SOAPBindingUtil.isSOAPAddress(extensor)) {
final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
info.addExtensor(sa);
info.setAddress(sa.getLocationURI());
if (isJMSSpecAddress(sa.getLocationURI())) {
info.setTransportId(SoapJMSConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
}
} else {
info.addExtensor(extensor);
}
}
}
return info;
}
use of org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress in project cxf by apache.
the class SoapTransportFactory method createSoapExtensors.
private void createSoapExtensors(Bus bus, EndpointInfo ei, SoapBindingInfo bi, boolean isSoap12) {
try {
String address = ei.getAddress();
if (address == null) {
address = "http://localhost:9090";
}
ExtensionRegistry registry = bus.getExtension(WSDLManager.class).getExtensionRegistry();
SoapAddress soapAddress = SOAPBindingUtil.createSoapAddress(registry, isSoap12);
soapAddress.setLocationURI(address);
ei.addExtensor(soapAddress);
} catch (WSDLException e) {
e.printStackTrace();
}
}
Aggregations