BizTalk 2006 R2 – RFID: Weird Error in sample

I’ve spent the last couple of days digging into the new RFID technology that is included with BizTalk 2006 R2. I removed BizTalk 2006 from my standard VPC image and I dropped the new RFID components on the server. This VPC image was build on Windows 2003, SQL Server 2005 – SP2, VS 2005, ASP.NET 3.0 and WSE 2.0. It would turn out that the WSE 2.0 would turn out to be the problem for me.


 


I successfully completed the core install and configuration and eagerly tried to setup the Contoso sample that is included. This sample includes a sample Device Provider, a Reader Simulator and a Sample process to handle the simulated tag reads. However, when I ran the ContosoSetup.cmd file that is suppose to install, configure and startup the demo, I received the following error.

This request operation sent to net.tcp://<server_name>:7891/rfid/service/ProviderManager did not receive a reply within the configured timeout (00:01:00).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.

Being fairly new this, I had no idea what this meant, so I decided to skip the sample and just try to manually add in the Contoso provider by using the RFID management tool. However, I didn’t have any luck with this either. So I dug deeper into the Help files and fortunetly there is some pretty good advice for debugging and resolving this issue. Basically, when you register a new provider, a new virtual directory is created in IIS. A number of issue were preventing this VD from running correctly. The biggest issue was the Windows SharePoint Services was including the new directory in its list of managed paths. Therefore I had to go into the SharePoint Administration sites, select “Manage Virtual Server”, select “Default Website”, select “Manage Defined Paths” and then manually add in the virtual directories to the “Excluded Paths” list. Once I had done this, then I was at least able to get the website to load in the browser.  I had placed a basic test.html file in the directory and I was able to view the HTML contained within it.


 


However at this point, I still couldn’t register my new provider. I dug deeper into the docs and they recommended browsing directly to the hosting.svc file that is contained within the virtual directory. When I did this, I got the ever helpfull “Server Error” message in my browser and nothing more. Thankfully, I have run into this issue enough that I had a couple of ideas of what to do. I started by opening the web.config file in the root c:\inetpub\wwwroot folder. Inside this file, there is a <Trust> tag that by default had a setting of “level=WSS_Minimal”, I needed to change this to “Full”.  Also, the RFID engine requires Anonymous Access to be setup on the virtual directory, so I loaded up the directories settings and checked for this. While I was in there, I noticed that the Contoso Installation Script had tried to set the default user account to “Administrator” (this was the account I was logged in under). However, the account name was misspelled as “Administartor” and this had caused the Application Pool to fail and shut down. I changed the spelling error and restarted the new App Pool that was setup during the sample installation


 


After making these changes, I tried to browser the hosting.svc file again and I received another error.  An error occurred loading a configuration file: Access to the path ‘c:\inetpub\wwwroot\web.config’ is denied.  Fortunetly, the fix for this issue is included in the help docs. To resolve this issue, grant the IIS_WPG group Read permissions to the web.config file.


 


After I made this last change, I was able to view the hosting.svc file in my browser. I once again tried to manually register the Contoso provider using the RFID administration tool and everything worked.  I re-ran the Constosetup.cmd file and then went in and re-did all of my manually fixes to correct all the issues with all of the virtual directories it created. I used the RFID management console to manually startup the provider, device and process. Once I did this, I was able to successfully receive tag events from the Contoso Device Simulator.


 


A bit of a bumpy ride based on the WSE 2.0, but it was nice to see almost all of my issues outlined and documented in the core Help Docs.


 


Cheers and keep on BizTalking


 

Developing SharePoint 2007 Web Parts – Book Excerpt

The nice guys over at WROX have published an excerpt of my web part chapter from the Real World SharePoint 2007 book. It’s only a small piece of the complete chapter, discussing the basic web part development stuff.

Web Parts are the building blocks of pages in SharePoint sites. Users of SharePoint sites can make use of those building blocks to determine what should be displayed on a specific page in a particular SharePoint site.

When you install SharePoint, you can make use of some out-of-the-box Web Parts straight away. Depending on whether you have Windows SharePoint Services (WSS) or Microsoft Office SharePoint Server (MOSS) as your SharePoint installation, you’ll have more or less. Additionally, every SharePoint list and document library will have a Web Part counterpart that can display the contents of the corresponding list or document library.

Of course, the out-of-the-box Web Parts are not the only ones that you can use! Developers can build their own Web Parts as well and deploy them to the SharePoint server. End users won’t notice the difference between the custom Web Parts and the out-of-the-box Web Parts, so Web Parts are a great way to extend SharePoint.

This article takes you through the basic steps to create your own Web Parts in various ways.
(read full excerpt here)

You can read an excerpt of Andrew’s WCM chapter overe here.

Technorati tags: sharepoint, sharepoint2007, webparts, book, wrox

BizTalk Accelerator for SWIFT 2007 Message Pack is Released


BizTalk Accelerator for SWIFT 2007 Message Pack has Released To Web!


This new release provides industry-standard compliance with the SWIFT 2007 Standards Release Guide (SRG) specification, required for communication across the SWIFT network starting in October 2007.   New features include:


%u00b7         Complete re-packaging of all SWIFT FIN Flat File message types and business rules.


%u00b7         Updates to all message schemas and business rules for compliance with SWIFT 2007 Certification requirements.


%u00b7         Support for SWIFT Net Phase 2 PKI header information.


%u00b7         Roll-up of all schemas and business rule Hotfixes not superseded by 2007 requirements.


 


Regards,


Marjan Kalantar

Expression Encoder now available for trial and purchase

The Expression Encoder was released this morning and is available for trial and purchase here. Since the previous beta Live Production has been added… also I have been testing the Silverlight Streaming Plug-in Preview that is almost ready for prime time and will be made available shortly.



Check out Ben’s videos.


Also I have noticed that the Around The Clock event is being promoted on the Expression front page (above the Silverlight on Linux news no less!!)



Check out the global  Expression around the Clock site featuring rock stars like Bill Buxton and make sure that if you are in Auckland on the 4th of October that you register for the New Zealand leg of the journey… we are close to half full already!

Silberlight 1.0 Released to the Web

Well the two Scott’s have blogged it… Scott Barnes and Scott Guthrie that is… the next thing to do is read the press release and read what Miguel has to say.


Now we just need to wait a few more hours for the expression site to drop the Expression Encoder 1.0 release and for the MS silverlight pages to be updated to talk about the new sites including the Silverlight mini site being created by IdentityMine for the upcoming Emmy Awards oh yes and let us not forget the 80’s glory of WWF WWE (remember the bushwackers!?) if it wasn’t for twitter we would never have gotten the backstage view of that one!


I LOVE the subtle Video Brush in the WWE player above the TV and the diva shorts aren’t too bad either… so terribly unPC.


Enjoy

Using the Current Page URL in the UrlAction of a SharePoint Feature

With the introduction of the feature framework in SharePoint 2007, developers have some great opportunities to customize and enhance nearly everything in SharePoint. One of the things that’s quite easy to do with the help of a feature, is to add and/or replace functionality in the web user interface of SharePoint site. This was typically very hard to do (in a nice way) for the previous version of SharePoint (remember having to edit a javascript file to add a menu item in the ECB?).

Let’s take the following example of a feature’s manifest file:

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
    <CustomAction
        Id=”{6FCB0F81-2105-4d9f-96BF-C48A19B8E439}”
        Title=”My Link”
        Location=”Microsoft.SharePoint.StandardMenu”
        GroupId=”SettingsMenu”>
        <UrlAction Url=”_layouts/mypage.aspx”/>
    </CustomAction>
</Elements>

When activated, the feature will add a menu item to the Settings menu of any SharePoint list or document library. The menu item will have the title My Link, when clicked the user will navigate to the page mypage.aspx in the _layouts folder (the typical place to deploy your custom application pages).

img 1

If you build some functionality in the mypage.aspx, in many scenarios this page will need to know from which list the link originated. This can be done by using URL tokens in the UrlAction element:

<UrlAction Url=”_layouts/mypage.aspx?listid={ListId}“/>

The {ListId} URL token will be automatically replaced with the ID of the list, in which the menu item is shown. In the mypage.aspx, you can retrieve the value of the listid parameter by making use of the QueryString. Once you’ve got the ID, the object model can be used to get a reference to the SPList instance of that list. According to the documentation on MSDN, the following URL tokens can be used:

  • ~site – Web site (SPWeb) relative link.
  • ~sitecollection – site collection (SPSite) relative link.
  • In addition, you can use the following tokens within a URL:
    • {ItemId} – Integer ID that represents the item within a list.
    • {ItemUrl} – URL of the item being acted upon. Only work for documents in libraries. [Not functional in Beta 2]
    • {ListId} – GUID that represents the list.
    • {SiteUrl} – URL of the Web site (SPWeb).
    • {RecurrenceId} – Recurrence index. This token is not supported for use in the context menus of list items.

Unfortunately there is no token that will give you the URL of the page on which the feature’s link is being displayed. In many cases you want to have that URL to be able to redirect, after you’ve shown your custom functionality, to the originating page. SharePoint itself uses this technique a lot: in many URL’s you’ll find the Source parameter:

http://wss.u2ucourse.com/Lists/Links/NewForm.aspx?Source=http%3A%2F%2Fwss%2Eu2ucourse%2Ecom%2Fdefault%2Easpx

The URL above points to the NewForm.aspx for the a Links list. Normally when the user fill’s out this form and clicks OK, this page redirects to the default view of the list. Because this link has the Source parameter, when the user clicks OK (or cancel), the page will redirect to the default.aspx instead. You can add the Source parameter to a lot of pages in SharePoint, giving you full control over the redirecting.

So the issue is: we want to include the URL of the originating page in the UrlAction element of the feature’s CustomAction, but all we get are a bunch of ID’s and some URL’s that are not useful for this scenario. As usual peeking in the machine room of SharePoint itself can give you some good ideas to solve this issue. The SharePoint guys themselves sometimes use Javascript functions in the UrlAction, instead of ordinary hyperlinks. Thus with some clever use of Javascript, it’s quite easy to solve the problem:

<UrlAction Url=”javascript:window.location= ‘{SiteUrl}/_layouts/mypage.aspx?List={ListId}&amp;Source=’ + window.location”/>

The actual link is a Javascript function that will navigate to a specific URL. This URL is a concatenation of the URL of the page to display (including for example the ID of the list as a parameter in the QueryString), and the Source parameter which is dynamically set the current page’s URL. Et voila, the constructed link will point to your page, and the redirect will always point to the page you started from.

Extra: this tric can also be used to overcome a bug in SharePoint that causes a URL token of a CustomAction to be replaced only once. So if you have used the ListID token two times in a UrlAction element, only one of the token’s will be replaced with the actual ID of the list. The user “FlatEric” (what’s in a name?) explains this in the Community Content of the How to: Add Actions to the User Interface article on MSDN.

I found an ugly way to bypass this flaw:
<UrlAction Url=”javascript:function process(){var site='{SiteUrl}’;var item={ItemId};window.location.href=site+’/Lists/MyList/NewForm.aspx?ID=’+item+’&amp;Source=’+site+’/Lists/myOtherList/DispForm.aspx?ID=’+item;};process();”/>

Technorati tags: sharepoint, sharepoint 2007, features, feature, urltoken, urlaction, development

The Book: Real World SharePoint 2007

Two weeks ago the book Real World SharePoint 2007: Indispensable Experiences From 16 MOSS and WSS MVPs became available, I had the honour to work with a bunch of really smart guys and girls to create this book. There are 16 chapters in this book, all written by a SharePoint MVP based on his/her personal experiences and expertise. My chapter dives into web part development, the basics of web part development are covered as well as advanced scenarios like connectable web parts and the SmartPart.

If you want to read an excerpt: a part of the web content management chapter by Andrew Connell is available at the WROX website.

Technorati tags: sharepoint, real world sharepoint 2007, book, web parts

Let’s get started again!

Wow, it has been a long time since my last post, five months to be precise! So it’s about time to get started again… my colleagues have been bugging me a lot lately.

I’ve you’re wondering what I’ve been doing in the past months: besides working and some holidays, I’ve been a ghostwriter for the blog of my little daughter (check out the photos of there if you want to see how much a baby can grow in five months).