Rory Hansen

Authenticating with LinkShare’s Link Locator Direct web service with C#

Posted in .net, internet marketing, web development by Rory on the September 6th, 2007

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I’ve spent the last couple hours debugging an authentication issue with LinkShare’s Link Locator Direct web service. My console app was throwing the following exception:

System.Web.Services.Protocols.SoapException: org.apache.axis.AxisFault:Pass in username/password

The error message seems straight-forward enough– “Pass in username/password.” But what do you do if you know you are passing in the username and password?

This was the code I was using:

LinkShareTextPromotion.EJBTextPromotionServiceService tp =
     new LinkShareTextPromotion.EJBTextPromotionServiceService();
tp.Credentials = new NetworkCredential(username, password);
tp.PreAuthenticate = true;
LinkShareTextPromotion.Text[] results  = tp.GetAllLinks(sid);

Anyway, I finally lucked out and stumbled onto this link on the LinkShare forums, which lead me to Gordon Weakliem’s blog that had a working solution. Apparently this problem occurs due to how .NET authenticates.

If you’re experiencing the same error and got here via Google, then I hope this helps you get on your way.

One Response to 'Authenticating with LinkShare’s Link Locator Direct web service with C#'

Subscribe to comments with RSS or TrackBack to 'Authenticating with LinkShare’s Link Locator Direct web service with C#'.

  1. Sulip said,

    on October 20th, 2007 at 11:16 pm

    Can you explain the working code with a VB.net illustration. Thank you so much

Leave a Reply