Search in sources :

Example 1 with TransportContext

use of org.springframework.ws.transport.context.TransportContext in project camel by apache.

the class AddBreadcrumbHttpHeaderTestInterceptor method handleRequest.

@Override
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
    // no extra op
    TransportContext context = TransportContextHolder.getTransportContext();
    CommonsHttpConnection connection = (CommonsHttpConnection) context.getConnection();
    PostMethod postMethod = connection.getPostMethod();
    postMethod.addRequestHeader("breadcrumbId", "ID-Ralfs-MacBook-Pro-local-50523-1423553069254-0-5");
    return true;
}
Also used : PostMethod(org.apache.commons.httpclient.methods.PostMethod) TransportContext(org.springframework.ws.transport.context.TransportContext) CommonsHttpConnection(org.springframework.ws.transport.http.CommonsHttpConnection)

Aggregations

PostMethod (org.apache.commons.httpclient.methods.PostMethod)1 TransportContext (org.springframework.ws.transport.context.TransportContext)1 CommonsHttpConnection (org.springframework.ws.transport.http.CommonsHttpConnection)1