本文整理匯總了Java中hu.vanio.springwsmtom.wstypes.LoadContentRequest類的典型用法代碼示例。如果您正苦於以下問題:Java LoadContentRequest類的具體用法?Java LoadContentRequest怎麽用?Java LoadContentRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LoadContentRequest類屬於hu.vanio.springwsmtom.wstypes包,在下文中一共展示了LoadContentRequest類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
/**
* Loads the test content from the WebService
* @throws IOException If an IO error occurs
*/
public void loadContent() throws IOException {
LoadContentRequest loadContentRequest = objectFactory.createLoadContentRequest();
String tmpDir = System.getProperty("java.io.tmpdir");
File outFile = new File(tmpDir, "spring_mtom_tmp.bin");
long freeBefore = Runtime.getRuntime().freeMemory();
stopWatch.start("load");
LoadContentResponse loadImageResponse = (LoadContentResponse) getWebServiceTemplate().marshalSendAndReceive(loadContentRequest);
stopWatch.stop();
DataHandler content = loadImageResponse.getContent();
long freeAfter = Runtime.getRuntime().freeMemory();
logger.info("Memory usage [kB]: " + ((freeAfter - freeBefore)/1024));
stopWatch.start("loadAttachmentContent");
long size = ClientUtil.saveContentToFile(content, outFile);
logger.info("Received file size [kB]: " + size);
stopWatch.stop();
System.out.println(stopWatch.prettyPrint());
}
示例2: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的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: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的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;
}
示例4: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
@PayloadRoot(localPart = "LoadContentRequest", namespace = TNS)
@ResponsePayload
@Override
public LoadContentResponse loadContent(@RequestPayload LoadContentRequest loadContentRequest) {
logger.info("loadContent start");
LoadContentResponse resp = this.objectFactory.createLoadContentResponse();
File contentFile = this.contentRepository.loadContent(loadContentRequest.getName());
DataHandler dataHandler = new DataHandler(new FileDataSource(contentFile));
resp.setName(loadContentRequest.getName());
resp.setContent(dataHandler);
return resp;
}
示例5: handle
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
@Override
public Object handle(Object request) {
logger.debug("Handling request of type: {}", request.getClass().getName());
if (request instanceof StoreContentRequest) {
return storeContent((StoreContentRequest)request);
} else if (request instanceof LoadContentRequest) {
return loadContent((LoadContentRequest)request);
} else {
logger.debug("Unhandled request type: {}", request.getClass().getName());
throw new MessagingException("Unhandled request type: " + request.getClass().getName());
}
}
開發者ID:vanioinformatika,項目名稱:spring-boot-cxf-integration-example,代碼行數:13,代碼來源:ContentStoreServiceImpl.java
示例6: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
@Override
public LoadContentResponse loadContent(LoadContentRequest request) {
logger.debug("LoadContentResponse received, name: {}", request.getName());
LoadContentResponse resp = new ObjectFactory().createLoadContentResponse();
File content = this.contentRepository.loadContent(request.getName());
logger.debug("Content found interface repository: {}", content.getAbsolutePath());
resp.setContent(new DataHandler(new FileDataSource(content)));
logger.debug("Content put into response");
return resp;
}
開發者ID:vanioinformatika,項目名稱:spring-boot-cxf-integration-example,代碼行數:11,代碼來源:ContentStoreServiceImpl.java
示例7: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的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;
}
示例8: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
/**
* Handles LoadContentRequests
* @param loadContentRequest The request
* @return The LoadContentResponse
*/
@SoapAction("")
@ResponsePayload
public LoadContentResponse loadContent(@RequestPayload LoadContentRequest loadContentRequest);
示例9: loadContent
import hu.vanio.springwsmtom.wstypes.LoadContentRequest; //導入依賴的package包/類
/**
* Handles the specified LoadContentRequest
* @param loadContentRequest The request
* @return The LoadContentResponse
*/
public LoadContentResponse loadContent(LoadContentRequest loadContentRequest);
開發者ID:vanioinformatika,項目名稱:spring-boot-cxf-integration-example,代碼行數:7,代碼來源:ContentStoreService.java