来自:Andrew Connell [MVP SharePoint] | 时间:2012-07-18 19:26:30
In previous posts I've talked about what's new with workflow in SharePoint 2013 as well as the very cool new DynamicValue data type which comes in supremely helpful when working with Odata services or anything service that speaks JSON. With this new architecture you'll see there's a lot of chatter between SharePoint & the Windows Azure Workflow (WAW) farm over the wire. In addition, now that our workflows can not only call web services but also we're advised to stop putting custom code in the workflow but rather stuff it in services and call these services with the new HTTP activities, there's even more over-the-wire communication going on.
Wouldn't it be nice to debug this or watch all this go on? Well you can thanks to Fiddler . The trick is you just need to know how to intercept the calls from SharePoint & WAW so you can see everything in the Fiddler trace. There are just a few steps to do:
Open the two machine.config files for the framework and add the following to the bottom of each, just before the closing </configuration>. Oh... Please back them up first so you can't go all "oh AC broke my dev box" on me…
<system.net>
<defaultProxy enabled="true">
<proxy bypassonlocal="false" usesystemdefault="true" />
</defaultProxy>
</system.net>
Now configure Fiddler to intercept the traffic coming from SharePoint and WAW. If you are using a HOSTS file for your DNS stuff… err cheating… make sure you import that:
Next up, setup the connections in the options dialog:
Fiddler not only is a HTTP debugging proxy used to see what's going on, but it is also going to forward the calls along to the intended target. There's one catch here from using Fiddler in normal debugging practices. Because SharePoint & WAW talk to each other over SSL, you have to tell them to trust Fiddlers cert which is used to re-encrypt the traffic after debugging it. In order to let SharePoint & WAW continue to work while debugging, you need to install the Fiddler certificate as a trusted root on the box.
First, tell Fiddler to decrypt the traffic and export it's certificate:
Last step is to install the certificate you just exported to the desktop. Launch theSharePoint Management PowerShell Console as an administrator and type the following:
Now you're all configured… the last thing is to actually check it out. The most important thing here is to start things up as the right user and in the right order.
That's it! Now you can login to your dev machine as your developer account and test a workflow. You should be catching the traffic and watch all the client side object model (CSOM) chatter going on from WAW > SharePoint and SharePoint calling WAW… pretty neat stuff!