本文整理汇总了Java中javax.wsdl.extensions.soap.SOAPAddress.getLocationURI方法的典型用法代码示例。如果您正苦于以下问题:Java SOAPAddress.getLocationURI方法的具体用法?Java SOAPAddress.getLocationURI怎么用?Java SOAPAddress.getLocationURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.extensions.soap.SOAPAddress
的用法示例。
在下文中一共展示了SOAPAddress.getLocationURI方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importService
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* Imports the service from the WSDL service definition
*/
protected WSService importService(Service service) {
String name = service.getQName().getLocalPart();
Port port = (Port) service.getPorts().values().iterator().next();
String location = "";
List extensionElements = port.getExtensibilityElements();
for (Object extension : extensionElements) {
if (extension instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) extension;
location = address.getLocationURI();
}
}
WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
return wsService;
}
示例2: importService
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* Imports the service from the WSDL service definition
*/
private WSService importService(Service service) {
String name = service.getQName().getLocalPart();
Port port = (Port) service.getPorts().values().iterator().next();
String location = "";
List extensionElements = port.getExtensibilityElements();
for (Object extension : extensionElements) {
if (extension instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) extension;
location = address.getLocationURI();
}
}
WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
return wsService;
}
示例3: getBindingURL
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* Obtains the accessUrl from the WSDL
*
* @param port
* @return a string url
* @throws MalformedURLException
*/
private String getBindingURL(Port port) throws MalformedURLException {
String bindingUrl = null;
for (Object element : port.getExtensibilityElements()) {
if (element instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) element;
URL locationURI = new URL(address.getLocationURI());
if (locationURI != null) {
bindingUrl = urlLocalizer.rewrite(locationURI);
break;
}
}
}
return bindingUrl;
}
示例4: getSOAPLocation
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* @param port analyzed port
* @return Returns the endpoint URL of the given Port
*/
private String getSOAPLocation(Port port) {
String endpoint = null;
@SuppressWarnings("unchecked") // Can't change the API
List<ExtensibilityElement> extensions = port.getExtensibilityElements();
for (Iterator<ExtensibilityElement> i = extensions.iterator();
i.hasNext();) {
ExtensibilityElement ext = i.next();
if (ext instanceof SOAPAddress) {
SOAPAddress addr = (SOAPAddress) ext;
endpoint = addr.getLocationURI();
}
}
return endpoint;
}
示例5: getSOAPLocation
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* @param port analyzed port
* @return Returns the endpoint URL of the given Port
*/
private String getSOAPLocation(Port port) {
String endpoint = null;
List extensions = port.getExtensibilityElements();
for (Iterator i = extensions.iterator(); i.hasNext();) {
ExtensibilityElement ext = (ExtensibilityElement) i.next();
if (ext instanceof SOAPAddress) {
SOAPAddress addr = (SOAPAddress) ext;
endpoint = addr.getLocationURI();
}
}
return endpoint;
}
示例6: getPortAddress
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
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;
}
示例7: getServiceDetails
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
/**
* Reads the WSDL and determines the target namespace.
*
* @param locator
* The URL of the WSDL.
* @param host
* optional the host to be used when the one from the wsdl must
* not be used
* @return The service's target namespace.
* @throws WSDLException
* Thrown in case the WSDL could not be evaluated.
*/
private WSPortDescription getServiceDetails(WSDLLocator locator, String host)
throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
Definition serviceDefinition = wsdlReader.readWSDL(locator);
String tns = serviceDefinition.getTargetNamespace();
// read the port name
String endpointURL = null;
final Map<?, ?> services = serviceDefinition.getServices();
if (services != null) {
for (Object serviceValue : services.values()) {
javax.wsdl.Service service = (javax.wsdl.Service) serviceValue;
Map<?, ?> ports = service.getPorts();
if (ports != null) {
for (Object portValue : ports.values()) {
Port port = (Port) portValue;
List<?> extensibilityElements = port
.getExtensibilityElements();
for (Object ex : extensibilityElements) {
ExtensibilityElement ext = (ExtensibilityElement) ex;
if (ext instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) ext;
endpointURL = address.getLocationURI();
if (host != null) {
int idx = endpointURL.indexOf("//") + 2;
String tmp = endpointURL.substring(0, idx)
+ host
+ endpointURL.substring(endpointURL
.indexOf(':', idx));
endpointURL = tmp;
}
}
}
}
}
}
}
WSPortDescription result = new WSPortDescription();
result.setTargetNamespace(tns);
result.setEndpointURL(endpointURL);
Element versionElement = serviceDefinition.getDocumentationElement();
if (versionElement != null) {
result.setVersion(versionElement.getTextContent());
}
return result;
}
示例8: populateComponent
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
private static ServiceInfo populateComponent(Service service) {
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setServiceName(service.getQName());
Collection<Port> ports = service.getPorts().values();
for (Port port : ports) {
String soapLocation = null;
SOAPAddress soapAddress = findExtensibilityElement(port.getExtensibilityElements(), SOAPAddress.class);
if (null != soapAddress) {
soapLocation = soapAddress.getLocationURI();
} else {
SOAP12Address soap12Address = findExtensibilityElement(port.getExtensibilityElements(), SOAP12Address.class);
if (null != soap12Address) {
soapLocation = soap12Address.getLocationURI();
}
}
Binding binding = port.getBinding();
for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
SOAPOperation soapOperation = findExtensibilityElement(operation.getExtensibilityElements(), SOAPOperation.class);
if (null != soapOperation && OPERATION_TYPE_RPC.equalsIgnoreCase(soapOperation.getStyle())) {
// TESB-6151 disable display of unsupported RPC type.
serviceInfo.setHasRpcOperation(true);
continue;
}
OperationInfo operationInfo = new OperationInfo(operation.getOperation());
operationInfo.setPortName(port.getName());
operationInfo.setNamespaceURI(binding.getPortType().getQName().getNamespaceURI());
if (soapOperation != null) {
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
} else {
SOAP12Operation soap12Operation = findExtensibilityElement(operation.getExtensibilityElements(),
SOAP12Operation.class);
if (soap12Operation != null) {
operationInfo.setSoapActionURI(soap12Operation.getSoapActionURI());
}
}
operationInfo.setTargetURL(soapLocation);
serviceInfo.addOperation(operationInfo);
}
}
return serviceInfo;
}
示例9: getAddressLocation
import javax.wsdl.extensions.soap.SOAPAddress; //导入方法依赖的package包/类
private String getAddressLocation(List extensibilityElements) throws OpenEJBException {
SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements);
String locationURIString = soapAddress.getLocationURI();
return locationURIString;
}