IE 7 Receiving a Parse Error Calling a Web Service

IE 7 Receiving a Parse Error Calling a Web Service

I'm using 1.4.1 and I have two html files, the first one contains

  1.     $(document).ready(function() {
  2.         $('#recordHit').load("http://localhost/soapcall2.html");
  3.     });


the second file, soapcall2.html contains just the following (no <html/>,<head/> or <body/> tags)
  1. <script>
  2.     var ServiceUrl = '/ws/';
  3.     var CreateSession = ServiceUrl + 'general.asmx?op=CreateUserSession';
  4.     var AddRecord = ServiceUrl + 'record.asmx?op=CreateRecord';
  5.     var TerminateSession = ServiceUrl + 'general.asmx?op=TerminateSession';
  6.     var WebAPIUser = 'webapi';
  7.     var WebAPIPass = 'password';
  8.     var Instance = '50000';
  9.     var sessiontoken = null;

  10.     function CreateUserSession(userName, pin, passwd)
  11.     {
  12.         var soapMessage = '<?xml version="1.0" encoding="utf-8"?>\n<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">\n<soap:Body>\n<CreateUserSession xmlns="http://local/webservices/">\n<userName>' + userName + '</userName>\n<pin>' + pin + '</pin>\n<password>' + passwd + '</password>\n</CreateUserSession>\n</soap:Body>\n</soap:Envelope>';

  13.         $.ajax({
  14.             url: CreateSession,
  15.             type: "POST",
  16.             async: false,
  17.             dataType: "xml",
  18.             data: soapMessage,
  19.             contentType: "text/xml",
  20.             error: function(XMLHttpRequest, textStatus, errorThrown){
  21.                 alert("XMLHttpRequest\n"+XMLHttpRequest.responseText+"\n\ntextStatus\n"+textStatus+"\n\nerrorThrown\n"+errorThrown);
  22.             },
  23.             complete: function(xmlHttpRequest, status){
  24.                 if (status == "success")
  25.                 {
  26.                     $(xmlHttpRequest.responseXML)
  27.                         .find('CreateUserSessionResponse')
  28.                         .each(function()
  29.                         {
  30.                             sessiontoken = $(this).find('CreateUserSessionResult').text();
  31.                         })
  32.                 }
  33.             }
  34.         });
  35.         return false;
  36.     }

  37. CreateUserSession(WebAPIUser, Instance, WebAPIPass);
  38. </script>

In IE 7/8 the error: event is triggered with the correct XML (XMLHttpRequest.responseText) but the textStatus reports parserror and the errorThrown returns [object error].  In firefox it runs without any problems and properly sets the sessiontoken variable.

What could be the issue?