本文整理汇总了Java中org.springframework.ws.server.endpoint.annotation.RequestPayload类的典型用法代码示例。如果您正苦于以下问题:Java RequestPayload类的具体用法?Java RequestPayload怎么用?Java RequestPayload使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequestPayload类属于org.springframework.ws.server.endpoint.annotation包,在下文中一共展示了RequestPayload类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEmployee
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart = "CreateEmployeeRequest", namespace = "http://sachinhandiekar.com/service/EmployeeService")
@ResponsePayload
public CreateEmployeeResponse createEmployee(@RequestPayload CreateEmployeeRequest request) {
logger.info("Creating employee...");
logger.info(":: Request ::");
logger.info("First Name : " + request.getFirstName());
logger.info("Last Name : " + request.getLastName());
logger.info("City : " + request.getCity());
CreateEmployeeResponse response = new ObjectFactory().createCreateEmployeeResponse();
response.setStatus(true);
return response;
}
示例2: getProcessClaim
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getProcessClaimRequest")
@ResponsePayload
public GetProcessClaimResponse getProcessClaim(@RequestPayload GetProcessClaimRequest request) throws CustomBCDSSException, BusinessException {
LOGGER.debug("SOAP request to get a Process Claim... ...");
GetProcessClaimResponse getProcessClaimResponse = new GetProcessClaimResponse();
if (CollectionUtils.isNotEmpty(request.getVeteranClaimInput())) {
List<VeteranClaimRating> veteranClaimRatings = claimDataService.findByVeteranId(request.getVeteranClaimInput());
if (CollectionUtils.isNotEmpty(veteranClaimRatings)) {
getProcessClaimResponse.getVeteranClaimRatingOutput().addAll(veteranClaimRatings);
} else {
throw new CustomBCDSSException("No valid Pattern found for the data selected");
}
}
return getProcessClaimResponse;
}
示例3: createOrder
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "order")
@ResponsePayload
public OrderConfirmation createOrder(@RequestPayload Order request) {
LOGGER.info(
"Endpoint received order for Customer[firstName={},lastName={}]",
request.getCustomer().getFirstName(),
request.getCustomer().getLastName());
// process order
ObjectFactory factory = new ObjectFactory();
OrderConfirmation response = factory.createOrderConfirmation();
response.setConfirmationId(UUID.randomUUID().toString());
LOGGER.info("Endpoint sending orderConfirmationId='{}'",
response.getConfirmationId());
return response;
}
示例4: saveCustoemr
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "saveCustomerRequest")
@ResponsePayload
public SaveCustomerResponse saveCustoemr(@RequestPayload SaveCustomerRequest request) {
SaveCustomerResponse response = new SaveCustomerResponse();
Customer customer = request.getCustomer();
Kunde kunde = new Kunde();
kunde.setNachname(customer.getLastName());
kunde.setVorname(customer.getFirstName());
kunde.setStrasse(customer.getStreet());
kunde.setPlz(customer.getPostCode());
kunde.setStadt(customer.getCity());
Kunde savedKunde = kundeRepository.saveAndFlush(kunde);
redisTemplate.convertAndSend("customer-created-events", new CustomerCreatedEvent(savedKunde));
customer.setId(savedKunde.getId());
response.setCustomer(customer);
return response;
}
示例5: menuRequest
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart = "menuRequest", namespace = TARGET_NAMESPACE)
@ResponsePayload
public MenuResponse menuRequest(@RequestPayload MenuRequest request) {
if (request == null) {
log.trace("Null MenuRequest");
}
MenuResponse toRet = new MenuResponse();
List<Menu> menus = menuServerLogic.getCurrentSystemMenu();
if (menus.size() == 1) {
toRet.setMenu(menus.get(0));
} else {
Menu newRoot = new Menu();
newRoot.setSkipThis("true");
newRoot.setItems(menus);
toRet.setSkipRoot("true");
toRet.setMenu(newRoot);
}
return toRet;
}
示例6: storePackage
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart = "PackageRequest", namespace = NAMESPACE)
@ResponsePayload
public PackageResponse storePackage(@RequestPayload PackageRequest packageRequest) {
try {
if (packageRequest.getPackageId() == 1) {
return createPackage1Response();
} else if (packageRequest.getPackageId() == 2) {
return createPackage2Response();
} else {
return createErrorResponse(2, "No package Id in request");
}
} catch (DatatypeConfigurationException e) {
return createErrorResponse(1, "Unexpected exception");
}
}
示例7: getFlights
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = MESSAGES_NAMESPACE)
@Namespace(prefix = "m", uri = MESSAGES_NAMESPACE)
@ResponsePayload
public GetFlightsResponse getFlights(@RequestPayload GetFlightsRequest request) throws AirlineException{
String from = request.getFrom();
String to = request.getTo();
ServiceClass serviceClass = request.getServiceClass();
if (from.equals(to)) {
throw new AirlineException("Departure and destination airport has to differ.");
}
GetFlightsResponse response = new GetFlightsResponse();
Flight flight = new Flight();
flight.setFrom(airport(from));
flight.setTo(airport(to));
flight.setNumber("OK1324");
flight.setServiceClass(serviceClass);
flight.setDepartureTime(time("2011-02-19T10:00:00"));
flight.setArrivalTime(time("2011-02-19T12:00:00"));
response.getFlight().add(flight);
return response;
}
示例8: processCourseDetailsRequest
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "GetCourseDetailsRequest")
@ResponsePayload
public GetCourseDetailsResponse processCourseDetailsRequest(@RequestPayload GetCourseDetailsRequest request) {
Course course = service.findById(request.getId());
if (course == null)
throw new CourseNotFoundException("Invalid Course Id " + request.getId());
return mapCourseDetails(course);
}
示例9: processAllCourseDetailsRequest
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "GetAllCourseDetailsRequest")
@ResponsePayload
public GetAllCourseDetailsResponse processAllCourseDetailsRequest(
@RequestPayload GetAllCourseDetailsRequest request) {
List<Course> courses = service.findAll();
return mapAllCourseDetails(courses);
}
示例10: deleteCourseDetailsRequest
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "DeleteCourseDetailsRequest")
@ResponsePayload
public DeleteCourseDetailsResponse deleteCourseDetailsRequest(@RequestPayload DeleteCourseDetailsRequest request) {
Status status = service.deleteById(request.getId());
DeleteCourseDetailsResponse response = new DeleteCourseDetailsResponse();
response.setStatus(mapStatus(status));
return response;
}
示例11: service
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart="DataRequest",namespace=Namespace.NS)
public @ResponsePayload DataResponse service(@RequestPayload DataRequest request){
String beanId=request.getBeanId();
String methodName=request.getMethodName();
String[] args=request.getMethodArgements();
DataResponse response=new DataResponse();
try{
Object targetBean=ContextHolder.getBean(beanId);
Method method=null;
if(args==null || args.length==0){
method=targetBean.getClass().getMethod(methodName);
}else{
Class<?>[] classes=new Class<?>[args.length];
for(int i=0;i<args.length;i++){
classes[i]=String.class;
}
method=targetBean.getClass().getMethod(methodName, classes);
}
Object returnValue=null;
if(args!=null && args.length>0){
Object[] objs=new Object[args.length];
for(int i=0;i<args.length;i++){
objs[i]=args[i];
}
returnValue=method.invoke(targetBean, objs);
}else{
returnValue=method.invoke(targetBean, new Object[]{});
}
if(returnValue!=null){
response.setReturnValue(returnValue.toString());
}
response.setSuccessful(true);
}catch(Exception ex){
response.setReturnValue(ex.getMessage());
response.setSuccessful(false);
}
return response;
}
示例12: getCountry
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getCountryRequest")
@ResponsePayload
public GetCountryResponse getCountry(@RequestPayload GetCountryRequest request) {
GetCountryResponse response = new GetCountryResponse();
response.setCountry(countryRepository.findCountry(request.getName()));
return response;
}
示例13: getAccountDetails
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(localPart = "InvoiceProductRequest", namespace = TARGET_NAMESPACE)
public @ResponsePayload InvoiceProductResponse getAccountDetails(
@RequestPayload InvoiceProductRequest request) {
InvoiceProductResponse response = new InvoiceProductResponse();
InvoicedProducts account = accountReceivableService
.getInvProduct(request.getInvoiceId());
response.setInvoicedProduct(account);
return response;
}
示例14: listMembers
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "ListMembers")
@ResponsePayload
public ListMembersResponse listMembers(@RequestPayload ListMembers request) {
ListMembersResponse response = new ListMembersResponse();
response.setMemberList(new MemberList());
Iterable<Member> members = jaxbCatalogService.getAllMembers(request.getChangedAfter());
response.getMemberList().getMember().addAll(Lists.newArrayList(members));
return response;
}
示例15: getWsdl
import org.springframework.ws.server.endpoint.annotation.RequestPayload; //导入依赖的package包/类
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "GetWsdl")
@ResponsePayload
public GetWsdlResponse getWsdl(@RequestPayload GetWsdl request) {
GetWsdlResponse response = new GetWsdlResponse();
Wsdl wsdl = catalogService.getWsdl(request.getExternalId());
if (wsdl == null) {
throw new WsdlNotFoundException("wsdl with external id " + request.getExternalId()
+ " not found");
}
response.setWsdl(wsdl.getData());
return response;
}