title: CXF SOAP Client outbound message has empty body
body: <p>I had generated a set of classes using WSDL2Java and had built a testing client to try invoke the SOAP Service.</p>
  
  <p>The classes are generated, but when I call the web service, i notice that the <code>body</code> of the outbound message is empty. </p>
  
  <p>The following is some info on the stuff i got:</p>
  
  <p><strong>The Ant script</strong></p>
  
  <pre><code>&lt;target depends="clear-cxf-client-src" name="cxf-wsdl-java"&gt;
        &lt;java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true"&gt;
           &lt;arg value="-client"/&gt;
           &lt;arg value="-d"/&gt;
           &lt;arg value="${src.dir}"/&gt;
           &lt;arg value="-exsh"/&gt;
           &lt;arg value="true"/&gt;             
           &lt;arg value="-autoNameResolution"/&gt;
           &lt;arg value="-wsdlLocation"/&gt;
           &lt;arg value="${wsdl.url}"/&gt;
           &lt;arg value="${wsdl.url}"/&gt;              
           &lt;classpath&gt;
              &lt;path refid="cxf.classpath"/&gt;
           &lt;/classpath&gt;
        &lt;/java&gt;
     &lt;/target&gt;
  </code></pre>
  
  <p><strong>The client code</strong></p>
  
  <pre><code>URL wsdlURL = Service.WSDL_LOCATION;
  if (args.length &gt; 0 &amp;&amp; args[0] != null &amp;&amp; !"".equals(args[0])) { 
      File wsdlFile = new File(args[0]);
      try {
          if (wsdlFile.exists()) {
              wsdlURL = wsdlFile.toURI().toURL();
          } else {
              wsdlURL = new URL(args[0]);
          }
      } catch (MalformedURLException e) {
          e.printStackTrace();
      }
  }
  
  Service service = new Service();
  ReqServicePortType port = service.getReqServicePort();
  
  String endpoint = "http://server:port/&lt;path to end point&gt;";
  BindingProvider provider = (BindingProvider) port;
  provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint); 
  provider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username"); 
  provider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password"); 
  provider.getRequestContext().put("schema-validation-enabled", "true");
  
  Client client = ClientProxy.getClient(port);
  LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
  loggingInInterceptor.setPrettyLogging(true);
  LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
  loggingOutInterceptor.setPrettyLogging(true);
  client.getInInterceptors().add(loggingInInterceptor);
  client.getOutInterceptors().add(loggingOutInterceptor);
  
  HTTPConduit http = (HTTPConduit) client.getConduit();
  HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
  httpClientPolicy.setConnectionTimeout(36000);
  httpClientPolicy.setAllowChunking(false);
  http.setClient(httpClientPolicy);
  
  
  SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
  CustomHeader header= new CustomHeader();
  //setting header value....      
  header.setTimestamp(sdf.format(new Date()));
  
  Holder&lt;CustomHeader&gt; headers = new Holder&lt;CustomHeader&gt;(header);
  
  ReqDoc reqDoc = new ReqDoc();
  //setting reqDoc value...
  reqDoc.setTranxId("5");
  
  ProcessReq req = new ProcessReq();
  req.setInput(reqDoc);           
  
  ProcessReqResponse response = port.processReq(req, headers);
  
  RespDoc respDoc = null;
  if(response != null){
      respDoc = response.getOutput();
  }
  
  String msgCode = "";
  String msgDesc = "";
  if(respDoc != null){
      msgCode = respDoc.getMsgCode();
      msgDesc = respDoc.getMsgDesc();
  }
  
  System.out.println("msgCode: " + msgCode);
  System.out.println("msgDesc: " + msgDesc);
  </code></pre>
  
  <p><strong>The outbound message log</strong></p>
  
  <pre><code>INFO: Outbound Message
  --------------------------- ID: 1 Address: http://server:port/&lt;path to service&gt; Encoding: UTF-8 Http-Method: POST Content-Type: text/xml Headers: {Accept=[*/*], Authorization=[Basic 12341323232323=], SOAPAction=["Service_Binder_processReq"]} Payload: &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;   &lt;soap:Header&gt;
      &lt;header xmlns:ns3="http://&lt;my package&gt;" xmlns:ns2="http://&lt;my schema&gt;" xmlns="http://&lt;my schema&gt;"&gt;
        &lt;timestamp&gt;20150525115746&lt;/timestamp&gt;
      &lt;/header&gt;   &lt;/soap:Header&gt;   &lt;soap:Body/&gt; &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>As you can see i'd tried setting chuking to <code>false</code> but it's still the same.</p>
  
  <p>Any comments or idea is appreciated. Thanks.</p>