INCLUDE_DATA

Article written

  • on 06.09.2007
  • at 10:42 PM
  • by Rory

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

Sep6

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.

subscribe to comments RSS

There is one comment for this post

  1. Sulip says:

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

Please, feel free to post your own comment

* these are required fields