Acessando Excel Services a partir do SharePoint

Hoje eu tava revisando o código de uma Web Part usada no SharePoint que fazia alguns cálculos usando Excel Services.
Para quem ainda não sabe, o Excel Services expõe a funcionalidade de cálculo do Excel como um Web Service.
 
O projeto tinha uma Web Reference (um proxy) apontando para o Web Service do Excel.
 
O grande lance é que quando você está acessando o Excel Services a partir do SharePoint, não é preciso fazê-lo através do proxy. É possível e recomendável referenciar diretamente o assembly Microsoft.Office.Excel.Server.WebServices.dll.
Alguns dos métodos das classes do assembly têm assinatura direrente do proxy. Nos métodos com os quais tive contato, a diferença consistia do método local ter um parâmetro a mais: out Status[].
 
Como principal benefício, eu destaco o deployment mais simples, já que não é preciso lidar com a configuração do Web Service
 
Maiores informações:
 

SharePoint’s disposing problems

After returning from the MVP Summit I joined Microsoft Consulting Services as part of the Green Badge program (vendor).
On my first "real" project here, I had my first experience with Windows SharePoint Services 3.0.
I’m in charge of reviewing part of the code written by a customer’s developers for best practices in general and performance in particular.
 
One thing that you should be carefull with is disposing the objects which implement IDisposable.
That is specially important with a couple of SharePoint’s classes since they reference unmanaged COM components.
The problem is that (in my opinion) the SharePoint developers didn’t do a very good job of implementing the Disposable pattern.
 
There are tons of links out there pointing to problems and workarounds for them. Here’s a sample:
 
What makes the case even worse is the fact that:
  • Depending on how you got a reference to an object you should dispose it or not. SPSite should be disposed if you constructed it (new SPSite()). But you should NOT dispose it if you got it from SPControl.GetContextSite().
  • Several classes don’t dispose of there containing Disposable objects. SPSite.RootWeb for instance.
I’ll eventually blog more about these issues if I get allocated in more SharePoint projects.