Sample Code: .NET Client ApplicationTo access Enterprise Web Services (EWS) using the sample .NET client application, follow these instructions. EnvironmentTo set up your .NET environment, install the following package: Note: Contact your system administrator if you need help in setting up your .NET environment. Source code and Sample DataFor .NET, the sample code includes SampleData, API specific code and use cases. While API specific sample code helps you understand the usage of individual API, the use cases demonstrate a workflow or typical system usage. Please refer to the Build and Run section
below to know how to use these sample codes PrerequisitesThe .net sample source code below makes use of the following EWS utility files. These files abstract out the configuration and service management used in the sample source code.
Note : These files must be added in the project when executing the sample source code. API Specific Sample CodeThe following sample codes are available for EWS APIs :
Use Cases / WorkflowsThe following use cases are available:
Build and RunTo build and run the .NET client application run through the following steps: 1. Create a directory called YahooEWSClient under your C drive and go to that directory. 2. Use wsdl.exe to auto-generate the code from the WSDL. It generates a class called EWSService.cs. C:\Program Files\Microsoft.NET\SDK\v2.0\Bin"\wsdl.exe
/l:cs /o:EWSService.cs /sharetypes
https://sandbox.marketing.ews.yahooapis.com/services/V5/ExcludedWordsService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V5/LocationService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V5/CampaignService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V5/AdGroupService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V5/AdService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V5/KeywordService?wsdl
3. Download EWSConfigurator.cs, EWSUtil.cs, ServiceLocator.cs, ewsconfig.properties and sample data properties files (sample_data_*.properties), and save them to the YahooEWSClient directory. 4. Edit ewsconfig.properties to contain your EWS credentials
5. Compile and generate an executable file called YahooEWSClient.exe C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:exe /out:YahooEWSClient.exe EWSService.cs EWSConfigurator.cs EWSUtil.cs ServiceLocator.cs 6. Run the application using this command:
Known IssuesThere are no known issues at this time.
|