我使用以下代码来获取结果,但由于某种原因,我收到此错误:第 1 行错误:序言中不允许内容。 (第 134 行,文件“Code”) 在本例中为
var xmlResult = XmlService.parse(结果).getRootElement();
var xml = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:v1=\"http://openclinica.org/ws/studySubject/v1\" xmlns:bean=\"http://openclinica.org/ws/beans\">"
+"<soapenv:Header>"
+"<wsse:Security soapenv:mustUnderstand=\"1\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"
+"<wsse:UsernameToken wsu:Id=\"UsernameToken-27777511\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">"
+"<wsse:Username>yyyy</wsse:Username>"
+"<wsse:Password>xxxxx</wsse:Password>"
+"</wsse:UsernameToken>"
+"</wsse:Security>"
+"</soapenv:Header>"
+"<soapenv:Body>"
+"<v1:listAllByStudyRequest>"
+"<bean:studyRef>"
+"<bean:identifier>PROSPER2</bean:identifier>"
+"</bean:studyRef>"
+"</v1:listAllByStudyRequest>"
+"</soapenv:Body>"
+"</soapenv:Envelope>";
var options =
{
"method" : "post",
"contentType" : "text/xml",
"payload" : xml
};
var result = UrlFetchApp.fetch("http://89.221.253.174:8080/OpenClinica-ws/ws/studySubject/v1/studySubjectWsdl.wsdl", options);
var xmlResult = XmlService.parse(result).getRootElement();
Logger.log(xmlResult);
知道为什么这不起作用,我正在使用谷歌应用程序脚本来执行此代码;