Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. Set objStream = CreateObject("ADODB.Stream")
  2. objStream.CharSet = "utf-8"
  3. objStream.Open
  4. objStream.LoadFromFile("C:request.txt")
  5.  
  6. restRequest = objStream.ReadText()
  7.  
  8. objStream.Close
  9. Set objStream = Nothing
  10.  
  11. contentType ="application/json"
  12.  
  13. Set oWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
  14.  
  15. oWinHttp.Open "POST", "http://czcholsint1048.prg-dc.dhl.com:8180/efoms/fulfillOrder", False
  16.  
  17. oWinHttp.setRequestHeader "Content-Type", contentType
  18.  
  19. oWinHttp.Send restRequest
  20.  
  21. response = oWinHttp.StatusText
  22.  
  23. {
  24. "fulfillOrderReq": {
  25. "hdr": {
  26. "messageType": "SALESORDER",
  27. "messageID": "d264502f-aaa2-42a5-a38d-c981ccb99379", "messageVersion": "0.1",
  28. "messageDateTime": "2015-03-20 09:48:29",
  29. "appId": "OMS",
  30. "clientId": "PEP-ESB",
  31. "reqCompId": "77000001"
  32. },
  33. "bd": {
  34. "orders": [
  35. {
  36. "order": {
  37. "orderNumber": "BAYLINETEST512",
  38. "salesChannelOrderNumber": "TMALLTEST512",
  39. "shopName": "拜仁慕尼黑海外旗舰店",
  40. "salesChannel": "天猫订单",
  41. "payType": "支付宝",
  42. "created": "2015-03-20 15:35:58",
  43. "salesChannelMemberName": "mariahliu621",
  44. "salesChannelMemberNo": "M-9837423",
  45. "idCard": "12312",
  46. "idType": "NATIONAL_IDENTIFICATION_NUMBER",
  47. "cnee": {
  48. "name": "SANTOSH",
  49. "address1": "CHINA",
  50. "address3": "CHINA",
  51. "state": "CHINA",
  52. "city": "CHINA",
  53. "country": "CN",
  54. "postCode": "50470",
  55. "telephone": "18610041036",
  56. "mobilePhone": "18610041036"
  57. },
  58. "cneeMemo": "",
  59. "cneeMessage": "",
  60. "sellerMemo": "",
  61. "otherMemo": "",
  62. "actualOrderAmount": "792.0",
  63. "agioAmount": "0.0",
  64. "discountFee": "0.0",
  65. "deliveryCost": "70.0",
  66. "promotionInfo": "",
  67. "orderItems": [
  68. {
  69. "orderItem": {
  70. "productNumber": "184005",
  71. "productName": "蜂拥而至CL克 Flock CL gr.",
  72. "skuNumber": "184005",
  73. "skuName": "Ribéry",
  74. "barcode": "",
  75. "orderGroup": "0",
  76. "productQty": "1",
  77. "amount": "75.0",
  78. "discountFee": "0.0",
  79. "agioPrice": "90.0",
  80. "price": "110.0",
  81. "taxCharges": "100",
  82. "untaxPrice": "50",
  83. "dutyCharges": "9",
  84. "refundStatus": "Normal",
  85. "memo": ""
  86. }
  87. }
  88. ]
  89. }
  90. }
  91. ]
  92. }
  93. }
  94. }
  95.  
  96. Option Explicit
  97.  
  98. Dim restReq, url, userName, password
  99.  
  100. Set restReq = CreateObject("Microsoft.XMLHTTP")
  101.  
  102. ' Replace <node> with the address of your INSTEON device
  103. ' Additionally, any REST command will work here
  104. url = "http://isy/rest/nodes/<node>/ST"
  105.  
  106. ' If auth is required, replace the userName and password values
  107. ' with the ones you use on your ISY
  108. userName = "admin"
  109. password = "<yourpassword>"
  110.  
  111. restReq.open "GET", url, false, userName, password
  112. restReq.send
  113.  
  114. WScript.echo restReq.responseText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement