in

didierdanse.net

Site personnel de Didier Danse
Didier Danse's Personnal Website
Microsoft Most Valuable Professional SharePoint

didierdanse.net - Development News

January 2009 - Posts

  • SharePoint: How to set an URL column using code?

    It is not a trick but it can be useful for a lot of developpers. The opertaion is easy but way to assign the field can divert from what you are expecting.

    item["myfield"].Value = "http://myserver.com, description string";
  • Running Virtual PC on Vista

    When starting a virtual machine using Virtual PC 2007 and Vista, you receive this message

    image

    I was told that Virtual PC 2007 is not compatible with Vista. This is a false sentence.

    You are certainly know that Vista has a User Account Control mechanism that prevents applications to use files on file system. So you have to run Virtual PC as an administrator to be allowed to access these files.

    You just have to right-click on Virtual PC icon and select Properties. Then go to Compatibility tab and check Run this program as an administrator.

    image 

    That's all!

  • Microsoft TechDays Belgium: March 10-12 2009, Antwerp

    IT Professionals:

    • Come and learn more about how the System Center products can help you to manage your environment more efficiently
    • Explore the new functionalities in Windows Server such as virtualization, directory services
    • Find out what new enterprise features will be included in Windows 7
    • How to secure your environment with the Microsoft Security Products
    • How will the Microsoft Virtualization technologies help you simplify your IT Infrastructure
    • What improvements have been done in SQL Server 2008 to ease the management of your SQL infrastructure

    Developers:

    • Three developer tracks: Tools and Languages, Web and Client Experience, Servers and services (SQL Server 2008, SharePoint, Office)
    • Become familiar with the technologies released with .NET Framework 3.5 SP1
    • Learn how to use the technologies that will matter in the future, such as REST, cloud, WPF, XAML, …
    • Learn about Microsoft’s newest announcements around cloud computing (Azure)
    • See what is coming with Visual Studio 2010, .NET 4.0 (C# and VB)

    On March 10, at the preconference, you have the choice between three targeted tracks:

    • It Pro’s : Windows Server 2008 R2 Essentials
    • Developers: Deep-dive into development for Microsoft Office SharePoint Server 2007
    • Architects: Software + Services: the convergence of SOA, SaaS, Cloud Computing and Web 2.0 

    This event is not free but you will have the opportunity to listen and discuss with top speakers coming from all around the world.

    Early bird rate if registering before January 16th!

    Coming from Luxembourg? Send your coordinates and receive information about de{lux} package.

    Information and registration: http://www.microsoft.com/belux/techdays/about.aspx

  • SharePoint: A Proxy Web Service that allows the use of GetListItems in Lists.asmx from InfoPath

    When you call the GetListItems method in Lists.asmx Web Service, you have to pass some XML parameters. These parameters are not well understood by the Web Service so the use of this Web Service can be difficult and maybe impossible.

    XML parameters are written as strings in InfoPath window (I know that XML is just a string that follow some predefined rules).

    image

    This string which is encoded before pass it to the Web Service is no more understandable by the Web Service.

    As the problem is find we can do some additional tests. Calling the Web Service from a .NET application can be done without any issue. According to this, there is a solution: create and use a Proxy Web Service (coded using the .NET platform) that will be deployed to SharePoint platform. This Proxy will convert the string to a real XML content.

        <WebMethod()> _
        Public Function GetListItems(ByVal listName As String, ByVal viewID As String, ByVal query As String, ByVal viewFields As String, ByVal rowLimit As String, ByVal queryOptions As String, ByVal webID As String) As XmlNode
            Dim service As SharePointListsWS.Lists = GetWebServiceInstance(webID)
    
            Dim queryElement As XmlNode = CreateNode("Query", query)
            Dim viewFieldsElement As XmlNode = CreateNode("ViewFields", viewFields)
            Dim queryOptionsElement As XmlNode = CreateNode("QueryOptions", queryOptions)
    
            Return service.GetListItems(listName, viewID, queryElement, viewFieldsElement, rowLimit, queryOptionsElement, webID)
    
        End Function
    
        Private Function GetWebServiceInstance(ByVal webID As String) As SharePointListsWS.Lists
            Dim service As New SharePointListsWS.Lists
            service.Credentials = System.Net.CredentialCache.DefaultCredentials
    
            service.Url = SPContext.Current.Web.Url + "/_vti_bin/Lists.asmx"
    
            Return service
        End Function
    
        Private Function CreateNode(ByVal name As String, ByVal innerXml As String)
            Dim document As New XmlDocument
            Dim node As XmlNode = document.CreateElement(name)
            node.InnerXml = innerXml
            Return node
        End Function

    After having transform strings parameters to correct XML content, the Proxy Web Service will pass the XML parameters to Lists.asmx Web Service. This time GetListItems method is able to interpret the parameters. Values coming from the GetListItems method are returned directly to the client (in this case InfoPath).

    If you want to code this Proxy Web Service, you have to know:

    • How to code a Web Service;
    • How to modify auto-generated elements to allow integration to SharePoint platform;
    • How to add this Web Service to SharePoint platform.

    There is a few articles about each of these topics. If you don’t want to do all these points, you can just install the attached Web Service: Download

    It is quite easy as you just have to:

    • Unzip the attached file;
    • Click on install.bat.

    Attention! Be aware that the actual version of this package will erase and replace spdisco.aspx file. When uninstall the Web Service the file is deleted. You should test it on test environment before put it in production. Furthermore, you should backup the file before any other operation.

More Posts
L'auteur du site ne peut être tenu responsable des dommages que les informations fournies pourraient entraîner. Tout est cependant mis en oeuvre pour éviter tout désagrément.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems