Connecting to the Web Service API Using WSE 3.0 and .NET 2.0

From $1

    Doc-Wiki-BannerHK.png

    (Click the banner to go to the related Docs.Code.ExactTarget.com page.)

    This document contains conceptual and procedural information on connecting your development environment or other systems to the ExactTarget web service API using the WSE 3.0 standards. 

    This information contains instructions for connecting using Visual Studio 2005 and Visual Studio 2005 Express. For Visual Studio 2008, use the instructions for connecting via WCF.

    Why Connect to the Web Service API using WSE 3.0/.NET 2.0

    You can use the connection to the web service API to test your calls and perform various tasks, such as sending email and retrieving tracking information.

    How To Connect to the Web Service API using WSE 3.0/.NET 2.0

    You must configure your development environment correctly in order to establish a connection with the web service API servers. ExactTarget Web Services use WSS 1.0 message level security to secure communications with the ExactTarget servers. This means that messages sent to the web service API servers must be encrypted at the message level.

    Visual Studio 2005

    Follow these steps to connect your Visual Studio 2005 instance to the web service API:

    1. In Visual Studio 2005, create a new project.
    2. Right-click on that project and select Add Web Reference.
    3. Add the WSDL reference  https://webservice.exacttarget.com/etframework.wsdl in the URL field.
    4. In the Web Reference Name field, enter the title ExactTargetAPI.
    5. Click Add Reference.
    6. Return to the project window and right-click your project.
    7. Select WSE Settings 3.0.
    8. Under the General tab, click the Enable This Project For Web Services Enhancements checkbox.
    9. Click OK.

    If you wish to enable this feature on an existing project, right-click that project and select WSE 3.0 Settings to get to a screen where you can enable WSE for the project. If you enable WSE after you've added a web reference to the ExactTarget API, you will need to update the web reference.

    Visual Studio 2005 Express

    Users of Visual Studio Express editions cannot take advantage of the Visual Studio.NET/WSE integration. However, you can use the following steps to set up WSE with Visual Studio Express editions.

    1. Create your project.
    2. Close your project.
    3. Open project using the WSE client application.
    4. Click the Enable Web Service Enhancements checkbox.
    5. Open your project.
    6. Create the web reference to the WSDL at https://webservice.exacttarget.com/etframework.wsdl.
    7. Begin writing code.

    Code

    The sample code below demonstrates how to connect and interact with the web service API.

    PartnerAPIWse partnerAPI = new PartnerAPIWse();
    UsernameTokenProvider utp = new UsernameTokenProvider(username, password);
    partnerAPI.SetClientCredential<UsernameToken>(utp.GetToken());
    Policy policy = new Policy(new UsernameOverTransportAssertion());
    partnerAPI.SetPolicy(policy);

    This page was last updated by Ryan Williams on Fri, 06 Jan 2012 21:28:24 GMT.

    If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Ryan direct feedback, fill out the form below:

     


    Was This Page Helpful?
    Suggestions or Comments:
    Name (optional):
    Email Address (optional):
    Enter 23030 backwards:
       
    Tags: (Edit tags)
    • No tags
     
    Comments (0)
    You must login to post a comment.

     
    Powered by MindTouch 2010
    Admin