I have never coded in vbscript. I need help parsing a json file...I need to store the username, password and accesslicensekey in variables. Here is a sample of the json file:
{"Security":{"UsernameToken":{"Username":"nelson1", "Password":"password"}, "UPSServiceAccessToken":{"AccessLicenseNumber":"FC0A24ABA65D5FD0"}}, "XAVRequest":{"Request":{"RequestOption":"1", "TransactionReference":{"CustomerContext":"Verify that an XAV request with a Transaction Reference Container returns a successful response."}}, "AddressValidationSource":"
", "MaximumCandidateListSize":"10", "AddressKeyFormat":{"ConsigneeName":"", "BuildingName":"", "AttentionName":"", AddressLine:["26601 ALISO CREEK ROAD", "STE D", "ALISO VIEJO TOWN CENTER"], "Region":"", "PoliticalDivision2":"ALISO VIEJO", "PoliticalDivision1":"CA", "PostcodePrimaryLow":"92656", "PostcodeExtendedLow":"1521", "Urbanization":"porto arundal", "CountryCode":"US"}}}
After the variables are stored, the entire security container needs to be removed from the file, and it rewritten. In this case, it would be rewritten as:
{"XAVRequest":{"Request":{"RequestOption":"1", "TransactionReference":{"CustomerContext":"Verify that an XAV request with a Transaction Reference Container returns a successful response."}}, "AddressValidationSource":"
", "MaximumCandidateListSize":"10", "AddressKeyFormat":{"ConsigneeName":"", "BuildingName":"", "AttentionName":"", AddressLine:["26601 ALISO CREEK ROAD", "STE D", "ALISO VIEJO TOWN CENTER"], "Region":"", "PoliticalDivision2":"ALISO VIEJO", "PoliticalDivision1":"CA", "PostcodePrimaryLow":"92656", "PostcodeExtendedLow":"1521", "Urbanization":"porto arundal", "CountryCode":"US"}}}
{"Security":{"UsernameToken":{"Username":"nelson1", "Password":"password"}, "UPSServiceAccessToken":{"AccessLicenseNumber":"FC0A24ABA65D5FD0"}}, "XAVRequest":{"Request":{"RequestOption":"1", "TransactionReference":{"CustomerContext":"Verify that an XAV request with a Transaction Reference Container returns a successful response."}}, "AddressValidationSource":"
", "MaximumCandidateListSize":"10", "AddressKeyFormat":{"ConsigneeName":"", "BuildingName":"", "AttentionName":"", AddressLine:["26601 ALISO CREEK ROAD", "STE D", "ALISO VIEJO TOWN CENTER"], "Region":"", "PoliticalDivision2":"ALISO VIEJO", "PoliticalDivision1":"CA", "PostcodePrimaryLow":"92656", "PostcodeExtendedLow":"1521", "Urbanization":"porto arundal", "CountryCode":"US"}}}
After the variables are stored, the entire security container needs to be removed from the file, and it rewritten. In this case, it would be rewritten as:
{"XAVRequest":{"Request":{"RequestOption":"1", "TransactionReference":{"CustomerContext":"Verify that an XAV request with a Transaction Reference Container returns a successful response."}}, "AddressValidationSource":"
", "MaximumCandidateListSize":"10", "AddressKeyFormat":{"ConsigneeName":"", "BuildingName":"", "AttentionName":"", AddressLine:["26601 ALISO CREEK ROAD", "STE D", "ALISO VIEJO TOWN CENTER"], "Region":"", "PoliticalDivision2":"ALISO VIEJO", "PoliticalDivision1":"CA", "PostcodePrimaryLow":"92656", "PostcodeExtendedLow":"1521", "Urbanization":"porto arundal", "CountryCode":"US"}}}