Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to test custom service in my local DevVM ?

(0) ShareShare
ReportReport
Posted on by 516
Hi guys,
 
As a beginner in create custom services in D365 FO, may I know how to test it in my Dev VM ?
Also would like to know how to debug my program when something need to investigate ?
 
Need help for some guidance.
 
Thanks,
  • Layan Jwei Profile Picture
    Layan Jwei 7,634 Super User 2025 Season 1 on at
    How to test custom service in my local DevVM ?
    Hi Ken,
     
    No it shouldn't be different but just so that the discussion stays related to the question.
     
    Did it work with you at the end?
     
    Thanks,
    Layan Jwei
  • Ken Manhattan Profile Picture
    Ken Manhattan 516 on at
    How to test custom service in my local DevVM ?
    Hi Layan,
     
    No, I'm still gonna create custom service. I'm only testing Postman can work or not with my FO, by using the standard object which obviously their OData. Will that be different ? I mean call OData and call custom service ?
    I'm sorry I'm just new for working with API.
     
    Thanks.
  • Layan Jwei Profile Picture
    Layan Jwei 7,634 Super User 2025 Season 1 on at
    How to test custom service in my local DevVM ?
    Hi Ken,

    I thought you are trying to call the custom service but now you switched to oData?

    I think it's an issue with postman, maybe try to download Postman's desktop agent as it shows in your error.

    Let me know if it works after you do so.

    Thanks,
    ​​​​​​​Layan Jwei
  • Ken Manhattan Profile Picture
    Ken Manhattan 516 on at
    How to test custom service in my local DevVM ?
    Hi Layan & Mohit,
    Thanks.
     
    I tried to setup according to the help. I've managed to get the token. But during call (send) request, I hit error "Cloud Agent Error: Couldn't resolve host. Make sure the domain is publicly accessible or select a different agent"
     
     
    Here is my setup, just to inform this is the combination of few resources including the one that shared just now :
     
    1. I created my App Registration, and record the client id, tenant_id, client_secret. (one question here is in some resource it is specified there is no need to specify redirect URI, is that correct?)
       
     
    2. In D365 FO, go to System Administration > Azure AD applications
        
     
    3. In the Postman, I'm add new request to get the token like below and retrieve the token :
        
     
    4. Create new collection, 1st, go to Authorization then choose type : BearerToken, then paste the token from previous step, 2ndly, go to variables add variable for baseUrl to https://usnconeboxax1aos.cloud.onebox.dynamics.com/
    5.  Testing by create new request under this collection, and call OData, but retrieve the error :
         
     
    For the variable baseURL, I noticed already filled in by the correct URL ->
     
    May I know what is wrong ?
     
    This is run inside a VM, but based on the blogs2 that given, I don' t think this is a problem, right ?
     
    Thanks,
     
     
     
  • Layan Jwei Profile Picture
    Layan Jwei 7,634 Super User 2025 Season 1 on at
    How to test custom service in my local DevVM ?
    Hi Ken,
     
    There are mutiple ways to test your custom service. I will mention two options:
     
    1. You can add  C# projects in your x++ solution from gitHub.
     
    It has two options JSON and SOAP.
    If you want SOAP, then take authentication utility, soap utility and soap console application.
    If you want JSON, take authentication utility and JSON console application.
     
    Once you add the desired projects to your solution, and amend them to match your custom service objects. Then you can set the console application as a start up object and put break points in it, then click start to debug. After that you can attach iisexpress -- in this case you'll be able to debug both x++ and c#
     
     
    2. You can test your custom service via postman as mohit said. Once you finish your custom service development, you can put the url in postman, define the body to include the contract parameters fields you want. 
    To debug it, click attach process iisexpress, then go to postman and call the custom service url, the debug will be catched
     
    Thanks,
    Layan Jwei
  • Necklace Quote Profile Picture
    Necklace Quote 2 on at
    How to test custom service in my local DevVM ?
    I have one question in common. I'm trying to solve this problem, but I can't
  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    How to test custom service in my local DevVM ?
    Hi Ken, You can configure Postman and test your custom web service in your Devbox. Postman application can be downloaded on any machine or web application also works.
     
    Check this article 
     
    https://www.linkedin.com/pulse/microsoft-dynamics-365-finance-operation-custom-web-service-ahmad?utm_source=share&utm_medium=member_android&utm_campaign=share_via

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans