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


Java PayloadRoot类代码示例

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


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

示例1: createEmployee

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;
}
 
开发者ID:sachin-handiekar,项目名称:springws-examples,代码行数:17,代码来源:EmployeeServiceEndpoint.java

示例2: getProcessClaim

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:17,代码来源:BcdsModelingEndpoint.java

示例3: getOrderHistory

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(namespace = "http://codenotfound.com/types/orderhistory",
    localPart = "getOrderHistoryRequest")
@Namespace(prefix = "oh", uri = "http://codenotfound.com/types/orderhistory")
@ResponsePayload
public GetOrderHistoryResponse getOrderHistory(@XPathParam(userIdXPath) String userId) {
  LOGGER.info("received request for order history of userId='{}'", userId);

  // fetch the order history for the received user
  ObjectFactory factory = new ObjectFactory();
  OrderListType orderListType = factory.createOrderListType();

  for (int i = 0; i < 3; i++) {
    OrderType orderType = factory.createOrderType();
    orderType.setOrderId("order" + i);
    orderListType.getOrder().add(orderType);
  }

  OrderHistoryType orderHistoryType = factory.createOrderHistoryType();
  orderHistoryType.setOrderList(orderListType);

  GetOrderHistoryResponse result = factory.createGetOrderHistoryResponse();
  result.setOrderHistory(orderHistoryType);

  return result;
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:26,代码来源:OrderHistoryEndpoint.java

示例4: createOrder

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:19,代码来源:CreateOrderEndpoint.java

示例5: saveCustoemr

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;
}
 
开发者ID:mploed,项目名称:ddd-strategic-design-spring-boot,代码行数:19,代码来源:CustomerEndpoint.java

示例6: menuRequest

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;
}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:22,代码来源:MenuServiceEndpoint.java

示例7: storePackage

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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");
    }

}
 
开发者ID:jensalm,项目名称:ws-loadbalancer,代码行数:18,代码来源:PackageEndpoint.java

示例8: getFlights

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的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;

}
 
开发者ID:lukas-krecan,项目名称:smock,代码行数:24,代码来源:AirlineEndpoint.java

示例9: deleteSecurityGroup

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = DELETE_SECURITY_GROUP, namespace = NAMESPACE_20090404)
public DeleteSecurityGroupResponseDocument deleteSecurityGroup(DeleteSecurityGroupDocument requestDocument) {
    LOG.debug(String.format("deleteSecurityGroup(%s)", requestDocument));
    try {
        String groupName = requestDocument.getDeleteSecurityGroup().getGroupName();
        boolean result = securityGroupService.deleteSecurityGroup(getUserId(), groupName);

        DeleteSecurityGroupResponseDocument responseDocument = DeleteSecurityGroupResponseDocument.Factory.newInstance();
        DeleteSecurityGroupResponseType deleteSecurityGroupResponseType = responseDocument.addNewDeleteSecurityGroupResponse();
        deleteSecurityGroupResponseType.setReturn(result);
        deleteSecurityGroupResponseType.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(responseDocument);
        return (DeleteSecurityGroupResponseDocument) sanitiseXml(responseDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:18,代码来源:DeleteSecurityGroupHandler.java

示例10: deleteVolume

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = DELETE_VOLUME, namespace = NAMESPACE_20090404)
public DeleteVolumeResponseDocument deleteVolume(DeleteVolumeDocument requestDocument) {
    LOG.debug(String.format("deleteVolume(%s)", requestDocument));
    try {
        String volumeId = requestDocument.getDeleteVolume().getVolumeId();
        boolean result = elasticBlockStorageService.deleteVolume(getUserId(), volumeId);

        DeleteVolumeResponseDocument responseDocument = DeleteVolumeResponseDocument.Factory.newInstance();
        DeleteVolumeResponseType addNewDeleteVolumeResponse = responseDocument.addNewDeleteVolumeResponse();
        addNewDeleteVolumeResponse.setReturn(result);
        addNewDeleteVolumeResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(responseDocument);
        return (DeleteVolumeResponseDocument) sanitiseXml(responseDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:18,代码来源:DeleteVolumeHandler.java

示例11: createKeyPair

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = CREATE_KEY_PAIR, namespace = NAMESPACE_20090404)
public CreateKeyPairResponseDocument createKeyPair(CreateKeyPairDocument requestDocument) {
    LOG.debug(requestDocument);
    try {
        String keyName = requestDocument.getCreateKeyPair().getKeyName();

        CreateKeyPairResponseDocument resultDocument = CreateKeyPairResponseDocument.Factory.newInstance();
        CreateKeyPairResponseType addNewCreateKeyPairResponse = resultDocument.addNewCreateKeyPairResponse();

        KeyPair keyPair = keyPairsService.createKeyPair(getUserId(), keyName);

        addNewCreateKeyPairResponse.setKeyName(keyPair.getKeyName());
        addNewCreateKeyPairResponse.setKeyMaterial(keyPair.getKeyMaterial());
        addNewCreateKeyPairResponse.setKeyFingerprint(keyPair.getKeyFingerprint());
        addNewCreateKeyPairResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(resultDocument);
        return (CreateKeyPairResponseDocument) sanitiseXml(resultDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:22,代码来源:CreateKeyPairHandler.java

示例12: deleteSnapshot

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = DELETE_SNAPSHOT, namespace = NAMESPACE_20090404)
public DeleteSnapshotResponseDocument deleteSnapshot(DeleteSnapshotDocument requestDocument) {
    LOG.debug(String.format("deleteSnapshot(%s)", requestDocument));
    try {
        String snapshotId = requestDocument.getDeleteSnapshot().getSnapshotId();
        boolean result = elasticBlockStorageService.deleteSnapshot(getUserId(), snapshotId);

        DeleteSnapshotResponseDocument responseDocument = DeleteSnapshotResponseDocument.Factory.newInstance();
        DeleteSnapshotResponseType addNewDeleteSnapshotResponse = responseDocument.addNewDeleteSnapshotResponse();
        addNewDeleteSnapshotResponse.setReturn(result);
        addNewDeleteSnapshotResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(responseDocument);
        return (DeleteSnapshotResponseDocument) sanitiseXml(responseDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:18,代码来源:DeleteSnapshotHandler.java

示例13: authorizeSecurityGroupIngress

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = AUTHORIZE_SECURITY_GROUP_INGRESS, namespace = NAMESPACE_20090404)
public AuthorizeSecurityGroupIngressResponseDocument authorizeSecurityGroupIngress(AuthorizeSecurityGroupIngressDocument requestDocument) {
    LOG.debug(requestDocument);
    try {
        AuthorizeSecurityGroupIngressResponseDocument resultDocument = AuthorizeSecurityGroupIngressResponseDocument.Factory.newInstance();
        AuthorizeSecurityGroupIngressResponseType addNewAuthorizeSecurityGroupIngressResponse = resultDocument.addNewAuthorizeSecurityGroupIngressResponse();

        IpPermissionSetType ipPermissions = requestDocument.getAuthorizeSecurityGroupIngress().getIpPermissions();
        String groupName = requestDocument.getAuthorizeSecurityGroupIngress().getGroupName();
        List<NetworkRule> networkRules = extractNetworkRules(ipPermissions, groupName);

        boolean result = securityGroupService.authoriseIngress(getUserId(), requestDocument.getAuthorizeSecurityGroupIngress().getGroupName(), networkRules);
        addNewAuthorizeSecurityGroupIngressResponse.setReturn(result);
        addNewAuthorizeSecurityGroupIngressResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(resultDocument);
        return (AuthorizeSecurityGroupIngressResponseDocument) sanitiseXml(resultDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:21,代码来源:AuthorizeSecurityGroupIngressHandler.java

示例14: createSecurityGroup

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = CREATE_SECURITY_GROUP, namespace = NAMESPACE_20090404)
public CreateSecurityGroupResponseDocument createSecurityGroup(CreateSecurityGroupDocument requestDocument) {
    LOG.debug(requestDocument);
    try {
        CreateSecurityGroupResponseDocument resultDocument = CreateSecurityGroupResponseDocument.Factory.newInstance();
        CreateSecurityGroupResponseType addNewCreateSecurityGroupResponse = resultDocument.addNewCreateSecurityGroupResponse();

        boolean result = securityGroupService.createSecurityGroup(getUserId(), requestDocument.getCreateSecurityGroup().getGroupName(), requestDocument.getCreateSecurityGroup().getGroupDescription());

        addNewCreateSecurityGroupResponse.setReturn(result);
        addNewCreateSecurityGroupResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(resultDocument);
        return (CreateSecurityGroupResponseDocument) sanitiseXml(resultDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:18,代码来源:CreateSecurityGroupHandler.java

示例15: deleteKeyPair

import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //导入依赖的package包/类
@PayloadRoot(localPart = OPERATION, namespace = NAMESPACE_20090404)
public DeleteKeyPairResponseDocument deleteKeyPair(DeleteKeyPairDocument requestDocument) {
    LOG.debug(requestDocument);
    try {
        String keyName = requestDocument.getDeleteKeyPair().getKeyName();
        DeleteKeyPairResponseDocument resultDocument = DeleteKeyPairResponseDocument.Factory.newInstance();
        DeleteKeyPairResponseType addNewDeleteKeyPairResponse = resultDocument.addNewDeleteKeyPairResponse();
        boolean result = keyPairsService.deleteKeyPair(getUserId(), keyName);
        addNewDeleteKeyPairResponse.setReturn(result);
        addNewDeleteKeyPairResponse.setRequestId(MDCHelper.getTransactionUID());
        LOG.debug(resultDocument);
        return (DeleteKeyPairResponseDocument) sanitiseXml(resultDocument);
    } catch (Throwable t) {
        throw handleThrowable(t);
    }
}
 
开发者ID:barnyard,项目名称:pi,代码行数:17,代码来源:DeleteKeyPairHandler.java


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