Tuesday, February 15, 2011

SharePoint 2010: Email A Link….Sample?

This was some strange behavior: The ‘E-mail A Link’ option in the ECB – or whatever the SharePoint 2010 name for ‘context menu’ is – was opening up the email client (in this case Outlook 2010) with a new email that contained the word ‘Sample’ – no link to the document, just the word ‘Sample’.

image

image

I will not reveal that in 2010 that the ‘E-mail a Link’ action results in a round trip to the server for no good reason (oops) – but I will reveal that it is this round trip that caused the issue.

Resolution

Since WCF is messing with you again just because you probably wanted a site with multiple authentication schemes and did not want the headache of extending the site,  add this to the site’s root web.config to make WCF clam up:

<configuration>
  <system.web>
      …
   
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>
</configuration>

That is strike #3,9343,091, WCF!!!  

image

BTW, this also had the nice side effect of fixing SPDesigner 2010 access to the site. Once change in place, SPDesigner could access the site.

14 comments:

  1. Howdy!

    Can you think of anything that would cause the Send To -> E-Mail a Link to fail with no message? It just doesn't do anything.

    This happens in IE8 and FF7. Outlook is set to default EMail client.

    Thank you for any advice you have :)
    Ryan

    ReplyDelete
  2. Hey Ryan-

    That sounds to me like a javascript issue, so I would use Firebug in FF to trace it through to the failure point. Not the easiest thing once it gets to the line break free core js files, so coffee up first. You will probably get to the ajax request back to the server (the useless one that I mention above) where there is the most chance of things going wrong. Maybe there is no response from server? Or the response is an error that is silently handled... All guesses of course, but the important thing is getting more details by tracing through the js.

    Another guess would be a missing control in the master page, but if it works in other browsers, that can probably be ruled out.

    ReplyDelete
  3. Thanks so much for the response- I really appreciate that :)

    Hope you have a great weekend!
    Ryan

    p.s. Investigating using your suggestions, I'll post what I find.

    ReplyDelete
  4. I have this exact problem, and can find no other post about it to suggest a resolution. I have the serviceHostingEnvironment line in my web.config already (I didn't have to add it, oddly enough), but I still have the problem.

    Any other suggestions??

    ReplyDelete
  5. Still possibly a problem with the callback step that is executed (the unnecessary one I refer to above) when the 'send to' link is clicked.

    If you are sure you have the web.config set right - and it is the right web.config file - then I think the next step would be to inspect the HTTP traffic with a tool like Fiddler.

    With tracing on, you should see a request to this url: /_vti_bin/client.svc/ProcessQuery

    If all is well, this request should result in a 200 status code. If not, the reason for the non-200 may be a lot of things... check the server event logs and IIS' W3C logs for clues.

    Even with the 200 status, the request may fail - so an example of a successful response is as follows (found easily w/Fiddler):

    Response:
    [
    {
    "SchemaVersion":"14.0.0.0","LibraryVersion":"14.0.6108.5000","ErrorInfo":null
    },0,"[url to your document here, encoded]"
    ]


    Note the 'ErrorInfo' property in the response - it may indicate the issue if you are lucky. If not, then I think you may need to resort to more advanced WCF debugging - awful stuff.

    One final tip: Have the browser's JavaScript console up to ensure there are no hidden errors when the send to link is clicked.

    ReplyDelete
  6. Thanks for the reply, Chad. Unfortunately, this problem still vexes me. Here is the log entry on the request to /_vti_bin/client.svc/ProcessQuery. Does this indicate the source of the problem?

    Thanks.

    2012-01-03 20:40:16 172.16.1.82 POST /_vti_bin/client.svc/ProcessQuery - 443 0#.w|brouse\pcl 172.16.7.34 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+GTB7.2;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+.NET+CLR+3.0.04506.648;+MS-RTC+LM+8;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+InfoPath.3) 302 0 0 228

    ReplyDelete
  7. BTW, the redirect is to the default "access denied" page.

    ReplyDelete
  8. Patrick-
    Is there any response content? Looks like that the request is getting to the server OK. So now the question is, what - if anything - is the server sending back as a response? (sidebar rant - this is the annoying part: the whole request to the server is not necessary - but the SP code does it anyway!)

    ReplyDelete
  9. Thanks for sticking with me on this, Chad. The server's response seems to be to the access-denied .aspx file in the _siteassets directory. Using fiddler, I can see that the correct link to the SP document is going over (seems to be going over) to the server via Javascsript (no erros in Java console, BTW). Our SP site is using Claims and NTLM authentication, and I think that is still the issue. If I enable anonymous access to the site in IIS, the "email a link" function works ust fine. Obviously, though, I can't allow anonymous access to this secrued site. I verified that the web'config at the root of the site contains the line in your post.

    Any other ideas?

    ReplyDelete
  10. I have the same Issue Patrick. Did you ever solve it? I am using Claims based and NTLM as well. I have the same WebApp Extended to a Internet Zone using FBA and it works without any issues. I agree that it is related to Claims/NTLM

    ReplyDelete
  11. Enabling Anonymous on the IIS site also allows the functionality to work

    ReplyDelete
  12. Never heard back from Patrick - perhaps he lucked out and no longer has to work with SharePoint... This one has not popped up for me in a long while. Hopefully cracking the shell with allowing anon access is acceptable - if not, would love to hear about your success or failures in fixing it up!

    ReplyDelete
  13. I got the same issue,

    "Email a Link" feature doesn't work.
    ANd we cannot open the site in designer.

    And I have above line of code in web.config file,

    One which has single binding, looks its doesn't have any of the above issue.

    If web has multiple bindings, we see the above two issues.

    Solution:
    As Chad suggested: Provide anon access
    Or have single binding..

    Else..contact Micrrosoft support.

    ReplyDelete

 
© I caught you a delicious bass.
Back to top