如何在WebService接收一個XML檔案並解析,客戶端如何傳送這個XML檔案?急求簡單程式碼示例。。
阿新 • • 發佈:2019-01-10
客戶端 xmlHttp = null; if (window.XMLHttpRequest) { // If IE7, Mozilla, Safari, and so on: Use native object. xmlHttp = new XMLHttpRequest(); } else { if (window.ActiveXObject) { // ...otherwise, use the ActiveX control for IE5.x and IE6. xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0'); } } xmlHttp.open("POST", strUrl, false); xmlHttp.send(xmlParamString); 伺服器端,ASP.net程式碼 XmlDocument doc = new XmlDocument(); doc.Load(Request.InputStream); 如果用Web服務,可以按字串引數方式定義