Cannot create message: incorrect content-type for SOAP version. Got text/xml; charset=UTF-8, but expected application/soap+xml

SAAJ0533: Cannot create message: incorrect content-type for SOAP version. Got text/xml; charset=UTF-8, but expected application/soap+xml

Based on the exception message I say you have something mixed up.

For all SOAP messages sent, the Content-type header should be:

  • text/xml for SOAP v1.1
  • application/soap+xml for SOAP v1.2.

Check these first, then my suggestion would be to try to see what's going on the wire (with Fiddler for ex.) and then compare what's different in your web app as opposed to the sample.jar which works.