私のコードでは、次のことを行っています。
response.ContentType = "text/xml";
StringWriter stringToWrite = new StringWriter();
respose_example = getData();
System.Xml.Serialization.XmlSerializer outSeralizeList = new System.Xml.Serialization.XmlSerializer(typeof(List<Registers>));
outSeralizeList.Serialize(stringToWrite, respose_example);
string responseString = stringToWrite.ToString();
// Construct a response.
response.ContentEncoding = System.Text.Encoding.UTF8;
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
// Get a response stream and write the response to it.
response.ContentLength64 = buffer.Length;
Stream output = response.OutputStream;
output.Write(buffer, 0, buffer.Length);
// You must close the output stream.
output.Close();
私のブラウザコードでは、次のことを行っています。
xmlhttp.open("POST", "", false);
var command = new commandObject();
command.command = "xml";
try {
xmlhttp.send(JSON.stringify(command));
} catch(e){
alert(e);
}
このエラーが発生し続けます:
DOMException {message: "A network error occurred.", name: "NetworkError", code: 19, stack: "Error: A network error occurred.↵ at getXML (ht…rElement.onclick (http://127.0.0.1:7000/:403:164)", INDEX_SIZE_ERR: 1…}
code: 19
message: "A network error occurred."
name: "NetworkError"
stack: "Error: A network error occurred.↵ at getXML (http://127.0.0.1:7000/:84:19)↵ at create_table (http://127.0.0.1:7000/:182:22)↵ at HTMLAnchorElement.onclick (http://127.0.0.1:7000/:403:164)"
__proto__: DOMException
なぜFFで動作するのかわかりません。クロムが詳細を提供してくれることを願っています。