本文整理汇总了Java中javax.wsdl.extensions.http.HTTPAddress类的典型用法代码示例。如果您正苦于以下问题:Java HTTPAddress类的具体用法?Java HTTPAddress怎么用?Java HTTPAddress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HTTPAddress类属于javax.wsdl.extensions.http包,在下文中一共展示了HTTPAddress类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getEPRfromWSDL
import javax.wsdl.extensions.http.HTTPAddress; //导入依赖的package包/类
/**
* Get the EPR of this service from the WSDL.
*
* @param wsdlDef WSDL Definition
* @param serviceName service name
* @param portName port name
* @return XML representation of the EPR
*/
public static String getEPRfromWSDL(
final Definition wsdlDef,
final QName serviceName,
final String portName) {
Service serviceDef = wsdlDef.getService(serviceName);
if (serviceDef != null) {
Port portDef = serviceDef.getPort(portName);
if (portDef != null) {
for (Object extElmt : portDef.getExtensibilityElements()) {
if (extElmt instanceof SOAPAddress) {
return ((SOAPAddress) extElmt).getLocationURI();
} else if (extElmt instanceof HTTPAddress) {
return ((HTTPAddress) extElmt).getLocationURI();
} else if (extElmt instanceof SOAP12Address) {
return ((SOAP12Address) extElmt).getLocationURI();
}
}
}
}
return null;
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:30,代码来源:AxisServiceUtils.java
示例2: getServiceLocation
import javax.wsdl.extensions.http.HTTPAddress; //导入依赖的package包/类
private String getServiceLocation() {
for (Object extElement : getPortDefinition().getExtensibilityElements()) {
if (extElement instanceof HTTPAddress) {
return ((HTTPAddress) extElement).getLocationURI();
}
}
throw new NullPointerException("Service Location is null. Cannot find HTTP Address from WSDL definition");
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:10,代码来源:HTTPBindingHandler.java
示例3: convertPort
import javax.wsdl.extensions.http.HTTPAddress; //导入依赖的package包/类
private void convertPort( Port port )
throws IOException
{
String comment = "";
String name = port.getName();
String protocol = "soap";
String location = "socket://localhost:80/";
if ( port.getDocumentationElement() != null ) {
comment = port.getDocumentationElement().getNodeValue();
}
List< ExtensibilityElement > extElements = port.getExtensibilityElements();
for( ExtensibilityElement element : extElements ) {
if ( element instanceof SOAPAddress ) {
location = ((SOAPAddress)element).getLocationURI().toString();
StringBuilder builder = new StringBuilder();
builder.append( "soap {\n" )
.append( "\t.wsdl = \"" )
.append( definition.getDocumentBaseURI() )
.append( "\";\n" )
.append( "\t.wsdl.port = \"" )
.append( port.getName() )
.append( "\"\n}");
protocol = builder.toString();
} else if ( element instanceof HTTPAddress ) {
location = ((HTTPAddress)element).getLocationURI().toString();
protocol = "http";
}
}
try {
URI uri = new URI( location );
uri = new URI(
"socket",
uri.getUserInfo(),
uri.getHost(),
( uri.getPort() < 1 ) ? 80 : uri.getPort(),
uri.getPath(),
uri.getQuery(),
uri.getFragment()
);
location = uri.toString();
} catch( URISyntaxException e ) {
e.printStackTrace();
}
Binding binding = port.getBinding();
PortType portType = binding.getPortType();
convertPortType( portType, binding );
outputPorts.put( name, new OutputPort(
name, location, protocol, portType.getQName().getLocalPart(), comment
) );
}
开发者ID:jolie,项目名称:jolie,代码行数:52,代码来源:WSDLConverter.java
示例4: genEPRfromWSDL
import javax.wsdl.extensions.http.HTTPAddress; //导入依赖的package包/类
/**
* Get the EPR of this service from the WSDL.
*
* @param wsdlDef WSDL Definition
* @param serviceName service name
* @param portName port name
* @return XML representation of the EPR
*/
public static Element genEPRfromWSDL(
final Definition wsdlDef,
final QName serviceName,
final String portName) {
Service serviceDef = wsdlDef.getService(serviceName);
if (serviceDef != null) {
Port portDef = serviceDef.getPort(portName);
if (portDef != null) {
Document doc = DOMUtils.newDocument();
Element service = doc.createElementNS(Namespaces.WSDL_11, "service");
service.setAttribute("name", serviceDef.getQName().getLocalPart());
service.setAttribute("targetNamespace", serviceDef.getQName().getNamespaceURI());
Element port = doc.createElementNS(Namespaces.WSDL_11, "port");
service.appendChild(port);
port.setAttribute("name", portDef.getName());
port.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:bindns",
portDef.getBinding().getQName().getNamespaceURI());
port.setAttribute("bindns:binding", portDef.getName());
for (Object extElmt : portDef.getExtensibilityElements()) {
if (extElmt instanceof SOAPAddress) {
Element soapAddr = doc.createElementNS(Namespaces.SOAP_NS, "address");
port.appendChild(soapAddr);
soapAddr.setAttribute("location", ((SOAPAddress) extElmt).getLocationURI());
} else if (extElmt instanceof HTTPAddress) {
Element httpAddr = doc.createElementNS(Namespaces.HTTP_NS, "address");
port.appendChild(httpAddr);
httpAddr.setAttribute("location", ((HTTPAddress) extElmt).getLocationURI());
} else if (extElmt instanceof SOAP12Address) {
Element soap12Addr = doc.createElementNS(Namespaces.SOAP12_NS, "address");
port.appendChild(soap12Addr);
soap12Addr.setAttribute("location", ((SOAP12Address) extElmt).getLocationURI());
} else {
port.appendChild(
doc.importNode(((UnknownExtensibilityElement) extElmt).getElement(),
true));
}
}
return service;
}
}
return null;
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:52,代码来源:BPELProcessProxy.java
注:本文中的javax.wsdl.extensions.http.HTTPAddress类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论