• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HTTPAddress类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContextUtil类代码示例发布时间:2022-05-22
下一篇:
Java JavadocOrderRootType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap