Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

BC>SaaS>CodeUnit>Published soap service consume in c# get unauthorized

(1) ShareShare
ReportReport
Posted on by 124
Hi,
I have a custom Codeunit and published it as a web service (soap). Now I am trying consume this web service in C#, but it throws unauthorized 401.
Please advice.
 
Thanks
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 75,723 Super User 2024 Season 2 on at
    BC>SaaS>CodeUnit>Published soap service consume in c# get unauthorized
    Hi, it looks like your company name has spaces in the middle and needs to be converted into a URL Name. Hope the following can give you some hints.
     
     
    Thanks.
    ZHU
  • D365 Warrior Profile Picture
    D365 Warrior 124 on at
    BC>SaaS>CodeUnit>Published soap service consume in c# get unauthorized
    Thanks everyone for your response.
    YUN ZHU, I can consume odata (Chart of account) using postman. One problem happening while trying to use custom developed codeunit published as service. while executing it throws

    {
        "error": {
            "code": "Internal_DataNotFoundFilter",
            "message": "The company \"CRONUS Inc\" does not exist.  CorrelationId:  ce4db0f8-4fed-410b-8046-b4d8b3152e00."
        }
    }
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,723 Super User 2024 Season 2 on at
    BC>SaaS>CodeUnit>Published soap service consume in c# get unauthorized
    This is still a certification issue. It is recommended that you test it in PostMan first. After passing it, you can directly convert it into C# code.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,389 Super User 2024 Season 2 on at
    BC>SaaS>CodeUnit>Published soap service consume in c# get unauthorized
    Hi,
     
    hope the following helps
     
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • gdrenteria Profile Picture
    gdrenteria 13,008 Most Valuable Professional on at

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,684 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,414 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans