Skip to main content
Business Central forum
Answered

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

editSubscribe (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 59,978 Super User 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 59,978 Super User 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 3,550 UG Leader 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 2,716 Super User on at

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans