Category: .NET

  • Attended Microsoft Cloud Computing Briefing

    Yesterday I was hanging out at the Microsoft office in Los Angeles for an “Architecture Council” meeting on the new Cloud Computing platform.  You can find the slide materials on the Strategic Architecture Council blog.

    Overall, a worthwhile session that you should attend if you get the chance in your city.  My favorite local evangelists were there, including presentations from Woody Pewitt, Kevin Boyle and the delightful David Chou

    We discussed what Microsoft considers cloud computing, the trade-offs between “on-premises” and cloud apps (e.g. on-premises apps have more control, customizations vs. cloud apps that are cheaper but sacrifice control and customization).  Also liked the point that we shouldn’t see cloud apps as simply current in-house apps that we shove to the cloud (ala people throwing SOAP interfaces on existing APIs and claiming to be “service oriented”).  We should be identifying a new class of apps that exploit the cloud in a safe, efficient manner.

    Woody presented Live Mesh which I’m aware of, but haven’t spent time actually playing with it.  As with many demos for these new MS tools, the focus was a bit more consumer-oriented.  I’m still trying to get my head around any use cases for a tool like this in enterprise software.

    David presented on .NET Services (formerly BizTalk Services) and once again inspired me to install the latest bits and walk through some scenarios.  Damn him for distracting me from other things.  Finally, we covered Azure and the types of web based apps we can now host in the cloud. 

    David discussed a few use cases for cloud services that got me thinking about how I’d use this in enterprise scenarios.  For instance, it makes a lot of sense to me to expose my organizational’s reference data (product list, sites, etc) as cloud-based services that folks can use in their own apps that collect data points about us.  Why should they maintain their own tables with copies of our reference data if we can provide it in a public internet service? By putting this (data+service) in the cloud, I have one less hole to punch in our external facing infrastructure.

    Clearly lots of this stuff will change prior to the formal release, so for me, these technologies fall into the bucket of “have enough knowledge to be dangerous” and no more.  I need to be able to talk about these technologies and hack up small demonstrations, but most importantly, I want to be able to know when I should consider these technologies in future projects for my company

    Technorati Tags: , ,

  • Interview Series: Four Questions With … Jon Flanders

    You’re probably surprised that I’ve kept this up, aren’t you.  Here we are, five interviews into this series and still going strong.  This month, we chat with the one Flanders that Homer Simpson actually appreciates: Jon Flanders.  Jon is a blogger, MVP, thought leader in the SOA space, and is comfortable wearing a skirt. Jon has recently released his book RESTful .NET to critical acclaim and has taken a break from his whirlwind book tour (and the thousands of screaming ladies) to engage in a little Q&A with us.

    Q: Tell us why a developer who has always built SOAP-based web services should care about REST. Why is it worth it to them to learn a different paradigm and what benefit does this paradigm offer to enterprise services that typically are built in a SOAP/RPC fashion?

    A:  What I typically tell people here is two things.

    1) REST has some significant advantages over traditional RPC styles (which most SOAP-based services are). GET results can be cached, REST services are *more* interoperable than SOAP and WS-*, and the statelessness constraint encourages more scalable implementations, and the uniform interface (GET, POST, PUT, DELETE) make building and using services much simpler than custom APIs (which SOAP-based services are because each one is a custom interface). If you use all of the constraints of REST (specifically the hypermedia constraint), you also get a highly decoupled implementation.

    2) Because of these advantages, most of the non-Microsoft parts of the computer industry have moved towards a RESTful approach already, and Microsoft is currently moving that way. When you look at ADO.NET Data Services, Windows Azure, you see a lot of Microsoft’s effort going into building RESTful services. Because of this, even if you aren’t planning on implementing all your services using REST, you probably will be consuming one or more RESTful services in the near future.

    In the end, I don’t advocate moving away from SOAP/WS-* where it makes sense or is necessary (for things like transactional calls between .NET and Java for example), but I think more services than people think could benefit from using a RESTful approach.

    Q: Outside of the plethora of WCF related things you inevitably learned during the writing of your latest book, what more general “service design” concepts/principles/pitfalls have you picked up as a result of authoring this book?

    A: Nothing really new. The concept/principle I believe in most is Keep it Simple Stupid (KISS).

    Q: In addition to being an author, blogger, instructor, and part-time samurai, you also do consulting work. Tell us about the most complicated BizTalk Server project you ever worked on and how you solved the business problem.

    A:  Honestly, I’ve never been involved in a “real” BizTalk Server project (what do they say “those who can’t teach” ;-)). I have built a number of fairly complex demos for Microsoft using BizTalk, probably the most complicated demo involved using BizTalk Server with BizTalk Services (now .NET Services).

    Q [stupid question]: You regularly make the rounds in the conference circuit and naturally meet folks who only know you by your online presence. What’s the oddest thing someone has remarked to you upon meeting you in person for the first time? For me, on multiple occasions, I got a “oh, I thought you were taller.” Apparently I have the writing style of a 7 footer.

    A:  Where’s the kilt?

    Hope you all are enjoying this series, and if you have interest in being added to my “interview queue”, do let me know.

    Technorati Tags: , ,

  • Application Architecture "Pocket Guides" From Microsoft

    Was trolling CodePlex today and noticed that those Patterns and Practices cats just released a neat little set of short architecture guides that cover a few specific architectural areas including the Agile architecture method, web application architecturemobile architecture, rich Internet application (RIA) architecturerich client architecture, and finally, service architecture.

    The service guide is a fairly useful little document that spells out a few important things.  It covers different considerations for SOA services, data services and workflow services.  I like the sections which cover items such as considerations for each design area (e.g. exception management, message endpoints, authentication, etc), as well as the considerations for each service layer.  There are brief descriptions of common patterns, and a handy checklist for evaluating your service architecture. 

    Overall, a pleasant read.  May not be breaking new ground for some of you, but if anything, this set of guides should encourage you to read about a particular architecture topic you aren’t that familiar with.

    Technorati Tags:

  • I, For One, Welcome our New Cloud Overlords

    I’m trying really hard to not pay attention to PDC today, but, damn them and their interesting announcements!  The “Cloud OS” turned out to be Azure.  Good stuff there.  “BizTalk Services” are dead, long live .NET Services.    Neat that you have both Java and Ruby SDKs for .NET Services.

    Also, we got a full release of the Microsoft Federation Gateway (whitepaper here) and a preview of the Microsoft Service Connector (announcement here).  For companies tackling B2B scenarios with a myriad of partners, these technologies may offer a simplified route.

    Ok, back to real work.  Stop distracting me with your sexy cloud products.

    Technorati Tags: ,

  • Impact of Database Availability on BizTalk Web Services

    My buddy Victor asked me the other day about the relationship between IIS and the BizTalk databases.  That is, if we restart the SQL Server service or server, what happens to messages that are still submitted to the BizTalk web services on an active IIS server?

    So, I put together a really quick application where I tested four scenarios: downstream host unavailable, IIS unavailable, receive location offline, and SQL Server unavailable.

    Also, to legitimately gauge service behavior, I exposed both classic ASMX services and WCF services for my BizTalk application.  Both services were built as one-way HTTP services hosted in IIS.  The published data is then routed to a single FILE send port via message-type routing.


    Scenario: Processing Host is Unavailable

    For this scenario, I simply disabled the in-process host that runs the send port subscribing to messages published by the services.

    Result: Messages are published with no problem, and everything is queued up until the in-process host comes online.  No message loss and no errors to the service callers.


    Scenario: IIS is Unavailable

    Here I turned off the IIS website hosting the services.

    Result: As expected, both the ASMX and WCF services returned errors to the client application.  The ASMX service returned an error saying:

    error: System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80

    The WCF service returned the following error:

    error: System.ServiceModel.EndpointNotFoundException: Could not connect to http://myserver/Blog.Biztalk.AvailabilityTestWCF/ContractService.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 192.168.131.65:80.  —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.131.65:80

    So the client gets an error, no message is submitted to BizTalk by either service, and the client will be expected to try again later.


    Scenario: Receive Location is Offline

    Now I’ve turned off the actual receive locations.  The website is up and running, but the BizTalk receive locations aren’t listening for the inbound messages.

    Result:  The ASMX service returns a success message (HTTP 202), even though no message is published to BizTalk.  There is an error in the System Event log stating:

    The Messaging Engine could not find the receive location for URI:”/Blog.Biztalk.AvailabilityTest/ContractService.asmx”.\
    Please verify the receive location exists and is enabled.

    However, the client does NOT get an error even though no message was published (or suspended) by BizTalk.

    The WCF service returns an HTTP error and the following message to the client:

    error: System.ServiceModel.ServiceActivationException: The requested service, ‘http://myserver/Blog.Biztalk.AvailabilityTestWCF/ContractService.svc’ could not be activated. See the server’s diagnostic trace logs for more information.

    In this case again, no message is published, BUT, at least the client knows that a problem occurred.  Much better than the ASMX behavior.


    Scenario: SQL Server is Offline

    In this case, I’ve shut down the SQL Server service and the in-process hosts that are running.

    Result: The ASMX service continued to return HTTP success messages, even though it could not publish to the MessageBox.  The IsolatedHost (which runs the Message Agent) can’t connect, but the client isn’t told this.

    The WCF service, however, returns the same error it did on the previous scenario.  So it did not publish the message either, but, again, it returned a proper exception to the client.

    Looking at the IIS logs, I wanted to confirm the service response.  For the ASMX service call when the database was offline, I can see the following entry:

    POST /Blog.Biztalk.AvailabilityTest/ContractService.asmx – 80 – 127.0.0.1 202 0 0

    Notice the HTTP 202 returned to the client.  The next entry in the log file represents my call to the WCF service while the database was still down:

    POST /Blog.Biztalk.AvailabilityTestWCF/ContractService.svc – 80 – 192.168.131.65 – 500 0 0

    Notice the HTTP 500 error which represents an internal server error returned to the caller.


    Summary

    So, we can conclude that ASMX services do a lousy job of reporting what actually happens after it tries to publish messages to the BizTalk bus.  Unless the IIS server is explicitly taken down during database server maintenance or restarts, you run the real risk of losing messages without the client being aware of it.  For WCF services, we see much better handling of message publishing problems.   This is probably due to the fact that the BizTalk WCF service host relies heavily on the BizTalk configuration database and receive location availability to complete its operations.  While it still can’t save the inbound requests, it at least tells the caller that something went wrong.

    Anyone else have different experiences than the ones I demonstrated above?

    Technorati Tags: , BizTalk

  • Microsoft "Zermatt" Developer Identity Framework

    The concept of “Identity Management” is not my strongest suit, so I’ve been spending more time this year reading up on the topic and trying to gain additional perspective.  Noticed yesterday on Vittorio’s blog that he announced the beta release of a new Identity Framework code named “Zermatt” targeted towards developers.   Ignoring the fact that the code name sounds like either a robot villain or a rejected Muppet, this is actually a pretty interesting release.  It’s basically a set of .NET framework objects that you use to implement claims-based identity models in your applications, thus avoiding tight coupling to custom user stores or particular directories.

    Check out the great whitepaper for more information and examples of how it works.  I’ve read it once, but need to re-read it about 6 more times.

    Technorati Tags:

  • New WCF Management Pack for SOA Software

    I was on a conference call with those characters from SOA Software and they were demonstrating their BizTalk Management Pack.  They also spent a lot of time covering their in-development WCF binding.

    Moving forward, SOA Software is releasing Microsoft-friendly agents for …

    • IIS 6.0 (SOAP/HTTP)
    • WCF (any transport)
    • BizTalk (any transport)
    • BizTalk-WCF (any transport)

    All of these (except the BizTalk agent) support policy enforcement.  That is, the BizTalk agent only does message recording and monitoring whereas the other agents support the full suite of SOA Software policies (e.g. security, XSLT, etc).

    So what is the difference between the BizTalk agent, and the BizTalk-WCF agent?  The relationship can be represented as such:

    The BizTalk-only agent is really a pipeline component which captures things from inside the BizTalk bus.  This means that it will work with ANY inbound our outbound adapter.  Nice.  The SOA Software WCF binding is at the WCF adapter layer, and allows for full policy enforcement at the adapter layer.  However, this is ONLY for the BizTalk WCF adapters, not the other adapters.

    So if I had a WCF endpoint that I wanted to play with SOA Software, I could first attach the out-of-the-box SOA Software pipelines to the receive location.

    Next, in the WCF-CustomIsolated adapter configuration, I can specify the new soaBinding type.

    I don’t HAVE to do the pipeline AND the WCF binding if I have a WCF endpoint, but, if I want to capture the data from multiple perspectives, I can.  For that binding, there are a few properties that matter.  Mostly importantly, note that I do NOT have to specify which policy to apply.  The appropriate policy details are recovered at runtime, so making changes to the policy requires no changes to this configuration.

    From within the SOA Software management interface, I can review my BizTalk endpoints (interpreted as operations on a WSDL that represents the BizTalk “application”).

    Notice that this is a managed BizTalk receive location.   If I sent something through this managed receive location (with a policy set to record and monitor the traffic) I could see a real-time chart of activity, and, see the message payload.

    Notice that I see all the context values, AND, the payload in a CDATA block.  This supports BizTalk flat file scenarios.

    As for the WCF binding, you would install the SOA WCF binding on the client machine, and it becomes available to developers who want to call the SOA-managed WCF service.  The binding looks up the policy details at runtime, again shielding the developer from too much hard coding of information.

    So what’s cool here?  I like that the BizTalk agent works for ALL BizTalk adapters.  You can create a Service Level Agreement (SLA) policy where more than 10 faults to an Oracle adapter send port results in an email to a system owner.  Or if traffic to a particular FILE receive location goes above a certain level (per day), then raise an issue.  From the WCF side, it’s very nice that all WCF transports are supported for service management and that service policy information is dynamically identified at runtime versus embedded in configuration details.

    If you’re a BizTalk shop, and you have yet to go nuts with SOAP and services, you can still get some serious value from using the BizTalk agent from SOA Software.  If you’ve fully embraced services, and are already on the WCF bandwagon, the upcoming WCF binding from SOA Software provides a vital way to apply service lifecycle and management to your environment.

    Technorati Tags: , , WCF

  • All Source Code Posted for BizTalk + WCF Articles

    I just finished zipping up all the source code for my recent set of articles over at TopXML.com.  Specifically, I just added the source code for the set of articles on publishing WCF services out of BizTalk (with security, transactions, attachments) and the source code for all the BizTalk Adapter Pack demonstrations that utilized the Oracle adapter.  I make no promises that the code is attractive, contains best practices, or avoids the use of obscenities in the comments.

     

    Series Summary
     BizTalk and WCF: Part I, Operation Patterns Get the source code!
     BizTalk and WCF: Part II, Security Patterns
     BizTalk and WCF: Part III, Transaction Patterns
     BizTalk and WCF: Part IV, Attachment Patterns
     BizTalk and WCF: Part V, Publishing Operations Patterns Get the source code!
    BizTalk and WCF: Part VI, Publishing Advanced Service Patterns
    BizTalk and WCF: Part VII, About the BizTalk Adapter Pack Get the source code!
    BizTalk and WCF: Part VIII, BizTalk Adapter Pack Service Model Patterns
    BizTalk and WCF: Part IX, BizTalk Adapter Pack BizTalk Patterns

     

    Technorati Tags: ,

  • Flowing Transactions To Oracle Using Adapter Pack

    So the documentation that comes with the BizTalk Adapter Pack makes scant reference to flowing transactions to the adapters.  That is, if I want to call the “Insert” operation on an “Orders” table, but only commit that if the “Insert” operation on the “Order Items” table succeeds, how do I wrap those operations in a single transaction?

    WCF has great transaction support, and the BizTalk Adapter Pack is built on WCF, but the product documentation for the Oracle adapter states:

    The Oracle Database adapter does not support performing transactions on the Oracle database using System.Transaction. The adapter supports transactions using OracleTransaction.

    Limitations of BizTalk Adapter 3.0 for Oracle Database

    Hmmm.  That’s pretty much the only time transactions are mentioned at all.  That makes it sound like I cannot wrap my service calls in a System.Transaction and have to use the OracleTransaction object from the ODP.NET bits.  What better way to confirm this than by actually testing it?

    I’m using the example from my TopXML.com articles.  So in that article, I mention inserting into two tables sequentially via proxy classes.  So, what happens if I take that same block of “insert” code and purposely create an error in the second set of data (e.g. use a non-existent “OrderID”)?  An exception occurred during the second operation, but the first insert command succeeded …

    Notice that my “Orders” table has a record in it, but the “OrderItems” table has no corresponding items for OrderID #34.  So, I’m stuck in an inconsistent state.  Not good.

    On a whim, I decided to wrap the entire block of “insert” code inside a System.Transaction.TransactionScope block to see what would happen.  On the first execution, I got an error saying “Unable to Load OraMTS“.  Interesting.  Looked like the System.Transaction in my code is converted to an Oracle transaction by the adapter and the OraMTS object (from the Oracle client) wasn’t found.  So, I went back to my Oracle client installation and made sure to install the Oracle Services for Microsoft Transaction Server.

    Now, if I executed my code again, with the same error in the 2nd set of insert commands, the database remained in a consistent state, and the first insert did not commit.  So you CAN wrap these service invocations inside a System.Transacton object (at least for the Oracle adapter) to daisy-chain atomic operations.

    Overall, the documentation for the BizTalk Adapter Pack is top notch, but the complete absence of transaction instructions seems curious.

    Technorati Tags: ,

  • Material from San Diego .NET User Group Presentation

    Earlier this week, I grabbed a couple new CDs, hopped in the car, and drove down to San Diego to present at the .NET User Group’s Connected Systems meeting.  The topic was the BizTalk Adapter Pack and I outlined what the BAP is, what the core use cases are, and demonstrated how to build a solution using it.

    My presentation is here.  I called out a few resources for folks looking to learn about the BizTalk Adapter Pack.  They include:

    I’ve been accepted into the Microsoft TAP for the Adapter Pack Office Developers Program, so hopefully I’ll be able to demonstrate how to use the BAP within Office applications.

    Technorati Tags: ,