Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Is custom web service MUST be a POST method and why ?

(0) ShareShare
ReportReport
Posted on by 592
hi guys,
 
Just being told that when we create custom Web Service, it should be for a POST method ? may I know if that is true ?
For example if I create custom web service for retrieve PO status, and the response is will tell use the PO status and each of PO line statuses, should that be a POST method also ?
Actually I want to know also where exactly we tell system that it is for GET or POST ?
I only know that if the service is for update something in F&O, I will choose POST in Postman and for retrieve I will choose GET, so this has no relation to any setting in F&O, is it not ?
Kindly help to make me better understanding.
 
Thanks.
  • Voltes Profile Picture
    Voltes 592 on at
    Is custom web service MUST be a POST method and why ?
    Hi Martin,
     
    Yes, what I mean by data entity is OData.
     
    But, for the "why", I just want to know the reason, although I'm quite happy to just follow what has been defined. I'm not here for doing what I like, basically :D
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    Is custom web service MUST be a POST method and why ?
    You'd need to ask Microsoft why they chose a different design than what you'd like.
     
    I guess you mean OData services when saying "or using data entity". That's using OData protocol, which is a completely different thing. There you use GET to get data, and POST, PATCH and DELETE to change data. If you're interested in details, refer to OData documentation.
  • Voltes Profile Picture
    Voltes 592 on at
    Is custom web service MUST be a POST method and why ?
    Hi Martin,
     
    Thank you for this information.
    "The decision was done by Microsoft", may I know the reason behind this "rule" ?
     
    So, can I confirmed that:
    1. for using custom service, it will always POST method.
    2. for using data entity, it will be GET method ?
     
    Thanks.
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    Is custom web service MUST be a POST method and why ?
    Regarding "where exactly we tell system that it is for GET or POST", you have no such a choice when creating a custom service in F&O. The decision was done by Microsoft. You use POST to call a custom service and GET to get description of the service (see Discovery of JSON-based custom services in AX 7).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans