Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
rakshit_doshi
Active Contributor

Dear All,

There were a lot of speculation of that POST was not supported with SMP 3.0.3 and will be supported with PL02.

I with my friend, jitendrakumar.kansal figured out that it even works with SMP 3.0.3

The scenario we are testing are using SOAP Web Services.

Step 1.

Create an OData Model of your name choice.

Thing to note here is that we need to define all the input parameters of the Web Services as Keys.

This can be done by selecting a particular entity field and click on Properties tab and make Key as true.

It would be something like this

Step 2 : Implement the service by right clicking on the Yourname.odata file and select Implement Service. This will create Yourname.odatasrv file.

Right click on the Yourname.odatasrv and choose Select Datasource. From the EntitySet select your Entity Set and choose operation as Create. Select the type of Datasource. Since we are using a Soap Service we choose SOAP Service as the Data source.

Add the properties for the Operation like Endpoint, Port name, Operation name etc and click finish.

Step 3. Right Click on the Create Operation and choose Define Request Mapping

Map your entity sets with the fields.

Similarly do the Response mapping and deploy the project on the SMP Server.

Step 4.  Go to the Advanced Rest Client on Chrome

give your url http://localhost:8080/gateway/odata/sap/NameofProject;v=1/MethodName

Choose GET

In the header section add a new header

x-csrf-token and value as fetch

Click on Send. It will get you a X-CSRF-TOKEN in the response header.

Copy this token.

Now click on the POST Radio button

For the x-csrf-token paste the value returned from the previous operation

Add a new header value Content-Type and choose value as application/xml

In the Payload section add the below body

<?xml version="1.0" encoding="UTF-8"?>

<atom:entryxmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<atom:content type="application/xml">

<m:properties>

<d:firstname>value</d:firstname>

<d:lastname>value</d:lastname>

<d:agriculturecardno>value</d:agriculturecardno>

<d:veterinarycardno>value</d:veterinarycardno>

<d:username>value</d:username>

<d:mobileno>value</d:mobileno>

<d:emailid>value</d:emailid>

<d:preferlang>value</d:preferlang>

<d:notificationflag>value</d:notificationflag>

<d:notes>value</d:notes>

<d:deviceType>value</d:deviceType>

</m:properties>

</content> </entry>

To verify if the payload is properly formatted or not go to the below site and paste your payload and check.

Free Online XML Formatter - FreeFormatter.com

Once its successful, paste the properly formatted payload and click on Send.

It will post the record in the database.

I hope this helps,

Thanks,

Best Regards,

Rakshit Doshi

Labels in this area