web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Custom Services not returning values only Class Description

(0) ShareShare
ReportReport
Posted on by 250

Good day,

I have a custom Web service that am using for a test.

class CustomerStatementService
{

    public str getFoo()
    {
         
        return "Hello World";
    }

}

When i make a GET call on this service i get the class description and not the expected response.

{
    "Parameters":[],
    "Return":{
                "Name":"return",
                "Type":"String"
            }
}

I also returned a contract class. instead of getting the values in json, i got the response as the description of the class.

Thanks for your assistance.

I have the same question (0)
  • nmaenpaa Profile Picture
    101,166 Moderator on at

    Since the issue is in your code that calls the service, could you share it?

  • Matthew Ireti Profile Picture
    250 on at

    I using an API Tester and not code to interact with the service.

    Find the screenshot below

    customservice.png

  • nmaenpaa Profile Picture
    101,166 Moderator on at

    Not sure how to use this tool. But did you try any out of the box D365FO services with it? This way you can easily prove if your service is somehow different, or if you're just calling the services wrong.

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    By the way in your screenshot you are making a POST call, but in your original message you talk about GET call.

    Did you try to GET?

    Here's also some sample from Microsoft if it helps you: github.com/.../Program.cs

  • Matthew Ireti Profile Picture
    250 on at

    The ScreenShot is a get call and the HTTP Method is on TOP Left of the API Tester.

  • Verified answer
    Martin Dráb Profile Picture
    238,097 Most Valuable Professional on at

    GET indeed gives you the description. If you want to get the return value, use POST instead of GET.

  • Matthew Ireti Profile Picture
    250 on at

    I tried making the call using the FMVehicleInventoryService

    api/services/FMVehicleInventoryServiceGroup/FMVehicleInventoryService/RetrieveAvailableVehicles

    The result is thesame.

    pastedimage1587485000900v1.png

    Tried in the browser too got the same response

    pastedimage1587485095883v2.png

  • Matthew Ireti Profile Picture
    250 on at

    Thanks @Martin, but i keep get 403 error when the action is a POST

  • Martin Dráb Profile Picture
    238,097 Most Valuable Professional on at

    It sounds like a problem with authorization.

    At least you're now calling the right thing.

  • Matthew Ireti Profile Picture
    250 on at

    Could this be the subscriber access level property on the Service Operation method?

    Though And am using the admin credential to access the service.

    For now only the GET request works

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 679 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 429 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 264 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans