title: Getting an error - content type 'text/xml; charset=UTF-8' was not the expected type when requesting a wcf using a xmlhttp by vb script
body: <p>Hi i am new to wcf and xmlhttp, i am using vb script to send the request.
  i am getting the following error 
  "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>
  
  <p>Please find my code below,</p>
  
  <pre><code>g_XMLLink = "http://dev1.xxxxx.employer/employer/v02/Employer.svc"
  Set xmlhttp = Nothing
  Set xmldom = Nothing '
  Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
  Set xmldom = CreateObject("Microsoft.XMLDOM")
  
  completexml = "&lt;CreateProspectRequest xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt;&lt;Employer&gt;&lt;PartyDisplayName&gt;cbs1a test&lt;/PartyDisplayName&gt;&lt;PreferredLanguageIdentifier xsi:nil='true' /&gt;&lt;PartyIdentifier xsi:nil='true' /&gt;&lt;PartyAddresses&gt;" _
  &amp; "&lt;PartyAddressStructure&gt;&lt;BeginTimeStamp xsi:nil='true' /&gt;&lt;CityName&gt;portland&lt;/CityName&gt;&lt;CountryCode&gt;US&lt;/CountryCode&gt;&lt;EndTimeStamp xsi:nil='true' /&gt;&lt;FirstLineAddress&gt;congress street&lt;/FirstLineAddress&gt;&lt;PostalCode&gt;04102&lt;/PostalCode&gt;&lt;SecondJurisdictionCode&gt;ME&lt;/SecondJurisdictionCode&gt;&lt;SecondJurisdictionTypeCode&gt;ST&lt;/SecondJurisdictionTypeCode&gt;" _
  &amp; "&lt;SecondLineAddress /&gt;&lt;AddressIdentifier xsi:nil='true' /&gt;&lt;PartyIdentifier xsi:nil='true' /&gt;&lt;AddressUsageIdentifier&gt;100000&lt;/AddressUsageIdentifier&gt;&lt;SecondJurisdiction&gt;20&lt;/SecondJurisdiction&gt;&lt;ChangeTypeCode xsi:nil='true' /&gt;&lt;/PartyAddressStructure&gt;&lt;/PartyAddresses&gt;" _
  &amp; "&lt;PreferredLanguage&gt;100&lt;/PreferredLanguage&gt;&lt;ChangeTypeCode xsi:nil='true' /&gt;&lt;PartyTypeIdentifier xsi:nil='true' /&gt;&lt;EstablishedDate xsi:nil='true' /&gt;&lt;OrganizationTypeIdentifier&gt;100018&lt;/OrganizationTypeIdentifier&gt;&lt;OrganizationNames&gt;&lt;OrganizationNameStructure&gt;&lt;NameEndTimestamp xsi:nil='true' /&gt;" _
  &amp; "&lt;NameStartTimestamp xsi:nil='true' /&gt;&lt;OrganizationPartyName&gt;cbs1a test&lt;/OrganizationPartyName&gt;&lt;NameTypeIdentifier&gt;1&lt;/NameTypeIdentifier&gt;&lt;PartyIdentifier xsi:nil='true' /&gt;&lt;ChangeTypeCode xsi:nil='true' /&gt;&lt;/OrganizationNameStructure&gt;&lt;/OrganizationNames&gt;&lt;ProspectReceivedDate xsi:nil='true' /&gt;" _
  &amp; "&lt;RatingGroupIdentifier xsi:nil='true' /&gt;&lt;/Employer&gt;&lt;AffiliationCode&gt;UUS&lt;/AffiliationCode&gt;&lt;/CreateProspectRequest&gt;"
  
  xmlhttp.Open "POST", g_XMLLink, False
  xmlhttp.setRequestHeader "ContentType", "text/xml; charset=utf-8"
  xmlhttp.setRequestHeader "SoapAction", "http://xxxxx.com/Employer/Contracts/v2/Employer/CreateProspect"
  
  
  xmldom.loadXML completexml
  xmlhttp.send xmldom
  MsgBox xmlhttp.responseText
  </code></pre>