App working on one page, but not on the other


#1

Hi all,

I have developed a SharePoint WebPart which shows our companies private account timeline (and does nothing else). It used TweetSharp for C# and stopped working when API1 was retired. I updated to a new Version of TweetSharp, deployed it on my test server and it worked again. I then deployed the same WebPart to the production server, and it was unable to get any tweets, while at the same time getting tweets on the test server.

I then switched from TweetSharp to LinqToTwitter, same story: It worked on two of the test servers, but I got “No message from Twitter” on the production server. The servers are managed by the same policies, so they have the same access to the Internet. With API1 it worked without problems on the production server.

This is probably not a SharePoint Problem, since the WebPart is pretty simple, works on two test servers, and worked before with API1, so I guess I have to change some twitter settings in App Management, but I don’t know where to start. I’m pretty new to Twitter Development.


#2

Hi,

I’m not too familiar with SharePoint, but maybe I can suggest some debugging tips:

  1. I can’t recall ever seeing “No message from Twitter” as an error message. Ideally, you would be able to catch an exception and look at the details of the exception.
  2. If you can log onto the server remotely and run a small console app that does the same thing, you might be able to see something (e.g. an error) that you aren’t seeing in SharePoint.
  3. Try running Fiddler on the server to see the HTTP traffic and see if what message Twitter is returning.
  4. If you’re getting a 401 Unauthorized, you can visit the LINQ to Twitter FAQ for help on that subject: https://linqtotwitter.codeplex.com/wikipage?title=LINQ%20to%20Twitter%20FAQ&referringTitle=Documentation.
  5. I don’t know if you’re really getting 401s, but sometimes server times are too far apart from the Twitter server time, which might be the case for the Twitter API v1.1 servers. You can tell by looking at the response from Twitter. If you haven’t hooked up Fiddler, you can do a sample app with LINQ to Twitter and print out the values of the Headers property on TwitterContext to see what Twitter is sending back and find the server time.

#3

I have seen the message “No message from Twitter”, but it had to do with a firewall rule on the server. I had to move the code to an outward facing server. It does not use sharepoint, but it does use LinqToTwitter (Thank You, Joe - your a lifesavor.) I know you say it is managed by the same policy, but that would be were I would start looking. Could SharePoint have different ports open on test than production? I not as good with the architecture and rely on the operation support. When I moved my code from test to production, I got that error message.


#4

Thanks for your help so far. I executed my console application on the production server and it worked. Then I used logging on the production server and got this:

“An operation failed because the following certificate has validation errors:\n\nSubject Name: CN=api.twitter.com, […]”

So it is a SharePoint security error after all, thanks to both of you for pointing me in the right direction. I wonder why this did not happen on the test servers, but I’ll continue to investigate.


#5

Don’t know if it will help, but here’s a search on the LINQ to Twitter discussion list for SharePoint: https://linqtotwitter.codeplex.com/discussions?searchText=Sharepoint.

I recall, some time ago, several requests to strong name the assemblies, so I included a LinqToTwitter.snk in the LinqToTwitter project that’s part of the downloadable source code.