The PDN as well as the Pega 7 Platform product help are both your best resources for information on REST service integration. Of course, post comments on the forum as well for any specific issues you're facing.
Ok, sounds good. I think we will have a full guide by the end of this forum topic. I hope I could use this topic as a sounding board of sorts.
Should I go down the: Designer Studio => Integration => Services => Service Wizard (Service Purpose: Invoke existing activity Rules & Service Type: HTTP) route or Create a new Service REST rule manually by selecting Service REST from the Integration-Services category in the Records explorer? What's the difference between the 2 approaches? And which one's easier?
Not sure I fully understand what the above means but it seems to me like that it will allow you to create RESTful webservices but you will have to implement the REST architecture yourself. At least that what it looks like when I checked out a few OOTB HTTP services.
On the contrary, looking at some OOTB REST services, I can see the typical HTTP methods like GET, POST, PUT, DELETE sections in there along with some additional and useful features like query parameters mapping, etc.
Using a Wizard in Pega 7.1 does not preclude the ability to manually edit the Rules generated by the Wizard. These options are not mutually exclusive. Wizards help to "Jump Start" our development efforts and they save us a great deal of time. Try using the Wizard to get started and then feel free and comfortable editing and modifying the Rules generated by the Wizard to suite your specific requirements.
I am sorry, I stand corrected, I was confusing the "Create REST Integration" Connector Wizard with your request. I am escalating your question in the hopes someone else on our team may be able to provide a more lucid response.
I have been working on creating rest services with json output. It seems Pega doesnt have a wizard for creating restful services. So what I did was create a service package manually, and then create a rest service using that package.
The challenge will be in parsing the json response, which will require use of Public APIs for xml to json conversion.
I have also been working on creating REST service through PRPC 7.1 and I am struggling with mapping the JSON message data. I manage to put the JSON string in a single string property on the clipboard by filling the "Message Data" section with "Map To" set to "Clipboard" and "Map To Key" to the clipboard property. However there is a "JSON" option for the "Map To" property but I am failing to make that work.
I have actually figured it out. If you have a JSON request, you can put "JSON" in the "Map To" and the name of a clipboard property in the "Map to key". That property needs to be a property of type "Page" with a data class that has properties with similar names than the payloads one. For example:
if JSON request is:
"company_name": "Foo industries",
then Pega class and properties should be something like:
.company_identifier of type text
.company_name of type text
.createdCaseID of type text
.Request of type Page with class: ABC-FW-APP-Int-RESTSERVICE_Request
.Response of type Page with class: ABC-FW-APP-Int-RESTSERVICE_Response
then in your REST service rule:
Page Class: ABC-FW-APP-Int-RESTSERVICE
Method tab (then open the one you want to use, I have used POST as I want to create a work object):
The response I send has to be in JSON as well so I have done the same thing but reverse. Created a .Response property on the service class that is of type Page with a class that contains my response properties. Then in my service rule I have set "Map From" to "JSON" and "Map From Key" to ".Response". I'll update my example post to reflect that. Any reason why you proceeded the way you did instead of using "Map to" set to "JSON"?
I was not sure how exactly JSON mapping works for REST Services. Also, when I initially tried this process, I was not getting the response in json. I will try the method suggested by you again to see if it works. Will keep this post updated.
I was trying to do a POC using REST service. The request in the query string is having a param set like : "Hub.XYZ:xyz". For this we are getting an Inbound data mapping exception. But if we change the request param as "Hub_XYZ" then the inbound data is getting mapped properly.
The client is expected to send query using "." format. Can any one help in resolving this issue ASAP??