왜 그런지는 모르겠는데요.
var xmlHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
xmlHTTP.open( "POST", "
http://192.168.100.68/contoso/lab8.asmx", false );
xmlHTTP.setRequestHeader( "Content-Type", 'text/xml; charset="UTF-8"' );
xmlHTTP.send( xmlDoc );
위와 같이 xmlDoc을 인자로 주어서 send를 하게 되면.
POST /contoso/lab8.asmx HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 2961
Content-Type: text/xml;
무조건 위와 같이... "charset=utf-8"이 잘려 나가게 됩니다.
이에 대한 해결방법은 뉴스그룹을 뒤져도 아무도 대답이 없고요.
아마도 XMLDocument를 주게 되면, 무조건 XMLHTTP 개체가 Content-Type을 "text/xml"로만 설정을 해버리는 것 같습니다.
우회해서 해결해야 하는 수밖에 없는데요. 다음과 같이.
var xmlHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
xmlHTTP.open( "POST", "
http://192.168.100.68/contoso/lab8.asmx", false );
xmlHTTP.setRequestHeader( "Content-Type", 'text/xml; charset="UTF-8"' );
xmlHTTP.send( xmlDoc.xml );
위와 같이, send 메서드 인자로 BSTR 형을 주어야 됩니다.