当前位置: 首页>>代码示例>>Java>>正文


Java ContentStoreHttpPort类代码示例

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


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

示例1: storeContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Sends the test content file to the WebService
 */
public void storeContent() throws Exception {
    ContentStoreHttpPortService contentStoreService = new ContentStoreHttpPortService();
    ContentStoreHttpPort contentStorePort = contentStoreService.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) contentStorePort).getBinding();
    binding.setMTOMEnabled(true);

    StoreContentRequest request = objectFactory.createStoreContentRequest();
    request.setName(ClientUtil.TEST_CONTENT_NAME);
    
    DataHandler dataHandler = new DataHandler(new URLDataSource(ClientUtil.TEST_CONTENT_URL));
    request.setContent(dataHandler);
    
    StopWatch stopWatch = new StopWatch(this.getClass().getSimpleName());

    stopWatch.start("store");
    StoreContentResponse response = contentStorePort.storeContent(request);
    stopWatch.stop();
    
    System.out.println(stopWatch.prettyPrint());
}
 
开发者ID:vanioinformatika,项目名称:spring-ws-mtom-example,代码行数:24,代码来源:JaxWsClient.java

示例2: loadContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Loads the test content from the WebService
 * @throws IOException If an IO error occurs
 */
public void loadContent() throws IOException {
    ContentStoreHttpPortService service = new ContentStoreHttpPortService();
    ContentStoreHttpPort loadContentPort = service.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) loadContentPort).getBinding();
    binding.setMTOMEnabled(true);

    LoadContentRequest request = objectFactory.createLoadContentRequest();
    request.setName(ClientUtil.TEST_CONTENT_NAME);
    StopWatch stopWatch = new StopWatch();

    stopWatch.start("load");
    LoadContentResponse response = loadContentPort.loadContent(request);
    stopWatch.stop();

    DataHandler content = response.getContent();
    File outFile = new File(System.getProperty("java.io.tmpdir"), "spring_mtom_jaxws_tmp.bin");

    stopWatch.start("loadAttachmentContent");
    long size = ClientUtil.saveContentToFile(content, outFile);
    
    System.out.println("Received file size [kB]: " + (size / 1024));
    stopWatch.stop();
    System.out.println(stopWatch.prettyPrint());

}
 
开发者ID:vanioinformatika,项目名称:spring-ws-mtom-example,代码行数:30,代码来源:JaxWsClient.java

示例3: storeContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Sends the specified content file to the WebService
 * 
 * @param name The name of the content to be stored
 * @param content The content to be stored
 * @return The message that tthe server sent back
 */
public String storeContent(String name, DataHandler content) {
    ContentStoreHttpPortService service = new ContentStoreHttpPortService();
    
    service.setHandlerResolver(new HandlerResolver() {
        @Override
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            List<Handler> handlerList = new ArrayList<>();
            handlerList.add(wsSecurityHandler);
            return handlerList;
        }
    });
    
    ContentStoreHttpPort contentStorePort = service.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) contentStorePort).getBinding();
    binding.setMTOMEnabled(true);

    StoreContentRequest request = objectFactory.createStoreContentRequest();
    request.setName(name);
    request.setContent(content);
    
    StoreContentResponse response = contentStorePort.storeContent(request);
    return response.getMessage();
}
 
开发者ID:vanioinformatika,项目名称:spring-boot-integration-example,代码行数:31,代码来源:JaxWsClient.java

示例4: loadContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Loads the content with the specified name from the WebService
 * 
 * @param name The name of the content
 * @return The loaded content
 * @throws IOException If an IO error occurs
 */
public DataHandler loadContent(String name) throws IOException {
    ContentStoreHttpPortService service = new ContentStoreHttpPortService();
    
    service.setHandlerResolver(new HandlerResolver() {
        @Override
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            List<Handler> handlerList = new ArrayList<>();
            handlerList.add(wsSecurityHandler);
            return handlerList;
        }
    });
    
    ContentStoreHttpPort loadContentPort = service.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) loadContentPort).getBinding();
    binding.setMTOMEnabled(true);

    LoadContentRequest request = objectFactory.createLoadContentRequest();
    request.setName(name);
    LoadContentResponse response = loadContentPort.loadContent(request);
    DataHandler content = response.getContent();
    return content;
}
 
开发者ID:vanioinformatika,项目名称:spring-boot-integration-example,代码行数:30,代码来源:JaxWsClient.java

示例5: storeContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Sends the specified content file to the WebService
 * 
 * @param name The name of the content to be stored
 * @param content The content to be stored
 * @return The message that tthe server sent back
 */
public String storeContent(String name, DataHandler content) throws Exception {
    ContentStoreHttpPortService contentStoreService = new ContentStoreHttpPortService();
    ContentStoreHttpPort contentStorePort = contentStoreService.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) contentStorePort).getBinding();
    binding.setMTOMEnabled(true);

    StoreContentRequest request = objectFactory.createStoreContentRequest();
    request.setName(name);
    request.setContent(content);
    
    StoreContentResponse response = contentStorePort.storeContent(request);
    return response.getMessage();
}
 
开发者ID:vanioinformatika,项目名称:spring-boot-cxf-integration-example,代码行数:21,代码来源:JaxWsClient.java

示例6: loadContent

import hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort; //导入依赖的package包/类
/**
 * Loads the content with the specified name from the WebService
 * 
 * @param name The name of the content
 * @return The loaded content
 * @throws IOException If an IO error occurs
 */
public DataHandler loadContent(String name) throws IOException {
    ContentStoreHttpPortService service = new ContentStoreHttpPortService();
    ContentStoreHttpPort loadContentPort = service.getContentStoreHttpPortSoap11();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) loadContentPort).getBinding();
    binding.setMTOMEnabled(true);

    LoadContentRequest request = objectFactory.createLoadContentRequest();
    request.setName(name);
    LoadContentResponse response = loadContentPort.loadContent(request);
    DataHandler content = response.getContent();
    return content;
}
 
开发者ID:vanioinformatika,项目名称:spring-boot-cxf-integration-example,代码行数:20,代码来源:JaxWsClient.java


注:本文中的hu.vanio.springwsmtom.wstypes.ContentStoreHttpPort类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。