Question

Issue with mapping with HTTP over Service-REST

Hello,

I have created one Service-REST and the request is HTTP with name-value pair. I am posting the HTTP request body to do unit testing from the service.I am using HTML Postdata as map to. But in the parameter page of the service activity the first name-value pair is missing which is after '?' in the request body, it is mapping name-value pair from first '&'.

Do I need to do anything else.

Thanks

Saikat

***Updated by moderator: Lochan to update Categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
December 28, 2016 - 1:40am

Hi,

I did try to replicate the issue in local instance. Please find my configuration details as below.

Service-REST rule:

Service-Activity:

Running the Service-REST rule standalone:

Values of Prop1 and Prop2 in tracer

Please create a use case similar to above, let me know if face any issues. Correct me if I miss anything in configuration .

Comments

Keep up to date on this post and subscribe to comments

Pega
December 24, 2016 - 9:41am

Looks like page context is missing in Service activity to have request values. For example MyServicePage will be holding the values incase if you use page as MyServicePage in Service-REST rule.

Please enable the tracer to see where exactly values have been missed.

 

December 25, 2016 - 12:15pm
Response to Gangababu

I have MyServicePage mentioned in the page. But values are coming in the parameter page. There only the first value is missing.

Pega
December 26, 2016 - 10:15am

Please provide Service-REST configuration screenshots in detail along with Tracer xml.

December 27, 2016 - 4:01am
Response to Gangababu

December 27, 2016 - 4:08am
Response to SaikatD3

I am not getting userlang=FR from the HTTP request in the parameter page

Pega
December 27, 2016 - 6:28am

May I know what is the value fo Map To Key for request? I could see it's missing in the provided screenshot.

December 27, 2016 - 6:49am
Response to Gangababu

I didn't provide any map to key field there, when I am giving that value then also no change is happening. Also values are getting mapped in the parameter page not the service page.

Pega
December 28, 2016 - 1:10am
Response to SaikatD3

Hi,

 If we use HTML PostData values will be stored in parameter page instead of Service Page. I was in a impression that it was json data.

  • If the Map To value is HTML PostData, leave this field blank. The name/value pairs in the string will be mapped to the parameter page of the service activity rather than the primary page.

Pega
December 28, 2016 - 1:40am
Response to Gangababu

Hi,

I did try to replicate the issue in local instance. Please find my configuration details as below.

Service-REST rule:

Service-Activity:

Running the Service-REST rule standalone:

Values of Prop1 and Prop2 in tracer

Please create a use case similar to above, let me know if face any issues. Correct me if I miss anything in configuration .

December 28, 2016 - 4:53am
Response to Gangababu

Hi

If I am using the http url full then the first name-value pair is missing. I have done in the below way.

 

 

 

Here "say" is not getting mapped in the parameter page.

 

Thanks

Saikat

Pega
December 28, 2016 - 5:08am
Response to SaikatD3

In message buffer just give say=hi&to=mom remove http url one. I tried with SOAP UI as well as RESTClient, I was able to get the response successfully and parameters are being mapped.

Pega
December 28, 2016 - 5:09am
Response to Gangababu

And also post the property-set method step of activity to set the say and to.

.prop1 -> param.say

.prop2 -> param.to

Hope this helps!

Pega
December 28, 2016 - 5:18am
Response to Gangababu

You could also add Log-Message step at beginning of the activity and try to print values being passed as a request.

If you pass the request like say=hi&to=mom

Add below message to Log-Message step and set logging level to InfoForced and observe the behavior.

"Service Activity execution:"+param.say+param.to

December 28, 2016 - 5:49am
Response to Gangababu

Yes I have checked it from SOAP UI and it's working. All name value pairs are mapping. Thanks for the help.

Pega
December 28, 2016 - 6:26am
Response to SaikatD3

You are welcome.

December 28, 2016 - 5:32am
Response to Gangababu

In the SOAP UI are you giving the url which was generated in the service package and these parameters?

Pega
December 28, 2016 - 6:30am
Response to SaikatD3

http://hostname:port/prweb/PRRestService/ServicePackage/ClassName/MethodName

You could pass post data in resource parameters

Content-Type should be multipart/form-data

December 28, 2016 - 5:34am
Response to Gangababu

Could you post one screenshot how you are testing it through SOAP UI

Pega
December 27, 2016 - 7:25am

What's your PRPC version? I remember there was a similar issue on 7.1.8 with '+' handling in 'pyInvokeHTTPConnector' activity.

 

December 27, 2016 - 7:34am
Response to HabeebBaig

The PRPC version is 7.1.9. Did you get any solution for that?

Pega
December 27, 2016 - 1:08pm
Response to SaikatD3

Yes there was a solution as hotfix given on 7.1.8, I am not sure if the code changes are reflected in 7.1.9 or not as a result of the provided HFix.

However the issue which you have reported here seems to be related to '&' so we can do view java of 7.1.9 on pyInvokeHTTPConnector activity and see if the special characters are getting replaced or not.