我的代码如下:
var http_url = ""+MDM_HTTP_URL;
var httpClient = new A_HttpRequest();
httpClient.open ("POST", http_url);
httpClient.setRequestHeader("SOAPAction","invokeEPSMDMRTIDealService");
httpClient.setRequestHeader("Content-Type","text/xml");
httpClient.setRequestHeader("charset","UTF-8");
var roleObj = Acumen.getRole();
var userObj = Acumen.getUser();
var roleName = roleObj.name;
roleName = roleName.replace(/\&/g,'&');
print("RAJIV_USER:"+roleName+"\t"+userObj.name+"\t"+userObj.id);
var soap_request = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:com=\"http://com.cisco.eps.mdm.webservice.xmlSchema\"><soapenv:Header/><soapenv:Body><com:EPSMDMRTIDealServiceRequest><com:OPTY_NUMBER>"+_DEAL_ID_+"</com:OPTY_NUMBER><com:USER_ID>"+userObj.id+"</com:USER_ID><com:USER_NAME>"+userObj.name+"</com:USER_NAME><com:ROLE>"+roleName+"</com:ROLE></com:EPSMDMRTIDealServiceRequest></soapenv:Body></soapenv:Envelope>";
var http_response = httpClient.send(soap_request);
var soapResponse = http_response.getHttpResponseBody();
print("RESPONSE HEADER IS::\n"+http_response.getHttpResponseHeader());
print("RESPONSE XML : " + soapResponse);
return soapResponse;
当我执行上述程序时,它给出以下输出:
RESPONSE HEADER IS::
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 13 Aug 2013 12:44:00 GMT
Connection: close
RESPONSE XML : <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode></faultcode><faultstring>com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
谁能帮我解决这个问题?