Testing the legacy service
To test the legacy endpoint of the Lead Service, the SDK includes a collection of test applications you use to verify each method. To use these test applications, you must first log in as a user that was assigned the Superuser role in the Dynamics Security Console. To verify the Leads service, complete the following procedure:
Open the solution file with Visual Studio.
Using Visual Studio, open the file named SampleLeadServiceTest.sln in the SampleLeadServiceTest(legacy) folder.
Verify the References for each project.
Use Solution Explorer to verify the References for each test project. Reload any references that are not able to find the specified assembly.
Add a Web Reference to each project.
Use the Solution Explorer to add a Web Reference to the Leads service for each test project. Right click the project name and click Add Web Reference. In the Add Web Reference window, use the URL box to specify the Leads service:
http://machine_name:port_number/DynamicsGPWebServices/SampleLeadWebService.asmx
In the Web reference name box, enter SampleLeadService. Click Add Reference.
Build the test applications.
In the Build menu, choose Build Solution. Visual Studio builds a separate console application for each project. The application files are in the "\bin\debug" or "\bin\retail" folder of each project.
Run each test application.
To test each service method, click the corresponding project folder in Solution Explorer. From the Debug menu, choose Start Debugging to run the application. To ensure the required data exists for each test application, run the test applications in the following order.
Test application
Result
CreateLeadTest
Creates a new lead. Use the Dynamics GP client to verify that the new lead was created.
UpdateLeadTest
Updates the contact information for the lead created by CreateLeadTest. Use the Dynamics GP client to verify the change to the contact information of the lead.
DeleteLeadTest
Removes the lead that was created by CreateLeadTest. Use the Dynamics GP client to verify the lead was deleted.
GetLeadTest
Retrieves a single lead record. The application displays the name of a lead in the console window. GetLeadTest retrieves a single lead using the sample data provided for the Lead Maintenance sample application.
GetListTest
Retrieves a list of leads. The application displays the number of leads in the list. GetLIstTest retrieves a collection of leads from the sample data provided for the Lead Maintenance sample application.