HOW TO: Pass A Parameter To A Procedure Exposed As A Codeunit With SOAP Web Service In Dynamics 365 Business Central

Scenario: You wrote a procedure in a codeunit that takes one or more parameters and exposed it as a web service. At the time of writing this blog post, all codeunits published as a web service in Dynamics 365 Business Central have a SOAP end-point available only. You want to test a POST request using Postman (or any API testing tool of your choice) invoking your procedure.

1: Write and Publish a Test Procedure as a Codeunit

Above procedure will take 3 parameters and if OrderDelivered is ‘true’ it will invoke a procedure.
Once published, as seen above, you will have only SOAP URL available.

2: Prepare a GET Request URL and Send a Request

3: Find SOAPAction from the RAW Response

4: Add SOAPAction in HTTP Header

5: Send a POST Request

Success if you see 200 OK. If your procedure failed to execute, the error is thrown you will see it as a Response in POSTMAN

Do you need help? Write to me at [email protected] or connect with me on LinkedIn

Leave a Reply