Call a Microsoft Dynamics 365 Business Central function through a Web Service : SOAPAction

Today I did some work with a Logic Apps and one of the requirement was to call a Business Central function through a Web Service. 

I normally use Postman to simulate requests, export the collection and use that to create the Logic App connector. 

Codeunit which I published as a web service had few functions exposed. I wanted to call one of those functions with values passing in and read the return value. 

If I just call (POST) Web Service with the SOAP Envelope (Like below image) it will just return the WDSL. Not the result I was expecting. 

Header :


SOAP Request and Response:


However, SOAP UI return the value I was expecting it to return. 


How that can be possible?  We looked into the “HTTP log” of the SOAP UI, and we saw SOAPAction is defined and its pointing to the function I want to call. 

I did the same thing in Postman and it worked. Below is my request header and you can notice that I add “SOAPAction” to the header. 

If you didn’t define the “SOAPAction” in the request header, the result will bring back the WDSL regardless of your SOAP Envelope. 

I use the postman request to create my HTTP request in Logic App. There is a much easy way of doing this in Logic App with the help of custom connector. I will share those details in another day from a new blog post. 


** Thank you Stephen Gichure for helping me to prepare this blog post.

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

2 comments

    • Nuno Silva on March 25, 2021 at 3:53 am

    Hi,
    How do you build your header? do you use SOAP ?
    Beste Regards
    NS

    • Grant Brimhall on August 14, 2021 at 10:49 am

    just what I needed. Thank you. Had to add SOAPAction to the header.

Comments have been disabled.