미국 UPS 의 RATE API 를 사용해야 해서
function UPSverify( originalTotal, s_zp, Service)
'url = "https://wwwcie.ups.com/ups.app/xml/Rate"
url = "https://onlinetools.ups.com/ups.app/xml/Rate"
Response.Buffer = True
Dim objXMLHTTP, xml
' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
' Opens the connection to the remote server.
xml.Open "POST", url, False
'xml.setRequestHeader "Content-Type", "text/xml"
xml.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
' Actually Sends the request and returns the data:
xml.Send(xmlData)
'Display the HTML both as HTML and as text
' Response.Write "<h1>The HTML text</h1><xmp>"
resposneXmlData = xml.responseText
' Response.Write "</xmp><p><hr><p><h1>The HTML Output</h1>"
UPSverify = ParseXml(resposneXmlData)
Set xml = Nothing
End function
Function ParseXml(strXML)
Dim oXML, oNode, sKey, sValue
Set oXML = Server.CreateObject("MSXML2.DomDocument.6.0")
oXML.LoadXML(strXML)
'var currentvalue = $xml.find( "RatedShipment" ).children( "TotalCharges" ).children( "MonetaryValue" ).text() ; RatingServiceSelectionResponse/RatedShipment/TotalCharges/MonetaryValue
For Each oNode In oXML.SelectNodes("/RatingServiceSelectionResponse/RatedShipment/TotalCharges/MonetaryValue")
sKey = oNode.GetAttribute("name")
sValue = oNode.Text
ParseXml = sValue
Next
Set oXML = Nothing
end Function
'Developer > asp' 카테고리의 다른 글
function array return value , 함수에서 멀티플하게 반환값 전달시 (0) | 2018.08.10 |
---|---|
round.formatnumber, cdbl, cint 에 대한 해석 (0) | 2018.05.03 |
asp Dictionary 와 키 밸유 사용 (0) | 2017.12.15 |
Dictionary 사용법 (0) | 2017.10.11 |
IsArray 레코드셋 처리 (0) | 2017.08.28 |