title: Getting Bad Request by calling the WebClient post
body: <p>Prepared a code:</p>
  
  <p>I call a service, that actually works when I test it with Post Man (the ContantType="application/xml" there.. POST.</p>
  
  <p>But:</p>
  
  <p>--</p>
  
  <pre><code>val webClient = WebClient.builder()
              .baseUrl("https://mydomain/web/services/validation")
              .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_VALUE)
              .build();
  
  
      final WebClient.RequestBodyUriSpec requestBodyUriSpec = webClient.post();
  
      MyResponseData myResponseData = requestBodyUriSpec
  
              .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_VALUE)
              .accept(MediaType.APPLICATION_XML)
              .acceptCharset(Charset.forName("UTF-8"))
  
              .retrieve()
              .bodyToMono(MyResponseData.class)
              .block();
  </code></pre>
  
  <p>--</p>
  
  <p>as result I always get </p>
  
  <pre><code>Exception in thread "main" org.springframework.web.reactive.function.client.WebClientResponseException$BadRequest: 400 Bad Request
  </code></pre>
  
  <p>in the logs, never get a <code>myResponseData</code></p>
  
  <p>// I use both jaxb and Jackson annotations, just to show that I tried it too.</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.PROPERTY)
  @XmlRootElement(name = "MyResult")
  
  @JacksonXmlRootElement(localName = "MyResult")
  @AllArgsConstructor // TODO:
  @Data
  @Builder
  public class MyResponseData {
  
      public MyResponseData() {}
  
      @XmlElement(name = "Members")
      @JacksonXmlProperty(localName = "Members")
      private List&lt;Member&gt; memberData;
  
  }
  </code></pre>
  
  <p>Any idea?</p>
  
  <p>The MyResponseData maps to the xml.
  I still have troubles to see the response in the log. It is another question.</p>
  
  <p>The response XML is like:</p>
  
  <pre><code>&lt;MyResult&gt;
  &lt;Members&gt;...&lt;/Members&gt;
  &lt;/MyResult&gt;
  </code></pre>
  
  <p>No idea, what's wrong. And seems it is "popular" unanswered question on SO.</p>