我必须调用soap web服务将数据从我的经典asp页面发送到另一端写入Web服务的数据库,我必须使用它,因此我编写了代码但是给出了它HTML的错误,所以我把我的代码和错误放在这个查询
<%
cboYear = FixString(Request.Form("cboYear"))
'For j=1 to 12
execute("EndDay = Request.Form(""Days" & 1 & """)")
execute("EndMonth = Request.Form(""Months" & 1 & """)")
execute("EndYear = Request.Form(""Years" & 1 & """)")
execute("EndTime = Request.Form(""Times" & 0 & """)")
SendDate = trim(EndDay) & "/" & EndMonth & "/" & EndYear
'Response.Write "<br>START<hr>"
Set oXmlHTTP = CreateObject("Microsoft.XMLHTTP")
oXmlHTTP.Open "POST", "https://bmwservicesuating.bmwcrinhm.in:7446/DMSI/PragmasysService.svc?wsdl",true
oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXmlHTTP.setRequestHeader "SOAPAction", "http://tempuri.org/Pragmasyshh/UpdateCancellationDate"
SOAPRequest = _
"<?xml version=""1.0"" encoding=""utf-8""?>" &_
"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:tem=""http://tempuri.org/"">" &_
"<soapenv:Header/>" &_
"<soapenv:Body>" &_
"<tem:UpdateCancellationDate>" &_
"<tem:IP>" &_
"<Year>" & valueyear &"</Year>" &_
" <Month>" & value & "</Month>" &_
" <CancellationDate>" & my value & "</CancellationDate>" &_
" </tem:IP>" &_
" </tem:UpdateCancellationDate>" &_
" </soapenv:Body>" &_
"</soapenv:Envelope> "&_
"</xml>"
oXmlHTTP.send SOAPRequest
Response.Write oXmlHTTP.responseText
'Response.Write "<br>END<hr>"
'Next
%>
请指导我哪里错了,为什么我会收到错误 XML解析错误:格式不正确 位置:申请网址 第248行,第26栏: ------------------------- ^
答案 0 :(得分:0)
您已假设声明
<?xml version="1.0" encoding="utf-8"?>
需要一个附带的结束标记,而实际上并非如此放置
</xml>
最后会导致解析错误,因为它无法找到起始标记
<xml>
删除它以修复分析错误。