Yahoo! Search Marketing

YSM Yahoo! Group Discussions

View All

YSM Blog Posts

Enjoy the Silence (While You Can)
Tue, 24 Nov 2009 19:15:31 +0000

Breaking News from Yahoo! News
Fri, 20 Nov 2009 00:47:21 +0000

You’re Invited…
Tue, 17 Nov 2009 20:03:16 +0000

Anti-Phishing Reminders
Mon, 16 Nov 2009 20:56:48 +0000

One Shining Moment
Thu, 12 Nov 2009 18:28:28 +0000

View All

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 in setting up your .NET environment.

Source code and Sample Data

For .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

Prerequisites

The .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 Code

The following sample codes are available for EWS APIs :

Use Cases / Workflows

The following use cases are available:

Build and Run

To 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

  • USERNAME
  • PASSWORD
  • LICENSE
  • MASTER_ACCOUNT_ID
  • ACCOUNT_ID
  • 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 EWSService.cs EWSConfigurator.cs EWSUtil.cs ServiceLocator.cs  

6. Run the application using this command:

prompt> YahooEWSClient.exe

Known Issues

There are no known issues at this time.