Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

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

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 64,622 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 64,622 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 8,080 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 5,353 Super User on at

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans