guides:ws_payloads_delete_payload
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| guides:ws_payloads_delete_payload [2020/08/24 00:51] – brett.zamora | guides:ws_payloads_delete_payload [2020/08/24 23:41] (current) – brett.zamora | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| The payloads web service is a REST structured service that derives its functionality based on syntax used when calling the web service. To delete a payload from a repository, call the payloads web service with a repository name and the payload file name. | The payloads web service is a REST structured service that derives its functionality based on syntax used when calling the web service. To delete a payload from a repository, call the payloads web service with a repository name and the payload file name. | ||
| - | **Important: | + | **Important: |
| ---- | ---- | ||
| Line 51: | Line 51: | ||
| **Endpoint: | **Endpoint: | ||
| - | < | + | < |
| Line 59: | Line 59: | ||
| - | < | + | < |
| - | <?xml version=" | + | { |
| - | < | + | "result": " |
| - | | + | }</ |
| - | < | + | |
| - | < | + | |
| - | <KEY _Name=" | + | |
| - | < | + | |
| - | < | + | |
| - | <PACKAGE CountyFIPSCode=" | + | |
| - | < | + | |
| - | <GRANTOR _FirstName=" | + | |
| - | <GRANTEE _FirstName=" | + | |
| - | < | + | |
| - | < | + | |
| - | </ | + | |
| - | < | + | |
| - | < | + | |
| - | </ | + | |
| - | <STATUS _Code=" | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | </ | + | |
| - | < | + | |
| - | </ | + | |
| - | </ | + | |
| - | </ | + | |
| - | </ | + | |
| - | </ | + | |
| Line 106: | Line 80: | ||
| ---- | ---- | ||
| + | |||
| + | |||
| + | **Comment 1:** | ||
| + | |||
| + | Following is a C# / .NET sample code snippet that shows how to call the web services associated with deleting a payload. | ||
| + | |||
| + | The payloads: | ||
| + | |||
| + | Payloads that are ' | ||
| + | |||
| + | |||
| + | <code C#> | ||
| + | private bool DeleteRemoteFile(string strRepositoryType, | ||
| + | { | ||
| + | tbMessageLine.Text = " | ||
| + | |||
| + | bool rc = false; | ||
| + | |||
| + | RestClient client = null; | ||
| + | RestRequest request = null; | ||
| + | IRestResponse response = null; | ||
| + | |||
| + | string strURL = " | ||
| + | |||
| + | // Password has to be hashed. | ||
| + | // New convention uses a Salt value from the user record | ||
| + | // See the Login web service for more detail | ||
| + | |||
| + | string strSalt = GetSalt(tbUserName.Text); | ||
| + | string strPassword = tbPassword.Password.ToString(); | ||
| + | |||
| + | string strHashedPassword = HashPassword(strPassword, | ||
| + | |||
| + | string strParms = " | ||
| + | strParms += tbUserName.Text; | ||
| + | strParms += " | ||
| + | strParms += strHashedPassword; | ||
| + | strParms += " | ||
| + | |||
| + | client = new RestClient(strURL); | ||
| + | request = new RestRequest(Method.POST); | ||
| + | |||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | |||
| + | request.AddParameter(" | ||
| + | response = client.Execute(request); | ||
| + | |||
| + | if (response.IsSuccessful) | ||
| + | { | ||
| + | var jsonResult1 = JsonConvert.DeserializeObject< | ||
| + | string token = jsonResult1.access_token; | ||
| + | |||
| + | strURL = null; | ||
| + | client = null; | ||
| + | request = null; | ||
| + | response = null; | ||
| + | | ||
| + | strURL = " | ||
| + | |||
| + | client = new RestClient(strURL); | ||
| + | request = new RestRequest(Method.DELETE); | ||
| + | |||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | response = client.Execute(request); | ||
| + | |||
| + | if (response.IsSuccessful) | ||
| + | { | ||
| + | tbMessageLine.Text = " | ||
| + | rc = true; | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | var jsonResult2 = JsonConvert.DeserializeObject< | ||
| + | string strMessage = jsonResult2.Exception.Message; | ||
| + | tbMessageLine.Text = strMessage; | ||
| + | } | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | var jsonResult2 = JsonConvert.DeserializeObject< | ||
| + | tbMessageLine.Text = jsonResult2.ToString(); | ||
| + | } | ||
| + | return (rc); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Comment 2:** | ||
| + | |||
| + | A nice utility for experimenting with web service calls is POSTMAN. You can download a free version of POSTMAN from the following URL: https:// | ||
| + | |||
| + | |||
| + | |||
guides/ws_payloads_delete_payload.1598230285.txt.gz · Last modified: by brett.zamora
