REST Service Variables

REST Service Variables

Comments

  • I have been trying to configure a Rest Service to use a variable for the BaseAddress (see the attached screenshot). When I try to run a REST service method using that BaseAddress variable I get an "Invalid URI: Host name could not be parsed" error. The value of BaseAddress = https://myapi.provider.net. Is there a trick to getting this to work? I have tried using all three Encoding Types for variables but receive the same exception.

    Here is the full exception message:

    Name: Error running step Get API Response[RestServiceMethodStep] in flow [RDM BA Get API Response]: Invalid URI: The hostname could not be parsed. Exception Message: Error running step Get Bill Image[RestServiceMethodStep] in flow [RDM BA Get API Response]: Invalid URI: The hostname could not be parsed. Input Values: -- No Data -- Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Bill Image[RestServiceMethodStep] in flow [RDM BA Get API Response]: Invalid URI: The hostname could not be parsed. ---> System.UriFormatException: Invalid URI: The hostname could not be parsed. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Net.WebRequest.Create(String requestUriString) at DecisionsFramework.Utilities.Data.HttpUtilities.CreateRequest(String url, String httpMethod, String contentType, String accept, IEnumerable`1 headers, Int32 timeoutMs, Boolean ignoreCertErrors) at DecisionsFramework.ServiceLayer.Services.ExternalServiceReference.RESTService.RestServiceMethodStep.Run(StepStartData data) at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData) at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace ---

    [img]att1[/img]

  • The underlying code for Decisions REST service integration has had an overhaul recently. You can still parameterize portions of the Service URL for REST services.
    Here are some examples of syntax for parameterizing a Service URL:

    ( http:// or https:// + site prefix ex. www. + {baseURL} + site suffix ex. .com + /testpath )
    [img]att1[/img]

    ( http:// or https:// + {prefix} + . + {baseURL} + . + {suffix} + / + {path} )
    [img]att2[/img]

    *Where {} denotes a variable, and represents a hard value
    [i]edited by james.hartzell@decisions.com on 2/7/2020[/i]

  • I seem to be having this issue currently in 5.16 and cant really pinpoint what is allowed and not allowed. What I want to do is {BaseURL}/mfb/v1/{Endpoint},but I get the error referenced above by OP. I tried other variations, but couldnt figure out why some worked and others didnt. Is there a reason why this shouldnt work in 5.16, and what is the closest alternative?
    [i]edited by austin.valentine on 3/12/2021[/i]

Sign In or Register to comment.