Thursday, July 02, 2009

Silverlight 2.0 – Silverlight Apps calling asmx web services

I while back I worked on a Silverlight application that was hosted in SharePoint. The Silverlight application was to call a web service written by a third party vendor in .NET 2.0.

Problem
As what we all normally would do in a Silverlight app is to call this web service. However, I got the following error when my application tries to call the asmx web service:

“An error occurred while trying to make a request to URI 'http://localhost:1000/webservice.asmx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details.”

SLAccessError

Solution 

After some research, I found a recipe to get it going again:

  1. Create a new file within the web service application (at the root of the requesting domain), called clientaccesspolicy.xml with the following contents:


    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*">
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>



  2. Create another file within the web service application(at the root of the requesting domain), called crossdomain.xml with the following contents:

    <?xml version="1.0" encoding="utf-8"?>
    <cross-domain-access>
      <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-access>

After adding these policy files, my app started working. Hope this helps.

References

http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx

http://timheuer.com/blog/archive/2008/06/10/silverlight-services-cross-domain-404-not-found.aspx

Microsoft SharePoint 2007 – Renaming a MOSS Server


This is the N-the time I’ve had to rename a SharePoint server, and every time I keep on forgetting the exact steps… so these are notes for the (Technical) me.

  1. Change each alternate access mapping for MOSS 2007/WSSv3 deployment in Central Admin reflecting new server name
  2. Register the change with SharePoint, using:

    stsadm -o renameserver -newservername <newname> -oldservername <oldname>


  3. Rename server in Windows
  4. Restart server
  5. Post restart, update SharePoint farm credentials using:

    stsadm -o updatefarmcredentials -userlogin <domain\domainuser> -password <password>


  6. Run an iisreset
  7. Check the accounts used in application pools within IIS, update to reflect new machine name accounts
  8. Rebuild the search index (remove and recreate)
  9. Operation Complete!

Source: http://www.sharepointblogs.com/mirjam/archive/2007/08/06/renaming-a-moss-server.aspx (Thank you Mirjam)

Wednesday, June 24, 2009

Microsoft SharePoint 2007 – An iPhone Client to view SP Content?

SharePoint comes standard with the support for mobile browsing – and if you’ve used it, you would have to say it does the job. But what if you now you feel like bringing surfacing the information on an iPhone (Besides browsing SharePoint sites directly from Safari)? The product would no doubt be a very attractive app for use on the go.

So recently, I stumbled across quiet an interesting product ‘iShare’ from Spyk software: A SharePoint Client App for the iPhone.

The iShare app allows users to login using Windows Authentication or SharePoint Forms Authentication and view, search and create content within a SharePoint Site. There is a list of files which this little app can open:

  • Adobe Acrobat (.pdf)
  • Microsoft Word (.doc, .docx)
  • Microsoft Powerpoint (.ppt, .pptx)
  • Microsoft Excel (.xls, .xslx)
  • Images (.jpeg, .jpg, .tiff, .gif)
  • Web pages (.html, .htm, .aspx)
  • Text Files (.txt)
  • Contacts (.vcf)
  • Now, I do not have an iPhone neither have I used this application – so I cannot comment on the product… so give it a shot and leave a comment :) Apparently you can get it on the iPhone Apps Store.

    http://www.spyk.com/Products/iShare/Pages/iShare.aspx

    Here are some screenshots from the iShare site:

    Tuesday, June 23, 2009

    Windows Presentation Foundation 4 in VS 2010

    I don't usually blog about things other than SharePoint or CRM... but this is just really cool – not new as we’ve all seen this on the surface, but new as it can work on Windows 7! In the video, the speaker has used a Codeplex project “MultiTouchVista” (http://www.codeplex.com/MultiTouchVista) in conjunction with a “Windows 7 Multi-touch driver” to enable user input for multi-touching on normal mice.

    Having asking Google more… there’s apparently much Developer resources on multi-touch: http://code.msdn.microsoft.com/WindowsTouch

    Now… I wonder if anybody out there has written a track pad multi-touch driver? I don’t want to plug-in more than 2 mice into my Dell XPS!

    Wednesday, April 08, 2009

    Microsoft SharePoint 2007 - Fixing a failed WSS v3 and/or MOSS 2007 SP1/Infrastructure Patch Upgrade

    The Upgrade Process
    I was upgrading an environment (MOSS version 12.0.0.4815) in the following manner:
    1. Check all Timer jobs have run to completion in the existing environment
    2. Check no errors with WSP
    3. Install WSS v3 SP1 Patch (Skip Configuration wizard)
    4. Install MOSS 2007 SP1 Patch (Skip Configuration wizard)
    5. Install WSS v3 infrastructure Patch (Skip Configuration wizard)
    6. Install MOSS 2007 infrastructure Patch
    7. Following the prompts for the Configuration Wizard (PSconfigUI).

    Okay, so far so good.

    The Problems
    In the middle of the configuration wizard, it seemed to have stayed on Step 5 for hours. Looking at the Event Viewer, errors with messages:

    Content index on Search could not be initialized. Error The content index is corrupt. 0xc0041800.Component: bd72df39-396a-472f-8a1a-db6c3241e922



    Checking Upgrade.log (in 12\Logs\), unveiled some Exception errors.

    The Solution
    So then I cancelled out of the setup (which took a while to cancel – actually it didn’t cancel until I ran the following command), and ran the following command to force the upgrade of the SharePoint environment:

    psconfig -cmd upgrade -force



    Checked the version numbers and the existing sites I had - That seemed to have fixed my issues


    Alternative
    Alternatively, the stsadm utility can be used (though I didn't have to use it):

    stsadm -o upgrade -forceupgrade

    For more details on this command:
    Upgrade: Stsadm operation (Windows SharePoint Services)
    http://technet.microsoft.com/en-us/library/cc288073.aspx

    Upgrade: Stsadm operation (Office SharePoint Server)
    http://technet.microsoft.com/en-us/library/cc263413.aspx



    References
    Command-line reference for the SharePoint Products and Technologies Configuration Wizard (Office SharePoint Server)
    http://technet.microsoft.com/en-us/library/cc263093.aspx

    Install Windows SharePoint Services 3.0 by using the command line
    http://technet.microsoft.com/en-us/library/cc752946.aspx

    Thursday, April 02, 2009

    Microsoft SharePoint - Version numbers

    It's been the Nth time I've had to checkup the version of SharePoint that is installed on a Farm - and I am now finally keeping this here for my own notes.

    All these times I've been hitting back on a very nice post by Penny Coventry that contains a list of SharePoint Patches and respective version numbers:
    http://www.mindsharpblogs.com/penny/articles/481.aspx

    The easiest ways I use to check version numbers are:
    1. In Central Admin, Site Actions > Site settings:



    OR

    2. In IIS, right click on the web application and select properties > 'HTTP Headers' tab, under Custom HTTP Headers section:

    Monday, March 09, 2009

    Microsoft SharePoint 2007 - Understanding performance considerations in SharePoint OM

    A colleague, Fernando Felman has highlighted a very useful and interesting blog spot by Andreas Grabner that walks-thru scenarios and looks into the performance of SharePoint when under various SharePoint object model calls.

    Though quite a few points in the post are obvious to the developer, I still think it is worth a good read :)

    The article:
    SharePoint Object Model Performance Considerations
    http://www.infoq.com/articles/SharePoint-Andreas-Grabner

    Sunday, February 22, 2009

    Live Framework: Creating a Silverlight Mesh-enabled web application in 8 steps

    I stumbled across this pretty awesome how-to article that talks about how to create a Silverlight Application that utilises features from the Mesh!

    Enjoy...
    Live Framework – creating a Silverlight Mesh-enabled web application in 8 steps