• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AbstractDestination类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.apache.cxf.transport.AbstractDestination的典型用法代码示例。如果您正苦于以下问题:Java AbstractDestination类的具体用法?Java AbstractDestination怎么用?Java AbstractDestination使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AbstractDestination类属于org.apache.cxf.transport包,在下文中一共展示了AbstractDestination类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeServiceList

点赞 3

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
public void writeServiceList(PrintWriter writer,
                             String basePath,
                             AbstractDestination[] soapDestinations,
                             AbstractDestination[] restDestinations) throws IOException {
    writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
                 + "\"http://www.w3.org/TR/html4/loose.dtd\">");
    writer.write("<HTML><HEAD>");
    writer.write("<LINK type=\"text/css\" rel=\"stylesheet\" href=\"" + styleSheetPath + "\">");
    writer.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">");
    if (title != null) {
        writer.write("<title>" + title + "</title>");
    } else {
        writer.write("<title>CXF - Service list</title>");
    }
    writer.write("</head><body>");

    if (soapDestinations.length > 0 || restDestinations.length > 0) {
        writeSOAPEndpoints(writer, basePath, soapDestinations);
        writeRESTfulEndpoints(writer, basePath, restDestinations);
    } else {
        writer.write("<span class=\"heading\">No services have been found.</span>");
    }

    writer.write("</body></html>");
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:26,
代码来源:FormattedServiceListWriter.java

示例2: getAbsoluteAddress

点赞 3

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
private String getAbsoluteAddress(String basePath, AbstractDestination d) {
    String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl");
    if (endpointAddress != null) {
        return endpointAddress;
    }
    endpointAddress = d.getEndpointInfo().getAddress();
    if (endpointAddress.startsWith("http://") || endpointAddress.startsWith("https://")) {
        if (endpointAddress.startsWith(basePath) || showForeignContexts) {
        	// add by jirunfang start
            URI uri = URI.create(endpointAddress);
            URI uriBase = URI.create(basePath);
            
            endpointAddress =
                endpointAddress.replaceFirst(uri.getScheme(), uriBase.getScheme())
                    .replaceFirst(uri.getHost(), uriBase.getHost())
                    .replaceFirst(uri.getPort() + "", uriBase.getPort() + "");
            // add by jirunfang end
            return endpointAddress;
        } else {
            return null;
        }
    } else {
        return basePath + endpointAddress;
    }
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:26,
代码来源:FormattedServiceListWriter.java

示例3: writeRESTfulEndpoint

点赞 3

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
private void writeRESTfulEndpoint(PrintWriter writer,
                                  String basePath,
                                  AbstractDestination sd) {
    String absoluteURL = getAbsoluteAddress(basePath, sd);
    if (absoluteURL == null) {
        return;
    }
    
    writer.write("<tr><td>");
    writer.write("<span class=\"field\">Endpoint address:</span> " + "<span class=\"value\">"
                 + absoluteURL + "</span>");
    writer.write("<br/><span class=\"field\">WADL :</span> " + "<a href=\"" + absoluteURL
                 + "?_wadl\">" + absoluteURL + "?_wadl" + "</a>");
    addAtomLinkIfNeeded(absoluteURL, atomMap, writer);
    writer.write("</td></tr>");
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:17,
代码来源:FormattedServiceListWriter.java

示例4: publishEndpointWithPublishedUrlPrefix

点赞 3

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
@Test
public void publishEndpointWithPublishedUrlPrefix() throws WSDLException {

    jaxwsEnvironment.setPublishedEndpointUrlPrefix("http://external/prefix");

    jaxwsEnvironment.publishEndpoint(
            new EndpointBuilder("/path", service)
    );

    verify(mockInvokerBuilder).create(any(), any(Invoker.class));
    verifyZeroInteractions(mockUnitOfWorkInvokerBuilder);

    Server server = testutils.getServerForAddress("/path");
    AbstractDestination destination = (AbstractDestination) server.getDestination();
    String publishedEndpointUrl = destination.getEndpointInfo().getProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL, String.class);

    assertThat(publishedEndpointUrl, equalTo("http://external/prefix/path"));
}
 

开发者ID:roskart,
项目名称:dropwizard-jaxws,
代码行数:19,
代码来源:JAXWSEnvironmentTest.java

示例5: writeSOAPEndpoints

点赞 2

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
private void writeSOAPEndpoints(PrintWriter writer,
                                String basePath,
                                AbstractDestination[] destinations)
    throws IOException {
    writer.write("<span class=\"heading\">Available SOAP services:</span><br/>");
    writer.write("<table " + (styleSheetPath.endsWith("stylesheet=1")
                        ? "cellpadding=\"1\" cellspacing=\"1\" border=\"1\" width=\"100%\"" : "") + ">");
    for (AbstractDestination sd : destinations) {
        writerSoapEndpoint(writer, basePath, sd);
    }
    writer.write("</table><br/><br/>");
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:13,
代码来源:FormattedServiceListWriter.java

示例6: writerSoapEndpoint

点赞 2

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
private void writerSoapEndpoint(PrintWriter writer,
                                String basePath,
                                AbstractDestination sd) {
    String absoluteURL = getAbsoluteAddress(basePath, sd);
    if (absoluteURL == null) {
        return;
    }
    
    writer.write("<tr><td>");
    writer.write("<span class=\"porttypename\">"
                 + sd.getEndpointInfo().getInterface().getName().getLocalPart() + "</span>");
    writer.write("<ul>");
    for (OperationInfo oi : sd.getEndpointInfo().getInterface().getOperations()) {
        if (!Boolean.TRUE.equals(oi.getProperty("operation.is.synthetic"))) {
            writer.write("<li>" + oi.getName().getLocalPart() + "</li>");
        }
    }
    writer.write("</ul>");
    writer.write("</td><td>");
    
    
    writer.write("<span class=\"field\">Endpoint address:</span> " + "<span class=\"value\">"
                 + absoluteURL + "</span>");
    writer.write("<br/><span class=\"field\">WSDL :</span> " + "<a href=\"" + absoluteURL
                 + "?wsdl\">" + sd.getEndpointInfo().getService().getName() + "</a>");
    writer.write("<br/><span class=\"field\">Target namespace:</span> "
                 + "<span class=\"value\">"
                 + sd.getEndpointInfo().getService().getTargetNamespace() + "</span>");
    addAtomLinkIfNeeded(absoluteURL, atomMap, writer);
    writer.write("</td></tr>");
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:32,
代码来源:FormattedServiceListWriter.java

示例7: writeRESTfulEndpoints

点赞 2

import org.apache.cxf.transport.AbstractDestination; //导入依赖的package包/类
private void writeRESTfulEndpoints(PrintWriter writer, 
                                   String basePath, 
                                   AbstractDestination[] restfulDests)
    throws IOException {
    writer.write("<span class=\"heading\">Available RESTful services:</span><br/>");
    writer.write("<table " + (styleSheetPath.endsWith("stylesheet=1")
        ? "cellpadding=\"1\" cellspacing=\"1\" border=\"1\" width=\"100%\"" : "") + ">");
    for (AbstractDestination sd : restfulDests) {
        writeRESTfulEndpoint(writer, basePath, sd);
    }
    writer.write("</table>");
}
 

开发者ID:Huawei,
项目名称:eSDK_EC_SDK_Java,
代码行数:13,
代码来源:FormattedServiceListWriter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)