title: Unable to set Content-Type on SOAP Request
body: <p>I'm sending a SOAP call to a server, and the server insists on a certain Content-Type. I'm trying to set the content type but it doesn't seem to be transmitted properly. </p>
  
  <p>I get a response from the server:</p>
  
  <blockquote>
    <p>415 Cannot process the message because the content type 'text/xml;
    charset=utf-8' was not the expected type 'application/soap+xml;
    charset=utf-8'</p>
  </blockquote>
  
  <p>My rough code:</p>
  
  <pre><code>val soapConnectionFactory = SOAPConnectionFactory.newInstance()
  val soapConnection = soapConnectionFactory.createConnection()
  val url = "https://secure.com"
  
  val messageFactory = MessageFactory.newInstance()
  val soapMessage = messageFactory.createMessage()
  
  // (create envelope)
  
  val headers = soapMessage.mimeHeaders
  headers.setHeader("Content-Type", "application/soap+xml; charset=utf-8")
  
  soapMessage.saveChanges()
  
  val soapResponse = soapConnection.call(soapMessage, url)
  soapConnection.close()
  </code></pre>
  
  <p>Debugging through, the content type appears to be set properly up to the soapConnection.call(). Any ideas?</p>