Search in sources :

Example 1 with Namespaces

use of org.springframework.ws.server.endpoint.annotation.Namespaces 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;
}
Also used : StringWriter(java.io.StringWriter) StreamResult(javax.xml.transform.stream.StreamResult) Date(java.util.Date) Namespaces(org.springframework.ws.server.endpoint.annotation.Namespaces) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

StringWriter (java.io.StringWriter)1 Date (java.util.Date)1 StreamResult (javax.xml.transform.stream.StreamResult)1 Namespaces (org.springframework.ws.server.endpoint.annotation.Namespaces)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1