On my last blog here, we discussed another point about representation and classes.
While there are lot to be learned and discussed, as promised I wanted to take this time and talk about how you can test REST web services with a simple representation we created previously.
Before beginning the topic, if you search, our online help for “Web services integration” you will get to below page.So as it’s mentioned on the online help you can use Web API which delivers REST web services to update and create records only for modules that are using Classes and representations.
On this example I am going to use Postman, to test REST web services (you can use other applications like SOAPUI as well) and below steps assumes you have installed Postman, for more information related to Postman visit https://www.getpostman.com
First lets use GET request to look at the details of a record.
As you saw above , it was easy to send a GET request and use the details facet.
Now what if you want to Create a record using REST Web service.
Before I get to the details of how you can create a record using Web service, if you search online help for “Web services creation “ you will see below.
So in order to get a listing of all the properties on your representation you can use a Prototype request by sending http://Servername:8124/sdata/x3/erp/SEED/$prototypes('ZCLIENT.$details')The result will list all the properties of your representation. Now in order to Create a record follow below steps.
You can use REST web services with your Representation to Create records.
What is next:
There are a lot to be discussed with the new style of coding, so stay tuned for more in future.
How to make "Links" on creation? When I try to insert an order record, it says "SORDERP: Mandatory link". There is nothing with that name in SORDER metadata (The representation). There is a table SORDERP that links with SOHNUM, but how to create that link when creating a record?
For Deleting a record, Take a look at "SData web service for Delete" in the online help.
How can I delete a record using rest?
How do I call the method of the Representation via REST services (what http link) ?
Thanks once again for your good job.
I was able to do everything you posted in here. Just one doubt: How to create a child instance?
Here is the forum post I created asking that question: sagecity.na.sage.com/.../102648
Great value! I think this is the same tecnic Office Add-in uses to collect data from a representation? Not?
© 2016 The Sage Group plc, its licensors or its affiliated companies. Sage, Sage logos, and Sage product and service names mentioned herein are the trademarks of The Sage Group plc, its licensors, or its affiliated companies. All other trademarks are the property of their respective owners. For more information, visit www.sage.com.
Community Terms of Service | Community Guidelines | Blogs | Community Help