Replace any String or Character Pipeline Component – Regex Version
I had previously created a pipeline to replace any string. What I liked about it was its simplicity. I could just put the string I wanted replaced, followed by a comma then the string I wanted as the replacement. I wanted to expand that functionality to allow replacing commas and other characters including HEX characters. Regex was my solution, so my new version allows you to replace any string with another using Regex expressions for .NET. Just include as many replacements as you’d like separated by commas.
Here’s a sample Regex expression I included:
(\d)\x2C(\d),$1$2,%u00bb,HEX CHAR,FRANK,RIZZO
It replaces
1. a digit surrounded comma with nothing ((\d)\x2C(\d),$1$2)
2. a HEX character “%u00bb” with the words HEX CHAR (%u00bb,HEX CHAR)
3. The word FRANK with RIZZO (FRANK,RIZZO)
Here is my input file:
Here is my output file:
Note to Self: Don’t forget to put parentheses around the groups for which you are searching. It allows the $n to work.
If you’d like a copy, please email me.
MS-HUG August 26-27
Is anyone going there this year?
Let me know.
Debugging the disappearing SQL Add Adapter metadata wizard
This afternoon Iencountered a very annoying problem. I wanted to generate a schema with the add adapter metadata wizard to use with the SQL adapter. Normally the wizard shows a couple of screens in which you have to enter information and at the end (after pressing finish button) you’ll get a generated XSD. On my […]
endpoint.tv – Getting Control of the URI with RESTful WCF Services
RESTFul people want to control the URI of their services. They focus on building a good information architecture that describes the resources their site provides. Historically most web sites described resources in terms of files and paths in the virtual root of the web server. But what if your resources are coming from a database and there are no files to speak of? What is the URI of your service then?
The default behavior of a RESTful web service in WCF is that you have a SVC file like "MyService.svc" and the first segment of your URI (after the host) is the path to the SVC file on your web site. The remaining portion of the URI is the name of your method and a query string arguments for the parameters.
For example
http://www.example.com/myservice.svc/GetWine?wineId=17
You can partially control this URI by applying a URI template. So for example in this case we could attribute the operation contract with a template like this
[WebGet(UriTemplate="wine/{wineId})]
This will change the portion of the URI after the .svc extension so our URI will look like this
http://www.example.com/myservice.svc/wine/17
Nice, but what if you want to eliminate the .svc extension? Well there are several ways you can get this done
- Scott Guthrie has a great blog post about this – Tip/Trick: Url Rewriting with ASP.NET
- Jon Flanders (MVP) blogged about writing an HttpModule – Using WCF WebHttpBinding and WebGet with nicer Urls
- The IIS7 Team Recently Released a URL Rewrite Module
- For IIS 5/6 you will have to build//use an ISAPI filter (See ScottGu’s post for some free ones)
My colleague Rob Bagby has created a nice screencast for endpoint.tv with a complete walkthrough of controlling the URI that features
- UriTemplate
- New WCF 3.5 SP1 features for URI control like compound segments and default values
- A URL Rewrite Rule for the IIS7 URL Rewrite Module
Be sure to check it out and build some RESTful WCF Services with the URI just the way you want it.
Add Adapter Wizard Error
If you ever get the error Unable to display adapter user interface. Value cannot be null.Parameter name: s
when trying to add a generated schema, from SQL/SAP/Dynamics…
This Week in Downloads – New WF Articles
This week, we’ve added two new articles for WF to the MSDN Online Library: an article by Jon Flanders to help choose between sequential workflows and state machines, and a major article by Michele Leroux Bustamante explaining the five most common WF deployment scenarios. Both articles have received great reviews from internal readers so far; and we’re hoping that you find them useful as well.
Additionally, we wanted to draw attention to someting we missed last week; Maurice de Beijer published an article last week on using the new WCF activities in WF 3.5 to connect your workflows to web services.
Jon Flanders: How to Choose a Workflow
Jon’s article on choosing between sequential workflows and state machines started out as a revisit to a topic that was touched on back in late 2005 by bloggers such as Dave Green and Ariel Schapiro, but hasn’t seen much proscriptive guidance since then. The question of which workflow model to choose has always been a common one; the other most common one is asking about the difference between WF and BizTalk. Jon’s article tries to explain the differences between the model and walk the reader through an implementation to help explain the decision factors.
We’re hoping that this article serves as a spark to reinvigorate the topic, and look at process patterns that may best fit one model or the other.
Michele Leroux Bustamante: WF Scenarios
Michele’s WF deployment scenario series explores the five general workflow scenarios that customers are using WF for today. Each section explores the benefits and limitations of WF within its scenario, and some best practices for implementation.
The article originally started out with the intention of being one paper to help explain where WF can be useful, but the overall paper quickly grew in size and scope as the sections grew, each telling a story of its own. As a result, we’ve split the paper out into an introduction and five articles to help make it less intimidating in size, and hopefully making it more accessible to folks.
This week, we publish the first two of the five sections: Human Workflows and SharePoint Workflows. The remaining three sections (Workflow Services, Rehosted Workflows, and Presentation Flow Coordination) will be published over the next few weeks, but we wanted to get these gems up here for your reading pleasure.
Maurice de Beijer: Using WCF with WF in .NET 3.5
Maurice published part 1 of his new article on using WCF with WF up to the MSDN. The article walks the reader through how to connect your workflows up to web services – in this case, he’s WCF within the workflow to talk to either another WCF service endpoint, or an existing ASMX web service endpoint.
WF/WCF Articles in Vista Section
In addition to the new content, we looked into moving WF and WCF articles out of the Windows Vista and General .NET Programming branches of MSDN Library into the WF and WCF branches. We had been asked why some of these gems were scattered among the MSDN Library nodes, and the answer has to do with the long story of WinFX, and it’s timing with the Vista launch. Unfortunately, we are unable to move the articles. The details of why are messy and get quite technical, but it’s beyond our reach at the moment.
To help the articles with being found, we’ll to create a ‘library list’ of sorts to help aide in discovery of articles, videos, and code samples. The new pages will be launched in August – either as subpage here or on the Dev Centers. There’s a general question of what to do with the outdated content (some of the really top-notch articles that detail WinFX beta releases), and suggestions/comments are welcome. For the moment, we’ve been placing articles into the WF Articles and Overviews section.
Edit – Jul-28-2008 – 6.19pm PDT – Added a link to Jon’s article.
Video Clip on Convergence – SaaS, SOA, Virtualization, Modeling
As I have written previously, convergence is a major theme in distributed computing. Darryl Taft (eWeek) recently wrote an article on the topic which was followed up by an article by Loraine Lawson (IT Business Edge). At Tech Ed, I did a quick video to talk about convergence and what it will mean for distributed computing and the role Modeling will play moving forward. Here’s a snip from my previous posting, if it’s interesting, check out the video.
Looking into the future, we see a perfect storm of productivity and application richness brewing. Specifically, SOA, SaaS, Application Virtualization and Modeling will collide and spark a wave of application creation that we haven’t seen since Al Gore invented the Internet. Let me paint you a picture – developers will compose business critical applications from services they didn’t author, run them in datacenters they don’t own, manage them at a policy level, and pay for them by the drink.
Blogs and Sites To Keep on Your Radar
We recently started the Connected .NET blog, where we’ll focus on the Windows Workflow Foundation (WF) and Windows Communication Foundation (WCF) pillars of the .NET Framework. You definitely want to follow this blog which targets to make content more discoverable and will be frequently updated by members of our product team with interesting news and tips. Two other great resources are our MSDN sites for WF and WCF which we recently relaunched. These portal-like sites will be frequently updated with fresh content based on your feedback.
Another great blog to keep in mind is from our colleague Keith Pijanowski who frequently blogs on SOA related issues and recently started a series on WF.
Regards,
Marjan Kalantar
InfoPath Rules Grouping Behavior (And New BizTalk Posters)
A buddy at work is designing an InfoPath form and was befuddled by some awkward behavior in the way InfoPath executes its rule conditions.
So let’s say that you want to execute the following comparison: “If the sum of the order is greater than $500, and, the customer is from either CA or FL, then set […]