In this post we will create a codeunit and publish this as a web service
which will read a xml and send the XML in a variable big text format and
consume the web service in another Codeunit of Navision
I will divide this Blog into 2 parts.
In the first part we will be publishing the Codeunit as web service.
In the second part we will be consuming the web service.
Pre-requisite-
1) You will have to create staging table, I have
created customer staging table.
2) You will also have to create XMLport for the
staging table we created so that we can export and import data into the table.
3) You will need to install Chrome extension Boomerang
(we will discuss its use later on).
Let’s begin-
- I have created a staging table of customer with Primary Key as Entry No
- Similarly, I have created a XMLport of this staging table.
- Please change the Encoding property to UTF-8 and default namespace to No. As shown in the screenshot.
- I have saved a xml with dummy data in it which has same structure as our XMLport(which we created earlier).
- we must create a codeunit and then publish it in RTC as web services.
- In this codeunit we have provided the path of the Xml which has the dummy data, we open the file, read it and store in it our bigtext variable which is FileBigtext.
- After this Open RTC, go to web service and publish the codeunit.
- Now to test If the SOAP URL (which is generated in our RTC web service) is returning correct response or not we will use Boomerang which I told you in the pre-requisite.
- We will create a new project and enter the SOAP URL and click on Send and check the response. The response status should be 200 and it should something like this.
- If the status is 200 and getting the response how we are supposed to then everything is running fine.
- In my next post we will create a codeunit and consume the webservice and import the data into the table.
Please let me know any feedback or suggestions for this post
Your blog is attention-grabbing! Keep up the good work! I really love this.
ReplyDeleteCRM for Outlook