Yahoo! Search Marketing

Sample Code: .NET Client Application

To access Enterprise Web Services (EWS) using the sample .NET client application, follow these instructions.

Environment

To set up your .NET environment, install the following package:

Note: Contact your system administrator if you need help setting up your .NET environment.

Source Code and Sample Data

For .NET, the source code and sample data includes:

Build and Run

To build and run the .NET client application:

1. Create a directory called YahooEWSClient under your C drive and change 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/V4/ExcludedWordsService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/LocationService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/CampaignService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/AdGroupService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/AdService?wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/KeywordService?wsdl

3. Download YahooEWSClient.cs and sample data properties files (sample_data_*.properties), and save them to the YahooEWSClient directory.

4. Edit YahooEWSClient.cs to contain your EWS credentials, which are defined near the top of the file:

  • Username
  • Password
  • masterAccountID
  • accountID
  • license
  • MARKET
  • LOCALE

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 YahooEWSClient.cs EWSService.cs

6. Run the application using this command:

prompt> YahooEWSClient.exe

Known Issues

There are no known issues at this time.