本文整理汇总了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());
}
示例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());
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}