Question
Accenture
SG
Last activity: 27 Jan 2017 1:16 EST
Connect REST and Service REST
team,
Can anyone help on below issue.
We have Service RESt and Connect REST built. when we running Service REST in Service Contact with Request JSOn it is working firn. but when we are trying to hit with connect-rest we are getting error message as
Error mapping incoming response to .Test: org.codehaus.jackson.JsonParseException: Unexpected character ('R' (code 82)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@4678aa54; line: 1, column: 2] |
Even we are not able to trace ServiceRest rule when we are triggerring from Connect-REST i.e., nothing is traced. is this some related to Connectivity Issue or any issue is building Connect REST Rule
team,
Can anyone help on below issue.
We have Service RESt and Connect REST built. when we running Service REST in Service Contact with Request JSOn it is working firn. but when we are trying to hit with connect-rest we are getting error message as
Error mapping incoming response to .Test: org.codehaus.jackson.JsonParseException: Unexpected character ('R' (code 82)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@4678aa54; line: 1, column: 2] |
Even we are not able to trace ServiceRest rule when we are triggerring from Connect-REST i.e., nothing is traced. is this some related to Connectivity Issue or any issue is building Connect REST Rule
***Updated by moderator: Lochan. Removed user added #helpme tag. Apologies for confusion, shouldn't have been an end-user option.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
CA
What is the URL you use to log into designer studio? If you are logging into a tenant, there must be a tenant hash in the URL after prweb/PRServlet.
PEG
IN
May I know the PRPC version?
If version is PRPC7.1.8
ERROR MESSAGES
Please find the snippet from the logs below,
2016-01-05 00:00:15,770 [fault (self-tuning)'] [ STANDARD] [ PPROAR:03.15.01] (ector.Rule_Connect_REST.Action) ERROR tagent - Error mapping incoming response to .GetCaseSummariesGetCaseSummariesResponse: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
May I know the PRPC version?
If version is PRPC7.1.8
ERROR MESSAGES
Please find the snippet from the logs below,
2016-01-05 00:00:15,770 [fault (self-tuning)'] [ STANDARD] [ PPROAR:03.15.01] (ector.Rule_Connect_REST.Action) ERROR tagent - Error mapping incoming response to .GetCaseSummariesGetCaseSummariesResponse: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
STEPS TO REPRODUCE
Use Connect-REST and try to pass special characters.
RESOLUTION
Apply Hotfix-24502
-
Pavan SatyamNaidu Turipati
Accenture
SG
There are no special Chars and when we run Service manually in Service Requestor Context it is working Fine. So I have doubt whether there is any Connectivity issue with the EndPoint. Also the version is 7.1.6
Pegasystems Inc.
CA
Perhaps there is an exception on the service side and your service was returning an error which isn't in JSON format? Hence you see the exception during mapping of incoming response. To identify the root cause, dump the entire response onto a single-value property or a parameter on the parameter page using Map to as Clipboard instead of JSON on your Connect REST rule. Log the response and check if the response is as expected and that it is valid JSON.
Accenture
SG
here Service rule is not tracing (Trace open Rule) any thing when hit through COnnect-REST it is empty.But its fine when run manually. Also I tried through external REST Clients (Google Plug-In POSTMAN REST Client) then it is giving the below error
Request URI must contain tenant Hash, service package, class, and method keys
The EndPoint used is below it is Pega PDn Cloud where the Service is hosted
"https://paex15-eu.pegacloud.com/prweb/PRRestService/TestRest/Temp/TestServiceRest"
Pegasystems Inc.
CA
From the error, it looks like the URL you are hitting from your Connect REST rule is incorrect. The correct URL format when invoking a REST service created in a tenant is:
https(s)://<host>:[port]/prweb/PRRestService/<tenant-hash>/<service-package>/<service-class>/<service-method>
You need to include tenant hash in the URL, after PRRestService and before service package name.
Accenture
SG
What is this <tenant-hash> what is the purpose(valu in general it would be ) and as far as previous developments we never included this SERVICE REST ENDPOINT.
Also this error came when triggered from External Client not from CONNECT-REST.
Accepted Solution
Pegasystems Inc.
CA
What is the URL you use to log into designer studio? If you are logging into a tenant, there must be a tenant hash in the URL after prweb/PRServlet.
Pegasystems Inc.
CA
You must have received the same error when you invoked Connect REST. This is your response:
"Request URI must contain tenant Hash, service package, class, and method keys"
You have Map to configured as JSON in your connect REST. Since this error response isn't in JSON, you get this exception (notice the R in bold below, this is the R from Request URI...):
Error mapping incoming response to .Test: org.codehaus.jackson.JsonParseException: Unexpected character ('R' (code 82)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@4678aa54; line: 1, column: 2]
Accenture
SG
So please confirm what is the tenant-hash should be in EndPoint. From where can I get the value for it
Pegasystems Inc.
CA
Please check my question above. You will find the tenant hash in the URL you use to login to Pega.
Accenture
SG
Thanks It worked there after.
But to confirm how can we distinguish whether we logging into a tenant or normal
Accenture
SG
Also previously when we are working with these service we never included but it still used to work. How is it different here in Pega PDN Cloud?
Pegasystems Inc.
CA
Usually the URL format is a good indicator. The tenant hash in the URL is mandatory to log into a tenant. The Pega PDN Cloud instance must be a multi-tenant set up. That's why you ran into this issue. Always try to retrieve your Service REST URL from the service package. I guess the links to the services on the service package rule have the tenant hash included if you are logged into a tenant.
-
ShanmugaPriyan Rangasamy
Accenture
SG
But for the REST Service there wont URL generated form Service Package.
It is available for SOAP
Pegasystems Inc.
CA
When you open the service package, check the endpoint column. There is a link to each service in the service package.
Accenture
SG
In which version of Pega it is present. i'm checking inj 7.1.6 and there are only Contaxt, Pooling. Methods, Deloyment and History
PEG
IN
From PRPC7.1.8 onwards this column was introduced.
PFA
MUFG Pension & Market Services
IN
This error occurs whenever you are passing any wrong or null input as a parameter which are required to connect with the service. Try to give all correct input as a parameter.