use of org.springframework.ws.server.endpoint.annotation.ResponsePayload in project webservices-axiom by apache.
the class BrokerEndpoint method order.
@PayloadRoot(namespace = "urn:broker", localPart = "Order")
@ResponsePayload
@Namespaces(@Namespace(prefix = "p", uri = "urn:broker"))
public OrderStatus order(@XPathParam("/p:Order/p:Customer") Integer customer, @RequestPayload Source payloadSource) throws UnknownCustomerException, TransformerException {
customerService.validateCustomer(customer);
StringWriter sw = new StringWriter();
transformerHelper.transform(payloadSource, new StreamResult(sw));
String payload = sw.toString();
synchronized (orderQueue) {
orderQueue.addLast(payload);
orderQueue.notify();
}
OrderStatus status = new OrderStatus();
status.setReceived(new Date());
return status;
}
use of org.springframework.ws.server.endpoint.annotation.ResponsePayload in project webservices-axiom by apache.
the class CalculatorEndpoint method add.
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "AddRequest")
@ResponsePayload
public Element add(@RequestPayload Element addRequest) throws Exception {
log.debug("Endpoint invoked");
double sum = 0d;
for (Element operand : operandExpression.evaluate(addRequest)) {
sum += Double.parseDouble(operand.getTextNormalize());
}
Element response = new Element("AddResponse", NAMESPACE);
response.setText(String.valueOf(sum));
return response;
}
Aggregations