Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

REST connectors fail when the query params have a blank value

SA-49356

Summary



REST Connectors fail when query parameters have blank values.

For example,

Send the address as a query string parameter. When the parameter is blank, Pega 7.1.8 does not include the parameter. However, Pega 7.2 sends the query parameters along with the corresponding blank values.

HTTP request on Pega 7.1.8 -
URL constructed is: http://HOSTNAME/REST/v1/ServiceName?o=xml&ed=true&wp.1=30+flatbush+ave+11217&wp.2=20+flatbush+ave+11217&routeAttributes=excludeItinerary&distanceUnit=Mile

HTTP request on Pega 7.2 -
URL constructed is: http://HOSTNAME/REST/v1/ServiceName?o=xml&ed=true&wp.1=30+flatbush+ave+11217&wp.2=20+flatbush+ave+11217&wp.3=&wp.4=&wp.5=&wp.6=&wp.7=&wp.8=&wp.9=&wp.10=&wp.11=&wp.12=&wp.13=&wp.14=&wp.15=&wp.16=&wp.17=&wp.18=&wp.19=&wp.20=&wp.21=&wp.22=&wp.23=&wp.24=&wp.25=&heading=&optimize=&avoid=&distanceBeforeFirstTurn=&routeAttributes=excludeItinerary&timeType=&dateTime=&maxSolutions=&distanceUnit=Mile&mfa=



Error Messages



<StatusCode>400</StatusCode>
<StatusDescription>Bad Request</StatusDescription>



Steps to Reproduce



Invoke the REST service using a REST connector.


Root Cause



A backwards compatibility defect in Pegasystems’ code or rules.

The out-of-the-box Connect-REST activities are refactored across different Pega versions (Pega 7.1.8 and Pega 7.2) to cater to different requirements.

The pySkipBlankQueryParts parameter is introduced for the pxDereferenceEndpoint activity rule. The parameter controlled the behavior of how the query string is formed when the request parameter values are blank.

The client activity rule, which invoked the Connect-REST, must set the pySkipBlankQueryParts activity parameter’s value accordingly.

When the value passed is True, the resultant query string does not include the query string parameters with empty or blank values. However, if the value is False, the resulting query string includes the request parameters along with the empty or blank values.



Resolution



Perform the following local-change to fallback to Pega 7.1.8 default behavior:

Set the pySkipBlankQueryParts parameter value to True in the calling activity rule before the step that invokes the Connect-REST method.

Below is the sample Java step code snippet:


ParameterPage pp = tools.getParameterPage();
pp.putString("pySkipBlankQueryParts", "true");



Suggest Edit

Published March 20, 2018 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us