아는 것이 좋은 것이다.

[ASP] xml 데이터를 특정URL로 전송, 결과값 받기 본문

ASP

[ASP] xml 데이터를 특정URL로 전송, 결과값 받기

start0 2014. 5. 10. 14:18

<!-- send.asp -->

<%
 
strFilePath = Server.MapPath("/data.xml")
SET fso = Server.CreateObject("Scripting.FilesystemObject")
SET fileData = fso.OpenTextFile(strFilePath, 1)
strXMLData = fileData.ReadAll

Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
xml.Open "POST", "http://pjh2.dreamcontest.com/receive.asp", false
xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xml.send "xml=" & Server.URLEncode(strXMLData)
strResponseText = xml.responseText 
Response.Write strResponseText
SET xml  = Nothing
SET fileData = NOTHING
SET fso = NOTHING
%>

<!-- request.asp -->
<%
xml = Request("xml")
Response.Write xml
%>

<!-- data.xml -->


<?xml version="1.0" encoding="EUC-KR"?>
<product>
     <brand>1222</brand>
     <corp>test</corp>
     <name>hahaha</name>
</product>

'ASP' 카테고리의 다른 글

[ASP] ASP 쌍따옴표 replace  (0) 2014.06.05
[ASP] 랜덤함수  (0) 2014.05.23
[ASP] form request 배열(같은 name 변수 표현)  (0) 2014.05.07
[ASP] Getrows 페이지 이동, 페이징(2차원 배열)  (0) 2014.05.07
[ASP] 한글 깨짐 변환  (1) 2014.04.30
Comments