> +        + "<soapenv:Header/>"
> +        + "<soapenv:Body>";
> +
> +   private final String SOAP_SUFFIX = "</soapenv:Body></soapenv:Envelope>";
> +
> +   @Override
> +   public HttpRequest filter(HttpRequest request) throws HttpException {
> +      checkNotNull(request.getPayload(), "HTTP Request must contain payload 
> message.");
> +      return createSoapRequest(request);
> +   }
> +
> +   private HttpRequest createSoapRequest(HttpRequest request) {
> +      final String body = request.getPayload().getRawContent().toString();
> +
> +      final Payload payload = 
> Payloads.newStringPayload(SOAP_PREFIX.concat(body).concat(SOAP_SUFFIX));
> +      payload.getContentMetadata().setContentType(MediaType.TEXT_XML);

Take care: you should *copy* every single field you set in the binder. To avoid 
having to manually keep them up to date, better use the 
[HttpUtils#copy](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/http/HttpUtils.java#L170-L178)
 method.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r22134350

Reply via email to