Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
Continuing from my previous post. Find the link to access the same in case you missed it.
Exposing & Consuming the Web service from & inside Navision – Part-1
Exposing & Consuming the Web service from & inside Navision – Part-2
Exposing & Consuming the Web service from & inside Navision – Part-3
Step 5: Create a Codeunit to test Retrieve the data using above DLL and Send data in XML Format using another Web Service exposed in Dot Net.
How to create WCF Service Application using C#, Publishing it and creating DLL Class Library is out of scope of this document. You may require to take help from guy who are comfortable in .Net technology.
Let’s start with new codeunit, select the available ID in your database and suitable name to save this codeunit.
We will define a Global variable to hold the data we receive from Navision Web Service and pass to Web Service exposed outside Navision.
Create a Function to Read/Export the data using Navision Web Service.
Variables defined to the function is also shown in below screen.
We will add the code similar to below. Description provided along with the code in below screenshot.
Create a Function to Send Exported data from above function to the Web Service created outside the Navision. Web Service created in DotNet.
Here too we are using DLL file of the Outside Exposed Web Service.
Now we have our both function ready.
One which Export data consuming the Navision Published Web Service and then read the data in BigText Variable and finally converted to Text variable.
Second one will send data consuming the Web Service Exposed outside Navision created in DotNet.
Let us test our process if it works as desired.
We will call above both function.
When we call First Web Service as a result we get the XML format file data in my Global defined Text Variable.
We will review the data which we are going to send to Second Web Service on Screen for which we are simply calling the Message.
Finally we will send the data to the Second Web Service, the content of XML file stored in our Global Variable.
Code we use is as below shown screenshot.
Save the codeunit and execute, as we have written our test code in Run trigger so we can directly run this codeunit.
The output will be as shown in below screenshots.
Until this step our Data is Exported and data is loaded in Global defined Text variable.
Here the content of Text variable is shown in Message window, which we can verify the data which we are going to send to the external Web Service.
As a final step we are sending this content to the External Web Service Exposed using DotNet.
Verify the data received at the DotNet side. You can program the Second Web Service as save the content on disk as file or perform any processing like inserting those data in some other table or displayed on screen.
That’s it for this series.
I will be posting couple of more posts on Web Services soon.
Since this was in response of request from one of my reader so I stick to the requirement.
In my other post I will show some different flavour of using the same.
Till then keep exploring and learning.
Will be back with other posts soon.
Business Applications communities