Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions dotnet/src/dotnetframework/GxClasses/Helpers/GXRestAPIClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public GXRestAPIClient()
public string ErrorMessage { get; set; }

public int StatusCode { get; set; }

public string StatusMessage { get ; set; }
public int ResponseCode { get => responseCode; set => responseCode = value; }
public string ResponseMessage { get => responseMessage; set => responseMessage = value; }
public string HttpMethod { get => httpMethod; set => httpMethod = value; }

public string protocol = "REST";
public int protocol = 1;

private string httpMethod = "GET";

Expand Down Expand Up @@ -336,6 +336,9 @@ public void AddUploadFile(string FilePath, string name)
public void RestExecute()
{
this.ErrorCode = 0;
this.ErrorMessage = "";
this.StatusCode = 0;
this.StatusMessage = "";
_queryString = String.Empty;
if (_queryVars.Count > 0)
{
Expand Down Expand Up @@ -380,16 +383,16 @@ public void RestExecute()
serviceuri += "/" + this.Location.BaseUrl.TrimEnd('/').TrimStart('/') + "/" + this.Location.ResourceName;
serviceuri += _queryString;
httpClient.HttpClientExecute( this.HttpMethod, serviceuri);
this.ErrorCode = httpClient.ErrCode;
this.ErrorMessage = httpClient.ErrDescription;
this.StatusCode = httpClient.StatusCode;
this.StatusMessage = httpClient.ReasonLine;
if (httpClient.StatusCode >= 300 || httpClient.ErrCode > 0)
{
this.ErrorCode = (httpClient.ErrCode == 0)? 1: httpClient.ErrCode;
this.ErrorMessage = httpClient.ErrDescription;
this.StatusCode = httpClient.StatusCode;
_responseData = new Dictionary<string, object>();
}
else
{
this.StatusCode = httpClient.StatusCode;
_responseData = GeneXus.Utils.RestAPIHelpers.ReadRestParameters(httpClient.ToString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ namespace GeneXus.Application
public class GxObjectProperties
{
private GxLocation location = null;
private string protocol = "rest";
private int protocol = 1;
private string errorMessage = String.Empty;
private int errorCode = 0;
private int statusCode = 0;
private string statusMessage = String.Empty;

public GxLocation Location { get => location; set => location = value; }
public string ErrorMessage { get => errorMessage; set => errorMessage = value; }
public int ErrorCode { get => errorCode; set => errorCode = value; }
public int StatusCode { get => statusCode; set => statusCode = value; }
public string Protocol { get => protocol; set => protocol = value; }

public string StatusMessage { get => statusMessage; set => statusMessage = value; }
public int Protocol { get => protocol; set => protocol = value; }
}

public class GxObjectsConfiguration {
Expand Down