Doba

Create a DLL from a WSDL

If you are planning on developing in .NET with SOAP the example provided in the API Documentation, you will be required to build two (2)  DLL files, as you see below. What is not explained very clearly is that there are two API WSDL files: the ApiRetailerSearch and the ApiRetailerOrders.



This tutorial explains how to build those DLL file with tools available through Visual Studio in a Windows environment. If you don’t already have Visual Studio, you must get at least the Free Visual Studio Community version. Once you have it, following this tutorial will work properly:
 

Step 1. Open “http://www.doba.com/developer/20110301/index_retailer.php#SOAP_API_URL” in an internet browser of your choice



 

Step 2: Search ‘cmd’ in the search bar and select the ‘Native Tools Command Prompt’



 

Step 3. Click on the ‘Native Tools Command Prompt’ and open it to still read the “Retailer API Documentation”



 

Step 4. Create a .cs file from the WSDL file Doba provides by typing the following into your command prompt:


wsdl /o:C:\Users\<your_user_name_here>\Downloads\productOptions.cs https://www.doba.com/soap/20110301/wsdl/ApiRetailerSearch.wsdl


 

Step 5a. Click ‘Enter’ on your keyboard and confirm that the command created the .cs file:



 

Step 5b. Check that the productOptions.cs file is in the Downloads folder



 

Step 6. Create a DLL file from the productOptions.cs file by typing in the following into your command prompt:


csc /target:library /r:System.Data.dll /out:C:\Users\<your_user_name_here>\Downloads\productOptions.dll C:\Users\<your_user_name_here>\Downloads\productOptions.cs


 

Step 7a. Click ‘Enter’ and confirm that the .dll file is created


 

Step 7b. Check that the .dll file is in your Downloads folder



 

Step 8. Create a .cs file from the WSDL file Doba provides by typing the following into your command prompt:


wsdl /o:C:\Users\<your_user_name_here>\Downloads\ordersOptions.cs https://www.doba.com/soap/20110301/wsdl/ApiRetailerOrder.wsdl


 

Step 9a. Click ‘Enter’ on your keyboard and confirm that the command created the .cs file:



 

Step 9b. Check that the ordersOptions.cs file is in the Downloads folder



 

Step 10. Create a DLL file from the ordersOptions.cs file by typing in the following into your command prompt:


csc /target:library /r:System.Data.dll /out:C:\Users\<your_user_name_here>\Downloads\ordersOptions.dll C:\Users\<your_user_name_here>\Downloads\ordersOptions.cs



 

Step 11a. Click ‘Enter’ and confirm that the .dll file is created

 

Step 11b. Check that the .dll file is in your Downloads folder





Now you can successfully build out your application and use the WSDL, C#, and DLL files properly.
 

Did you find this article helpful?