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
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
Attachments
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 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 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 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 User Group 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 Super User on at

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans