Authenticating with LinkShare’s Link Locator Direct web service with C# 1
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.
Can you explain the working code with a VB.net illustration. Thank you so much