Blog Home  Sign In RSS 2.0 Atom 1.0 CDF  

  def Softwaremaker() :
         return "William Tay", "<Challenging Conventions />"

  knownType_Serialize, about = Softwaremaker()
 

 Thursday, November 15, 2007

With the impending release of the Microsoft BizTalk Server Adapter Pack (Beta 2 available here), there are some confusions as to the differences between the BizTalk Adapter Pack, Microsoft's WCF Line of Business (LOB) Adapter SDK, and of course, the (older) BizTalk Adapter Framework.

In a nutshell, the BizTalk Adapter Pack is written and developed on top of the WCF LOB Adapter SDK (which is free and freely downloadable). The value-add is that the LOBs that it can integrate with ootb are SAP (mySAP Business Suite), ORACLE (Oracle Database) and SIEBEL (Siebel eBusiness Applications). Of course, a lot of grunt work is taken away from you, as explained here.

One of the confusing part is the play of the words "BizTalk" in the product name. As I have explained above, built on the WCF LOB Adapter SDK, these adapters are host agnostic i.e. they are not tied to a specific product like BizTalk. You can use it with BizTalk 2006 R2 specifically (The WCF LOB adapters cannot be used in BizTalk Server versions prior to BizTalk Server 2006 R2) but you can use it outside of BizTalk as well (some configuration work required, such as the Add Adapter Reference plug-in, etc) but this also means you do not have to buy BizTalk for it, if you dont have to.

This SDK is based on Windows Communication Foundation (WCF, previously - Indigo), and it surfaces an adapter to an LOB system as a WCF binding. For an adapter consumer, the adapter can be accessed like a typical WCF service; the consumer does not have to learn a new programming model. The same adapter developed can be reused in multiple .NET applications including custom .NET applications, Microsoft® BizTalk® Server 2006 R2, Microsoft Office SharePoint® Server 2007 SP1, and Microsoft SQL Server™ Integration Services (SSIS) through adapter development provided. In addition, the adapter provides metadata browse, search, and retrieval functionality for the adapter consumer to selectively generate WCF contracts that reflect live type modeling of the LOB system.

Confusions from customers and partners alike usually stem from the the primary differences between WCF LOB Adapter SDK and the BizTalk Adapter Framework. I will hereby summarized it in the following table:

Feature WCF LOB Adapter SDK BizTalk Server Adapter Framework

API

.NET 3.0 Assembly, provides help classes for metadata processing, connection management, and messaging

COM, provides basic support for adapter operations.

Adapter exposure

  • Exposed as WCF binding; available to any application that can consume a WCF binding including BizTalk Server 2006 R2 (using the WCF adapter)

  • Exposed only to BizTalk Server; not reusable by other applications.

Tools

Adapter Code Generation Wizard, metadata browser for Visual Studio 2005

n/a

Extensibility

Yes (as WCF channel extension)

No

If you are knee-deep into writing, shipping and selling adapters for BizTalk, I strongly urge you to visit the Adapters' Team Blog here.

Thursday, November 15, 2007 2:04:07 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, October 13, 2007

    I know I havent been posting deep technical stuff that I used to do. Contrary to what people think my current role entails, keeping abreast of the technology landscape is what I am supposed to do and what I enjoy and so when colleagues joked with me when was the last time I booted up Visual Studio, for example, I enjoyed seeing their shocked faces when I told them: "oh - just last night. why you asked ?" .

    I dont dwell deep like I used to but I still code up decent projects which I implement within my own developmental testing environment (yes, I have one running latest versions of Active Directory, SharePoint, Exchange and all the other goodies), driving the houshold crazy when I think of new and different ways to document expenses, publish a Book or CD library, home automation projects using all sorts of different technologies (yes, that includes Ruby-on-Rails) or in my new Windows Mobile 6 Device. Of course, I admit I dont post topics deep like I used to. It is not so much the content but more so, the limiting factor of time.

    Recently, I was involved in some internal technical discussions with regards to the issue of scale comparisions between Windows Communication Foundation (WCF, previously - Indigo) and ASMX. Below are some discussions:

    If you have a web service that is going to be IO bound, you would definitely want it to be scalable and almost every resource in the world tells you to implement ASP.NET asynchronous pattern (BeginSomething/EndSomething, etc) on it so to go easy on the thread pool. ASP.NET uses an IAsyncHttpHandler to handle the request, which means the worker threads are not blocked while the IO-bound operation executes somewhere else. Sounds good so far.

    If you make a WCF version of it with webHttpBinding (which actually means you can invoked it AJAX-style) following the same async pattern for the methods, you may find that each invocation of the WCF service eats up two threads – one for its ASP.NET HttpModule.ProcessRequest and the other for the actual IO. Ouch! You may think that this means your WCF implementation may end up eating all threads reserved for ASP.NET, which would indeed scale down the server

    Is this true OR are we missing the complete picture ?

    While the scenarios explained above are reasonable observations, it doesnt paint the complete picture. WCF does perform better scalability than ASMX.

    • Threading:
      For ASMX, when a request comes in, it would be queued up immediately for async ASMX. So the thread is released for that request and a new thread will pick up the work item later.

    For WCF, when a request comes in, we queue it up in WCF and let an IO thread handle the request. At the same time, the request thread-pool thread is held to wait for the request to complete.

    Yes, WCF uses more threads than async ASMX. But there is a reason for this. Using asynchronous ASMX is dangerous and not really a good practice (and I have hinted at this many times in the many Web Service/ASMX presentations I have done over the past few years). While it does well at what it is supposed to do, it does trick the developer into a "false sense of security". Essentially, if you dont know how the ASP.NET blackbox works, you may find yourself thrown against the car wall when you take a hidden, unsuspecting corner at high speeds. It does not provide enough throttling for client loads. Basically the server takes all items and queue them up for later processing. The server does not have a good throttling mechanism to control the number of work items. To everyone else, it seems that the server is quite friendly to all clients. However, if the number of clients is unbounded, this is really bad. First of all, the server working set would grow unlimited due to unlimited requests queued up. Secondly, many client requests would become obsolete when it’s picked up by the server from the queue. The latter accounts for a a good set of problematic scenarios I have come across in my past consulting gigs with regards to high-load and high-transactional ASMX asynchronous implementations before I joined the borg.

    Think of it as a side of the brain (that tells you that you are about to be full) not functioning properly when you sit down at a buffet table. You eat and eat and eat without knowning when to stop and then your ingestion/digestion system starts kicking in, you actually hit the wall. Hard. Literally.

    • Server Throughput
      When you measure scalability, the most important measurement is the server throughput. That is, how many requests the server can handle per time unit? For async ASMX, it would be pretty fast at the initial phase. However, like the ingestion/digestion analogy I was referring to above - Once the server is in a steady phase (as when CPU is fully loaded), the throughput will go down because the server capacity has reached. You can compare the data between async ASMX and sync ASMX over the long run to see what I mean.

    Also you would see higher memory usage of the async approach.

    • ASP.NET Throttling
      That said, ASP.NET does have a throttling mechanism that is used for sync ASMX, which is the threadpool thread limit. The number of threads used to handle requests are bounded (http://support.microsoft.com/kb/821268). WCF uses this fact to throttle incoming requests. You can always change the configuration settings to increase number of threads to be used to allow more work items to be queued up.

    The max number of threads follows the following formula:
    MaxWorkerThreads x #CPU – MinFreeThreads
    This is 12 by default on a single-proc machine.

    • Two-level Throttling for WCF
      WCF leverages the ASP.NET threadpool throttling to throttle client requests. At the same time, WCF has its own item queue throttling. The former is throttled by the setting mentioned in the immediate above point, while the latter is controlled by WCF throttling settings (maxConcurrentCalls etc). ASP.NET can automatically adjust threads based on CPU loads so that you would always get full load of the server.

    In this way, you may experience client failures because the requests are rejected at ASP.NET layer beforehand. So you can increase the ASP.NET throttling to get better experience. But eventually you would still be bounded by the physical server capacity, no matter whether you use async ASMX, sync ASMX, or WCF as mentioned above.

    There is improvement work done in .NET 3.0 SP1 and of course, .NET 3.5 (beta 2 here), with the use of prioritized item queues. Do expect even-better WCF performance even in some of the common scenarios. Fine tuning minWorkerThreads will even give us even better results.

    Thanks to Wenlong for helping out with the guidance and explanation. The complete scenario and the design principles for it will be published in greater detail in a MSDN whitepaper later. Do watch out for it.

    Friday, October 12, 2007 10:40:28 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, August 25, 2007

    It was not so long ago when I made my intentions known that the .svc extension in Windows Communication Foundation (WCF, previously - Indigo) is really a clutz. It is obstrusive and really unnatural, especially when it comes to RESTful Web Services.

    In a closed door meeting with the product group folks back in 2005, before WCF rolled out and way before I joined the borg, I was told that this is a issue not with WCF itself, but by its web host - Microsoft Internet Information Server (IIS)

    There are some attempts to hack around it but one of the best I have seen is to do URL Re-Writing: Off Jon Flanders here. You can see from the bottom of his post via Christian Weyer that this still will not work with IIS6 (damned legacies) but this will give you a good excuse to move to a Better, Leaner and Meaner IIS7, which is a complete rewrite of its predecessor. About time, I say.

    Saturday, August 25, 2007 6:06:02 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Tuesday, August 21, 2007

    Following up on this, here are some more aggregated shareable details with regards to the Compact Framework 3.5:

    Feature

    Desktop WCF

    Compact WCF

    Bindings:

     

     

    ·         BasicHttpBinding

    Yes

    Yes

    ·         CustomBinding

    Yes

    Yes

    ·         WindowsMobileMailBinding

    N/A

    Yes

    ·         ExchangeWebServiceMailBinding

    Yes, via NetCF install

    Yes

    Formatters:

     

     

    ·         SoapFormatter

    Yes

    Yes

    ·         BinaryFormatter

    Yes

    No

    Encoders:

     

     

    ·         TextMessageEncoder

    Yes

    Yes

    ·         BinaryMessageEncodingBindingElement

    Yes

    No

    ·         MTOMEncoder

    Yes

    No

    ·         GzipEncoder

    No

    Sample available

    Transports:

     

     

    ·         HttpTransportBindingElement

    Yes

    Yes

    ·         HttpsTransportBindingElement

    Yes

    Yes

    ·         MailTransportBindingElement

    Yes, via NetCF install

    Yes

    ·         MsmqTransportBindingElement

    Yes

    No

    ·         TcpTransportBindingElement

    Yes

    No

    ·          

     

     

    XmlDictionaryReader/Writer

    Yes

    Yes; stub around XmlTextReader/Writer

    DataContractSerializer

    Yes

    No; but can be wire-compatible with DCS via XmlSerializer

    Service proxy generation

    Yes; via SvcUtil.exe

    Yes; via NetCFSvcUtil.exe, not integrated into VS2008

    ·         Non-HTTP transports

    Yes

    No

    ·         Custom headers

    Yes

    No

    WS-Addressing

    Yes

    Yes

    WS-Security message level security

     

     

    ·         X.509

    Yes

    Yes

    ·         Username/password

    Yes

    No

    WS-ReliableMessaging

    Yes

    No

    Patterns

     

     

    ·         Service model

    Yes

    No

    ·         Message layer programming

    Yes

    Yes

    o   Buffered messages

    Yes

    Yes

    o   Streaming messages

    Yes

    No

    ·         Endpoint descriptions in .config files

    Yes

    No

    Extensibility

    Yes

    Yes

    Tuesday, August 21, 2007 12:53:20 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, April 06, 2007

    While I was still an Microsoft MVP and a Microsoft Regional Director, one of the things I have always requested is to have Windows Communication Foundation (WCF, previously - Indigo) run in the Compact Framework to enable ease of use of WS-Security Specifications in distributed (W3C) SOAP communications.

    I mean, really - even Web Services Enhancements (WSE) did not work at the Compact Framework level. One of my friends and a really technically-brillant guy, Casey Chesnut cooked something up to enable us to use secured communications on the compact framework (which I used).

    Now, I guess the CF in WCF means it can work in the Compact Framework now, finally. This is a good read to show whats coming up. For more, you would have to attend MEDC 2007 in Vegas later this month.

    Thursday, April 05, 2007 11:45:20 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, February 19, 2007

    This is a continuation of my previous post: WS-ReliableMessaging Simplified - WHY

    While this blog sits in my draft folder while I am busy solving and fire-fighting other real-world problems, I just found out that my fellow distributed and connected systems enthusiast, Matevz has penned down the WHATs and HOWs of WS-ReliableMessaging faster than me, AND with even greater details !!!

    So, instead of replicating that effort, it would be better for me to do a high level post about the HOWs of WS-ReliableMessaing. The below diagram of WS-ReliableMessaging explains the sequencing really well.

    WS-ReliableMessaging - HOW

     

    Let me explain the concepts of WS-ReliableMessaging in terms of a conversation between Alice and Bob:

    Alice: Let me call Bob on his mobile telephone.(CreateSequence)
    (Ring Ring ... Bob Picks up the phone)
    Bob: Hello ? (CreateSequenceResponse)
    Alice: Hi Bob, this is Alice(CreateSequenceResponse)
    Bob: Hi Alice (CreateSequenceResponse, Identifier)
    Alice: I would like to have a meeting with you tomorrow at 1000 hours (MessageNumber=1)
    Bob:
    Cool. Roger. I got that. Sure, let meet tomorrow at 1000 hours.
    Alice: Can we meet at my office in North Ryde ? (MessageNumber=2)
    (Bob walks into a GSM blind spot ...)

    Alice: Oh yeah, and Bob, please bring those M&A files for clearance for our senior VP (MessageNumber=3)
    Alice: Hello Bob, did you get that ? Please repeat. (AckRequested)
    Bob: Yes, I got that you are saying that we should meet up at 1000 hours at your office. Period (SequenceAcknowledgement)
    Alice:
    No, you are not getting the full picture. You need to bring those M&A files for clearance for our senior VP (Resend MessageNumber=3). Kindly repeat what I just said (AckRequested)
    Bob: Yeah. Got it. We should meet up at 1000 hours at your office and I will bring those M&A files for clearance for our senior VP. (SequenceAcknowledgement)
    Alice:
    Bingo. Good. Please make a reservation for 1200 hours for lunch at "Steaks by the Bay" as well. (MessageNumber=4)
    (Bob's phone went dead ...)
    Alice: Hello ? Bob, did you get that ? (AckRequested)
    Alice:
    Hello ? Bob, did you get that ? (AckRequested)
    Alice: Hello ? Bob, did you get that ? (AckRequested)
    Alice: Hmmm. Something is wrong. Let me call Bob again. (AcknowledgementInterval is up)
    (Ring Ring ... Bob Picks up the phone)
    Alice: Hi Bob, this is Alice. Sorry, I think I got cut-off from the earlier call. (CreateSequence)
    Bob: Hi Alice. Sorry, yeah, my fault. I pressed the wrong button (CreateSequenceResponse with prev Identifier establised)
    Alice:
    I was wondering if you can make a reservation for 1200 hours for lunch at "Steaks by the Bay" after that 1000 meeting tomorrow. (MessageNumber=1) Please acknowledge. (AckRequested)
    Bob: Sure, of course. I will make a reservation for 1200 hours for lunch at "Steaks by the Bay" (SequenceAcknowledgement)
    Alice: Alright then. Lets end this phone call. See you tomorrow. Thanks and Bye. (TerminateSequence of this Identifier)
    Bob: See you tomorrow, Alice. (TerminateSequenceResponse)

    Of course, the above is a simplistic view and there is a lot more to WS-ReliableMessaging than what I have just illustrated above with buffers, inactivitytimeouts due to infrastructure faults, in-order deliveries, maxRetryCount, maxTransferWindowSize, etc. But you get the jizz of this picture of why InOrder, idempotent-aware ReliableMessaging is needed in complex real-world enterprise-scale distributed communications.

    If you want to know the WHATS and all in better detail, do visit Matevz's post here and a continuation here.

    Monday, February 19, 2007 2:57:18 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Thursday, February 15, 2007

    These are just some of the tabs that can be found if you expose a Microsoft BizTalk Server 2006 R2 process via a Windows Communication Foundation (WCF, previously - Indigo) Service.

    BTS06R2Binding.JPG
    BTS06R2Security.JPG
    BTS06R2Message.JPG

    The interesting part of the Messaging Tab of BizTalk 2006 R2 is that you are able to dictate the source of the inbound message body that you would like BizTalk to handle.

    You can specify it to be the entire <soap:Envelope> or just the <soap:Body>, which essentially strips out the <soap:Header> element from the entire envelope. The flexibility comes in when you can dictate and customize the message content via an XPath expression that you would like BizTalk to process such as: /bookstore/book[0] ...

    Thursday, February 15, 2007 7:34:21 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Sunday, January 28, 2007

    It is amazing to note the reach to the masses of a single MSDN Webcast. I had conducted a MSDN Webcast titled: "Acks and NAcks: Why We Need the Principles of TCP/IP Reliability in SOAP" in mid-2006 and till this day, I am still receiving questions and feedback about that topic I presented in the webcast. (Incidentally, you can view the on-demand webcast here.)

    For those of you who do not want to go through this webcast again, I am going to break that presentation into the WHYs, WHATs and HOWs on this blog. This will make for easy-reading and straight-to-the-point as well.

    WHY ?

    This is rather straightforward. Why is it important? Why does it matter whether messages can be sent and received reliably? Web services is based on XML messages being sent and received. The most useful Web services will often be those that are the most complex and that rely on many messages being sent and received in a very specific order. That's the way that complex transactions can be built, after all.

    Let us look at this problem in context before figuring out where the pain-points are. Most complex transactions in enterprises require far more messages to be sent and received. The messages will be much more intricate and may have very complex dependencies on one another, so that certain processes can't be kicked off until certain previous messages have been sent and acknowledged. Entire complex transactions can fail because a simple message didn't get through. And while it may sound simple to guarantee reliability, it's much more difficult than you might expect.

    To add to the complexity, the main characteristics of Web services is communication over unreliable communication channels such as the Internet employing unreliable data transfer protocols such as HTTP, SMTP and FTP. These are considered unreliable, as they do not offer the reliable messaging services such as guaranteed delivery. Accordingly reliable messaging becomes one of the first problems that need to be addressed for Web services to become truly enterprise-capable technologies.

    openquotes.png...there is nothing in SOAP or even HTTP that guarantees anyone that a message is delivered, or that allows a someone to tell the sender he/she has received the message...closequotes.png

    Making reliable messaging more difficult is that messages are sent not just over the notoriously unreliable Internet, but also between partners that use entirely different networking infrastructures.

    What many companies did in the past was to rely on proprietary messaging infrastructures to connect applications with one another. In these days of "open-standards", the industry would much prefer what Web services promises -- a messaging paradigm NOT based on any proprietary implementations."

    To put it simply - If that reliability can't be guaranteed, Web services simply won't be used in the enterprise. The benefits of Web Services cannot be realized if it is not being used for complex scenarios in the enterprise.

    Let us look at some of the inherent problems in which cross-boundaries communication happen today, especially over the cloud:

    1. Re-ordering of Messages in Multi-Path Routing Scenario

      This is one problem that not many people realize because not many people would know the entire infrastructure physical topology of a end-to-end communication network channel. If you have 2 or more intermediaries that act as routers over a load-balanced network for example, messages being sent out may be routed differently over the network. In other words - The first Message ONE may be routed via Router 2 while the second Message TWO routed over Router 1. The complexity arises when the routers have their own routing table and paths and due to congestion of Router 2 over Router 1, the second Message TWO may arrive first, faster than Message ONE, at the final destination.

    2. Intermediary Reliability

      What is not so self-explanatory is this - What happens if/when the intermediary drops my message ? How do I know if the other party has received it ? If I should send the same message again (just to be sure), how do I know if the serivce is designed to be "idempotent" ? This point has very explicit relations with the Quality-of-Service (QoS) assertions of a service. Each message sent must be received exactly once (once and only once). Failure to deliver a message be made known to both the sender and receiver.

    3. Connection Management

      • “… my connection with the service drops frequently within this Wi-Fi network, but I don’t want to lose messages or the underlying session …”
      • “Bursty Connections - I may go idle for long periods of time and I don’t want to hold transport connections open …”
      • “… my service is using resources for each session and I want to release those resources if the client is not there anymore …”

    4. Need for Transport Independence

      As I have mentioned earlier, different partners have different networking infrastructures and the need to rely on "open-standards" means that there is a need to decouple that reliablity element away from the transport. This ensures that different parties can choose to use whichever transport that suits them best but yet have a common accepted understanding on the reliability protocol that is independent of the chosen mode of transport.

    To sum it up simply, we live in the real world. One that is not so perfect. The one where

    • Servers fail
    • Systems get out of synch
    • Messages get lost
    • Messages get re-ordered
    • Messages cannot be safely re-tried

    and the same one that explains why we need reliable messaging in Web Services.

    NEXT UP: WS-ReliableMessaging Simplified - WHAT and HOW ?

     

    Saturday, January 27, 2007 11:28:19 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, August 07, 2006

    The trouble with being part of the early adopters curve is that most of the time, your time is spend very unproductively trying to figure out, if samples dont work well, the reason why.

    Is it a bad installation? bad configuration? corrupted downloads? or just simply the fact that the product team, while in a rush to get things out, forgot to update or remove the "deprecated" samples ?

    While working very deeply with Microsoft Cardspace for a few months now and I mean doing "real" work for "real" clients, I would be one of the first to keep up to date on the new and upcoming Cardspace technicals.

    While downloading and installing the July CTP SDK Cardspace samples, I found out that both the Cardspace SDK samples could not work at all - out of the box. I installed the CTP and the SDK twice to make sure that I didnt screw up the first time around (that means an hour of unproductive time wasted).

    I was rather shocked when I found out that the Cardspace SDK samples have been deprecated BUT have not been removed by the team in time and my frustrations grew when the new working samples have not been uploaded in time as promised.

    Who can I blame ? - No one forced me to be part of the Early Adopter's curve and no one asked me to download the July CTP SDK and its samples. Afterall, it is supposed to be an eagerly-anticipated drop. That said, the previous samples, in some way or another, have not been working too well at all. Some works perfectly on the local machine but have some troubles going out to the wild, while others like the June CTP, had its own host of problems.

    So, what better way to do this than to roll-up-your sleeves and do-it-yourself ? While doing some reflecting, I found out some of the Cardspace July CTP SDK samples had not had its config and script files updated.

    • The setup scripts had some errors. > set InfoCardServiceName="idsvc". Therefore, it is "net start idsvc". I answered my own post here.
    • For the Simple Infocard sample under Basic\Bindings\WS\Infocard\Simple. Service config should have their behavior element changed as such. The issuedTokenAuthentication element is a key change/update.

        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceCredentials">
              <serviceCredentials>
                <serviceCertificate findValue="Whatever_you_are_using" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
         <issuedTokenAuthentication allowUntrustedRsaIssuers="true"/>
              </serviceCredentials>
              <serviceDebug includeExceptionDetailInFaults="False" />
        <serviceMetadata httpGetEnabled="true" />
      </behavior>
          </serviceBehaviors>
        </behaviors>

          <service name="Microsoft.ServiceModel.Samples.CalculatorService"
        behaviorConfiguration="ServiceCredentials">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="requireInfoCard"
           contract="Microsoft.ServiceModel.Samples.ISecureCalculator" >
              <identity>
                <certificateReference findValue="Whatever_you_are_using" x509FindType="FindBySubjectName"
           storeLocation="LocalMachine"
           storeName="My" />
              </identity>
            </endpoint>
      <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
          </service>

       <bindings>
      <wsHttpBinding>
       <binding name="requireInfoCard">
              <security mode="Message">
                <message clientCredentialType="IssuedToken" establishSecurityContext="true" negotiateServiceCredential="true" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>

    • For the app config. Take note:

      <system.serviceModel>
        <client>
          <endpoint address="http://swmvm2k3/ServiceModelSamples/service.svc/"
                    bindingConfiguration="requireInfoCard"
                    binding="wsHttpBinding"
                    contract="ISecureCalculator"
                    behaviorConfiguration="ClientCredentials">
        <identity>
         <certificateReference
            findValue="Whatever_you_are_using" x509FindType="FindBySubjectName"
            storeLocation="CurrentUser" storeName="TrustedPeople" />
        </identity>
       </endpoint>
        </client>

        <bindings>
          <wsHttpBinding>
            <binding name="requireInfoCard">
              <security mode="Message">
                <message clientCredentialType="IssuedToken" establishSecurityContext="true"/>
              </security>
            </binding>
       </wsHttpBinding>
        </bindings>

        <behaviors>
          <endpointBehaviors>
            <behavior name="ClientCredentials" includeExceptionDetailInFaults="true">
              <clientCredentials>
                <serviceCertificate>
                  <defaultCertificate findValue="Fabrikam" x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="TrustedPeople" />
                  <authentication revocationMode="NoCheck" certificateValidationMode="PeerOrChainTrust" trustedStoreLocation="CurrentUser" />
                </serviceCertificate>
              </clientCredentials>
            </behavior>
          </endpointBehaviors>
        </behaviors>
      </system.serviceModel>

    • For the \UsingWSFederation sample. Here are the changes to the service config. Take note of the issuedTokenAuthentication element:

        <services>
          <service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="ServiceCredentials">
            <endpoint address="" binding="wsFederationHttpBinding" bindingConfiguration="requireInfoCard"
     contract="Microsoft.ServiceModel.Samples.ISecureCalculator" >
            </endpoint>
     <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
       </service>
        </services>

        <bindings>
          <wsFederationHttpBinding>
            <binding name="requireInfoCard">
              <security mode="Message">
                <message issuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" issuedKeyType="AsymmetricKey">
                  <claimTypeRequirements>
          <clear />
                    <add claimType  ="http://schemas.microsoft.com/ws/2005/05/identity/claims/emailaddress"/>
      <add claimType  ="http://schemas.microsoft.com/ws/2005/05/identity/claims/privatepersonalidentifier"/>
                  </claimTypeRequirements>
                  <issuer address="http://schemas.microsoft.com/ws/2005/05/identity/issuer/self"/>
                </message>
              </security>
            </binding>
          </wsFederationHttpBinding>
        </bindings>

        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceCredentials">
              <serviceCredentials>
                <serviceCertificate findValue="Fabrikam" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
        <issuedTokenAuthentication allowUntrustedRsaIssuers="true"/>
              </serviceCredentials>
       <serviceDebug includeExceptionDetailInFaults="False" />
       <serviceMetadata httpGetEnabled="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>

    • Client config as follows:

      <system.serviceModel>
        <client>
          <endpoint address="http://swmvm2k3/servicemodelsamples/service.svc"
           bindingConfiguration="WSFederationHttpBinding_ISecureCalculator" binding="wsFederationHttpBinding"
                    contract="ISecureCalculator" behaviorConfiguration="ClientCredentials">
        <identity>
         <certificate encodedValue="Do a svcutil and you will see the light ..." />
        </identity>   
          </endpoint>
        </client>

        <bindings>
          <wsFederationHttpBinding>
          <binding name="WSFederationHttpBinding_ISecureCalculator" closeTimeout="00:01:00"
     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
     bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
     messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
     maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     <reliableSession ordered="true" inactivityTimeout="00:10:00"
     enabled="false" />
     <security mode="Message">
     <message algorithmSuite="Default" issuedKeyType="AsymmetricKey" isuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1"
           negotiateServiceCredential="true">
           <claimTypeRequirements>
            <add claimType="http://schemas.microsoft.com/ws/2005/05/identity/claims/emailaddress"
             isOptional="false" />
            <add claimType="http://schemas.microsoft.com/ws/2005/05/identity/claims/privatepersonalidentifier"
             isOptional="false" />
           </claimTypeRequirements>
           <issuer address="http://schemas.microsoft.com/ws/2005/05/identity/issuer/self" />
          </message>
         </security>
        </binding>
          </wsFederationHttpBinding>
        </bindings>

        <behaviors>
          <endpointBehaviors>
            <behavior name="ClientCredentials" includeExceptionDetailInFaults="true">
              <clientCredentials>
                <serviceCertificate>
                  <defaultCertificate findValue="Whatever_you_are_using" x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="TrustedPeople" />
                  <authentication revocationMode="NoCheck" certificateValidationMode="PeerOrChainTrust" />
                </serviceCertificate>
              </clientCredentials>
            </behavior>
          </endpointBehaviors>
        </behaviors></system.serviceModel>

    With that all done, you should be able to get both Cardspace samples in the July CTP SDK running, which will give you some relief that, at least, the installation is fine.

    Hope this helps someone out there. Now, moving on to fix the sts.labs.live.com and the relay.labs.live.com issues ... <sigh />

    Monday, August 07, 2006 6:16:28 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Wednesday, August 02, 2006

    While running the setup scripts for the Message Security (Certificate) samples for the July CTP of WCF, I came across an error that barks an "not finding file/folder" exception:

    Upon further investigation into the setup batch scripts reveal this:

    for /F "delims=" %%i in ('"%MSSDK%\bin\FindPrivateKey.exe" My LocalMachine -n ...

    where I discovered the variable %MSSDK% was not defined in file.

    So add this line to the variable settings on the top of the batch script:

    set MSSDK=C:\Program Files\Microsoft SDKs\Windows\v6.0

    This should help solve the puzzule of the missing directory name ...

    Wednesday, August 02, 2006 6:15:22 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, July 07, 2006

    Blasphemy ...

    It is finally published. After many, many, and I mean, many months of paying the process tax for this piece, it is finally LIVE !

    I started this piece with the first ever March 2005 CTP of Windows Communication Foundation (WCF, previously - Indigo) and I went through so many port demos and edit document cycles its so unbelievably painful ...

    But it is really good to see this in online form and shape.

    I started with this idea even though MSFT Corp has explicity stated that it will not support any form of interoperability between WSE 2.0 and WCF, even though it is "theoretically possible to develop Web services using WSE 2.0 in such a way that they can interoperate with WSE 3.0 (and WCF) by using only a reduced set of specifications"

    More importantly, the main reason for the motivation to write such a piece is written in the article itself and I quote:

    [BEGIN QUOTE]


    ...WSE 2.0 has seen 3 service pack releases since its official launch in 2004. It implemented the OASIS Web Services Security 1.0 specification which was the widely accepted interoperability standard protocols between secured web services as well as the implementations of WS-Addressing, WS-SecureConversation and WS-Trust. It was integrated very nicely into Visual Studio 2003. Even BizTalk Server 2004 carries with it a WSE 2.0 adapter for securing of Web Services. Thus, it would be fair to assume that there is more than its fair share of implementations in the market today.

     

    Depending on timing, budget, complexity and a whole host of other requirements, some of these applications will need to be moved and migrated to WSE3.0 and some to WCF. Aaron Skonnard has provided a great resource in his “Service Station” column on MSDN on a brief overview on the migration of WSE 2.0 applications to WSE 3.0 ones. However, as stated in his article, there are some major changes in the programming model and architecture in WSE 3.0 and migrating them from WSE 2.0 may not be trivial.

    Another very important factor to take note is while WinFX, and therefore WCF, is available downstream from Windows Vista to Windows 2003 and Windows XP. That is as far down as it goes. There still exists a huge installed base of Windows 2000 Servers out there running on server and data farms and if you need to implement the advanced Web Services stacks on those servers, WSE is still a very important strategy you cannot ignore.

    As noted in the above guidelines, even though Microsoft will not guarantee interoperability between WSE 2.0 and WCF, the good news is that there are a few WSE 2.0 common scenarios, which can allow wire-interoperability with WCF. I will illustrate them in the next section...


    [END QUOTE]

     

    So, this article will outlined WHAT that reduced set of specifications are and HOW to go about using them.

    Many Special Thanks go to Kirill, the Interop PM on WCF, who gave me a couple of tips to get over the port-over humps I had thoughout this piece since last year. And of course, I cannot forget Clemens, who is the catalyst to making this publication happen when he came onboard.

    I hope this helps at least someone out there. Enjoy !

    Friday, July 07, 2006 6:11:57 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Wednesday, June 07, 2006

    During my webcast on "Why we need Reliablility in SOAP: Web Services", there were a couple of hiccups which hindered a better listening experience.

    1. I cannot see the animation on the slides I am presenting, even though I am assured by the producer that the floor is seeing it. Therefore, I am "guessing" what the audience is actually seeing in my click-animation and gauging my content from there. It was neither easy nor pleasant.
    2. There was a disconnect incident in my demos that also marred the listener's experience. I had to re-login again. Not Good.

    Isnt it ironic? My network connection showed lack of reliability when I am talking about Reliability as a topic. . Now the least I can do is to answer a couple of questions that popped up after the session:

    Q: Is RM available for all the bindings in Windows Communication Foundation (WCF, previously - Indigo)
    A: Yes, it is available for MOST of the standard bindings in WCF. In some bindings such as the netTcpBinding I showed, it is On-by-Default. In bindings such as wsDualHttpBinding where you need correlation of different channels and such, it is Always-On. It doesnt make sense to stick <reliableSession /> in a netMsmqBinding, for example.

    Q: Is this the same WS-RM spec that is authored by IBM, Microsoft and TIBCO ? 
    A: Yes. In my slide, I mentioned - I.B.M and TIBCO. I.B.M is actually the acronym I used for IBM, BEA and Microsoft.

    Q: Can I get the demo you showed? 
    A: No, I am sorry. In any case, my demos will not work with the lastest WinFX B2 bits today. I will need time to port them over. I recommend you go bug Shy when you see him and ask him for his WS-RM demo which consists of a WPF stack in there and a "awesomely" cool Rubik's Cube demo and is 100x better than mine.

    All in all, it is quite a different experience than doing an on-stage presentation, especially when you spent an hour talking to yourself and you cannot see the audience faces and cannot manipulate your content and presentation based on their moods.

    But then again, no one can see that I am wearing my Mickey-Mouse boxers while I am presenting, so I guess that is a good trade-off.

    Wednesday, June 07, 2006 6:06:48 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, May 27, 2006

    Here I am - proud to announce that I will be doing a MSDN Redmond-hosted Webcast right from the other side of the hemisphere in Singapore.

    I will be speaking on concepts of Reliability in Soap:Web Services, why its needed, as well as the context of it in Windows Communication Foundation (WCF, previously - Indigo).

    More importantly, a 40GB Creative (another homegrown Singaporean product) ZEN MP3 player is at stake here waiting to be won. So, do sign up quickly for a chance to win this. Rules here.

    If you are one of those insomniacs in Asia-Pacific, do try to tune-in. I hope this blazes a trail for the other community leaders in Asia-Pacific to follow suit and show that we are right on par there with the best in technology.

    Click here for more details on this webcast.

    Saturday, May 27, 2006 6:03:37 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Wednesday, May 10, 2006

    Fellow Microsoft Regional Director and well-known distributed systems expert Matevz Gacnik has a great blog to add on top of mine called: Windows Workflow Foundation: Exposing Workflows as Services. Trust me, Matevz is a lot more than Request-Response or what his blog suggested .

    In it, he explains some of the ways you can do so and the pitfalls to watch out for. Of course, you can get around the "workflow runtime can only get loaded once per appdomain" issues by having it static to the service implementation class OR if you want only one instance of each - Windows Communication Foundation (WCF, previously - Indigo) also gives you a singleton-like instancing mode as well - InstanceContextMode:=InstanceContextMode.Single.

    (I would be interested to find out the naming convention to call it Single in the latest CTP instead of Singleton)

    My tip highlighted here is not really about exposing workflows as services. It is more about how you can hook a workflow into a already-hosted WCF service as part of its configured behavior, if need be. For example, you may want to have a non-intrusive workflow for you to raise an event that calls into your defined HandleExternalMethod (called EventSink before) and then you may just terminate that activity. The reason is because the workflow thread doesnt return unless you called a WaitHandle.Set, which you can call when a workflow is completed or terminated.

    Having said all that - Remember that most of the current implementations of Web Services today work on a Request-Response model and many more are betting on that it will remain like that for a long time. Isnt this one of the reasons we have long arguments of POX/REST ? Workflows, on the other hand, are made to handle long running work and therefore, you need to design and handle both properly as its design principles and most-used implementations do conflict.

    Now, if you forsake the Request-Response model and think about the wonderful partnership and the options abound once you hit <OperationContract(IsOneWay:=True)> on top of the MSMQ transport, Windows Workflow Foundation (WF) + Windows Communication Foundation (WCF, previously - Indigo) does look very delicious and promising indeed.

     

    Wednesday, May 10, 2006 10:21:25 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, May 08, 2006

    One of the common questions I came across my Windows Workflow Foundation (WF) and Windows Communication Foundation (WCF, previously - Indigo) consultancy tour is how do we logically use WF inside a WCF-hosted service.

    I had spent some time talking about how we can host a WF in a WCF:ServiceHost and how we can create a channel to invoke a workflow inside a WCF Service.

    Of course, we can always bring up a Workflow runtime and create a new workflow instance within the ServiceHost. However, some of us may prefer a more non-intrusive mode of a workflow invocation style.

    There are actually many extensible points at the Service Dispatcher which you can hook into that is part of a service behavior. There is the IServiceBehavior, IOperationBehavior and one of my favourite extensible behavior points I like to hook into is at the IEndpointBehavior.

    For instance, you may want to inspect a message in its raw glory and depending on its headers or the request properties, you may choose to invoke an appropriate action or workflow. You would need to implement the ApplyDispatchBehavior routine which gives you acccess to an EndpointDispatcher, which in turn, gives you a chance to implement a IDispatchMessageInspector. The IDispatchMessageInspector exposes some very useful routines which allows you to hook into the request message just after it has been received as well as before sending the reply message back.

    I would probably inspect the messages at this point and invoke the appropriate workflow and send the appropriate values into the ExternalDataEventArgs of the workflow based on the message values.

    Of course, this is not a hard and fast rule. How and when you do it is totally up to you. You may want to do it at the IOperationBehaviour and have the message dispatched to another entirely different operation if you want to (or if you dont agree with how WCF dispatches its messages).

    Below are some snippets that will help you along. I will be going more in-depth into these details in TechED Asia 2006 in Malaysia where I will show some really cool never-seen-before demos that is a mixture of WF and WCF. If you havent planned to be be there at TechED Asia 2006, do so now !

    Namespace Softwaremaker.NET.Wcf.Demos
    Public Class WcfMessageInspectorWorkflowInvoker : Implements IDispatchMessageInspector

    Public Sub New()
    MyBase.New()
    End Sub

    Public Function AfterReceiveRequest(ByRef request As Message, ByVal channel As IClientChannel, ByVal instanceContext As InstanceContext) As Object Implements IDispatchMessageInspector.AfterReceiveRequest
    Try
    'Inspecting Message Request ...
    'Invoking appropriate Workflows based on values found in request message
    Catch e As Exception
    Throw New FaultException(e.Message)
    End Try
    Return Nothing
    End Function

    Public Sub BeforeSendReply(ByRef reply As Message, ByVal correlationState As Object) Implements IDispatchMessageInspector.BeforeSendReply
    Try
    'Inspecting Message Reply ...
    'Invoking appropriate Workflows based on values found in reply message
    Catch e As Exception
    Throw New FaultException(e.Message)
    End Try
    End Sub
    End Class

    Public Class WcfMessageInspectorWorkflowInvokerBehavior : Implements IEndpointBehavior

    '...

    Public Sub ApplyDispatchBehavior(ByVal serviceEndpoint As ServiceEndpoint, ByVal endpointDispatcher As EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(New WcfMessageInspectorWorkflowInvoker)
    End Sub

    '...
    End Class

    What I have described above is a good way to abstract how and when you invoke a workflow away from your WCF-Hosting or business code. How do I add this behavior into my serviceHost ? Easy. Just call the below before your serviceHost.Open

    serviceHost.Description.Endpoints(0).Behaviors.Add(New Softwaremaker.NET.Wcf.Demos.WcfMessageInspectorWorkflowInvokerBehavior)

    Now, if you decide that the above code sentence intrudes into your hosting code and you would like it to be configured in your config file for flexibility as well, I will show in a later blog post how to add your own custom-defined behaviorExtension into your configuration file. Think: BehaviorExtensionSection.

    ... OR you can always go to TechED Asia 2006 in Malaysia where you sure would derive more value than a single non-interactive blog post.

    Enjoy.

    Monday, May 08, 2006 5:12:54 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Thursday, March 09, 2006

    I remembered talking to someone on the Windows Communication Foundation (WCF, previously - Indigo) team before and the reason they chose [MesssageEncoding].MTOM instead of MessageTransmissionOptimizationMechanism is so that it could *at least* fit on a slide.

    Well, that someone obviously didnt educate the developer who build the [MessageSecurityVersion]. WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10 property. [Talk about a mouthful]

    Not only is it hard to fit on a slide, it would be hard to mouth those words as well.

    Besides "bug jail", "secure-programming courses",  "geography lessons", I would highly recommend Microsoft engineers and developers go for "Power-Point Presentation Etiquette 101" lessons as well .

    Speaking of which, I just got handled an exception with a message like this:

    The CLR has been unable to transition from COM context 0x1a0d28 to COM context 0x1a0e98 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

    Talk about being explicit. Exceptions should give a friendly message that enables one to have an idea where to start debugging and troubleshooting. The one just made me want to shut my machine down. .

    Wednesday, March 08, 2006 7:42:23 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Thursday, January 19, 2006

    Microsoft announced Go Live licenses this morning for Windows Communication Foundation (WCF, previously - Indigo) and Windows Workflow Foundation (WF) , which lets customers use the January Go Live releases of WCF and WWF in their deployment environments. Do note that these are unsupported Go Lives.) 

    More information about the Go Live program is at http://msdn.microsoft.com/winfx/getthebeta/golive/default.aspx.

    There are also a couple of community sites for WCF and WWF here:
    http://windowscommunication.net
    http://windowsworkflow.net

    The community sites give users everything they need to start using WWF and WF today.  If you have some great samples, do post them to the sites;  The WCF sample gallery and WF activity gallery allow you to host the samples/activities on your own site and create links to your own site from the galleries.

    As mentioned, I will be introducing more WWF Blogging to this site. Do stay tuned.

     

    Wednesday, January 18, 2006 9:58:09 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, December 02, 2005

    I was approached to write about Windows Communication Foundation (WCF, previously - Indigo) a while back for SearchVB.com, a member of TechTarget.com.

    Between a few new transitional CTP drops and major Microsoft events, I managed to hack out a simple piece here targetted at entry WCF-VB developers. There is another intermediate one (that deals with security) which will appear slightly later on TechTarget.com. Stay tuned to this space for further updates.

    Do take note that this piece is currently one of the very few out there that is written against one of the latest WCF versions (The Sept-CTP WinFX drop).

    Enjoy and send those comments over.

    Thursday, December 01, 2005 10:05:28 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, November 12, 2005

    I have been spending some time migrating some of my own projects from Windows Communication Foundation (WCF, previously - Indigo) B1 to the Sept-CTP (PDC-Bits) drop. These latest bits are pretty much what we are going to see in Beta 2, which will then closely resemble the release version of WCF when it RTMs.

    From the looks of things in the blogsphere, there is not much activity that relates to the inner plumbings of Channels, Listeners and Factories in WCF B2, so I thought I drop some thoughts here.

    While the higher levels of the System.ServiceModel Programming Model such as the ServiceHost has not changed much (if at all), there are a few changes take should be taken note of underneath the plumbings of ServiceHost.

    This is nothing alarming though. Unless you are one of the few SOAP Plumbers in the world, it is unlikely you will feel any pinch. Morever, from the looks of things in the WCF Forums and newsgroups, I dont see that many people have actually grok into the inner depths of Windows Communication Foundation (WCF, previously - Indigo) B1 yet so this should be nothing but casual observation to most.

    I am going to attempt to split this into a few parts that form a series of short snippets. I hope I have the time to see this through.

    Again, the context of this piece is to find out what lies beneath the ServiceHost. I will end right at the top with the ServiceHost.

    Remember, it is the ultimate goal of the WCF team to give you all (or most) you will ever need at the ServiceHost ServiceModel level. There should be little use for you to muck around with the inner plumblings unless you want to write your own transport which Kenny Wolf has some great information on (since he is a Transport Developer Lead whi owns the TCP transport stack of WCF). While I am just digging around the SDK here, it would be highly recommended that most developers stick to the high level ServiceModel programming model. It is the easiest, fastest and the most abstract, which will shield you from the most pain as the WCF drops gravitate towards the final release. Pain, which I am sharing with you here. 

    One thing that most plumbers will notice in Beta 2 as in contrast to Beta 1 is the disapperance of the concrete Listener Factories. Things like HttpListenerFactory and the SecurityListenerFactory are gone from the developers. This change is made so that there is no demux-ing at the transport-level anymore and that makes it much easier to write your own transport, which is a Good Thing™

    Let us see some code. In Beta 1, if I wanted to set up just a single HTTP (transport) factory and open up a listening channel to it, I would do this on the service side:


    Dim factory As New HttpListenerFactory
    factory.SetUri(New Uri("http://localhost:8080/DemoIInputChannel"))

    factory.MessageEncoderFactory = New TextMessageEncoderFactory

    factory.Open()
    Dim actFilter As New ActionFilter("urn:someAction")

    'Listening for Channels
    Dim listener As IListener(Of IInputChannel) = factory.CreateListener(Of IInputChannel)(actFilter, 0)

    'Accepting Channels
    Dim channel As IInputChannel = listener.AcceptChannel
    channel.Open()

    'Once the Channel opens, a message will pop right out
    Dim m As Message = channel.Receive
    DumpMessageOutToConsole(m)

    'Clean-Up
    m.Close()
    channel.Close()
    factory.Close()

    If you had done some System.Net sockets programming before, this pattern should be very familiar to you. It is the Winsock pattern, which validates the work done by these people for the UNIX environment.

    At the client side of things in B1:


    Dim factory As New HttpChannelFactory
    factory.MessageEncoderFactory = New TextMessageEncoderFactory

    factory.Open()
    Dim channel As IOutputChannel = factory.CreateChannel(Of IOutputChannel) _
    ("http://localhost:8080/DemoIInputChannel")
    channel.Open()

    'Defining the message
    Dim content As New StringReader("<WilliamTay> is still </WilliamTay>")
    Dim xreader As New XmlTextReader(content)
    Dim m As Message = Message.CreateMessage("urn:someAction", xreader)

    'Sending message on the Channel
    channel.Send(m)

    'Clean-Up
    m.Close()
    channel.Close()
    factory.Close()

    As mentioned above, the HttpListenerFactory is removed in B2. So, how would one do the same in B2. Say Hello to the the IChannelListener and the BuildChannelListener. All things should start from System.ServiceModel.Binding now. In other words,

    On the service side: Binding <-> Listener Factories <-> Channel.Receive()
    On the client side: Binding <-> Channel Factories <-> Channel.Send()

    I could go on and on about this but I will spare the reader and not do it here. As Steve had said: IChannelListener is the wave of the future.

    This does give some form of consistency to the programming model on both client and service sides as there are no XXXListenerFactory and XXXChannelFactory to deal with anymore.

    Let us see how things have progressed in B2: On the service side, to do the same - Code is now changed to look like this:


    Dim transBinding As New HttpTransportBindingElement
    Dim custBinding As New CustomBinding
    custBinding.Elements.Add(transBinding)
    Dim bPCollection As New BindingParameterCollection
    Dim uri As New Uri("http://localhost:8080/DemoIInputChannel")

    'Say Hello to IChannelListener and BuildChannelListener
    Dim iChannelList As IChannelListener(Of IInputChannel) = _
    custBinding.BuildChannelListener(Of IInputChannel)(bPCollection)

    'Open the Channel Listener
    iChannelList.SetUri(uri)
    iChannelList.Open()

    'Open Input Channel
    Dim iInputChann As IInputChannel = iChannelList.AcceptChannel
    iInputChann.Open()

    'Once the Channel receives, a message will pop right out
    Dim msg As Message = iInputChann.Receive
    DumpMessageOutToConsole(msg)

    'Clean-Up
    msg.Close()
    iInputChann.Close()
    iChannelList.Close()

    On the client side in B2:


    Dim transBinding As New HttpTransportBindingElement
    Dim custBinding As New CustomBinding
    custBinding.Elements.Add(transBinding)
    Dim bPCollection As New BindingParameterCollection
    Dim uri As New Uri("http://localhost:8080/DemoIInputChannel")

    'Open the Channel Factory
    Dim iChannelFact As IChannelFactory(Of IOutputChannel) = _
    custBinding.BuildChannelFactory(Of IOutputChannel)(bPCollection)
    iChannelFact.Open()

    'Create and open the Output Channel
    Dim iOutputChann As IOutputChannel = iChannelFact.CreateChannel(Of IOutputChannel)(uri)
    iOutputChann.Open()

    'Defining the message
    Dim content As New StringReader("<WilliamTay> is still </WilliamTay>")
    Dim xreader As New XmlTextReader(content)
    Dim msg As Message = Message.CreateMessage("urn:someAction", xreader)

    'Sending message on the Channel
    iOutputChann.Send(msg)

    'Clean-Up
    msg.Close()
    iOutputChann.Close()
    iChannelFact.Close()

    As you can see from the differences that I have documented, the starting point from defining elements is a constant now on both service and client ends. Then, it is on to create the Listener/Channel factories, hook up the respective AcceptChannel()/CreateChannel() then finally accomodate the message dispatching process with channel Receive()/Send()

    There you go. Pretty straight-forward. There is a functionality difference in the B1 code above that is not in my B2-CTP code. Can you spot it?

    I will document that in Part II of this series in the coming days or weeks.

    Enjoy.

    Friday, November 11, 2005 11:08:56 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, November 07, 2005

    Most of the samples that came with the Windows Communication Foundation (WCF, previously - Indigo) drops of Windows FX tend to revolve around a console application hosting the service.

    One of the extensible things you could do with ServiceHost is to derived from it. In other words, implement your own customized ServiceHost. I can think of many good practical use for it besides having control of the initialization of a service such as doing some logging upon initialization, override the config settings, or having your own set of runtime-configured custom bindings, etc.

    For example:

    Public Class MyOwnSWMServiceHost: Inherits ServiceHost

    Protected Overrides Sub OnInitialize
    Console.WriteLine("On Initializing ...")
    'Do some initialization logging
    'OR
    'Check if there is a secured endpoint
    'If not:-
    Me.AddEndpoint(GetType(MyOwnSWMService), new WsHttpBinding)
    MyBase.OnInitialize()
    End Sub

    End Class

    While this is fairly straightforward in implementing and opening the servicehost up in a console application:

    Using svcHost as new MyOwnSWMServiceHost
    svcHost.Open
    ...
    Console.ReadLine()
    svcHost.Close
    End Using

    To do the same in a IIS-hosted service (this throws some people off, especially if you had let the WCF templates generate the .svc file for you), the .svc file needs to be modified to activate the same custom servicehost:

    [%@Service language=vb Debug="true" class="MyOwnSWMServiceHost" %]

    Monday, November 07, 2005 6:00:30 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, October 29, 2005

    I was told that there appears to be a couple of non-working samples in the Windows Communication Foundation (WCF, previously - Indigo) Sept-CTP drop. I found out (the hard way) that one of them was the BasicSecurityProfile sample.

    There is a workaround to it. There are basically 2 bugs in that sample. It may help solve the other bugs in the samples. This will only affect the security samples that uses the WS-Security Specifications in the [basicHttpBinding] bindings.

    BUG 1. The affected sample will only work with X.509 Digital Certificates that has the Subject Key Identifier (SKI) installed. Unfortunately, the cert samples, which are used, are being issued by makecert.exe which doesnt generate X.509 certs with the SKI.

    1. You can create test certificates from Verisign. Those test certs will come with SKI
    2. You can set up a Certificate Authority (CA) on Windows 2003 Server. This is not installed by default and you need to add that component into your server setup. This will issue you a cert with SKI.

    On a separate note, X.509 Digital Certificates that come with SKI offer the best approach in interoperability, so it is best recommended that you work with certs that comes installed with it.

    BUG 2. Once you fix the workaround to BUG 1, and you run the BasicSecurityProfile sample and the client barfs this exception at you:


    System.ServiceModel.Security.MessageSecurityException was unhandled
      Message="No signature message parts were specified for messages with action '*'."
      Source="mscorlib"
      StackTrace: [BLAH] [BLAH] [BLAH]
    You would have come across the second bug. This is an easy fix.

    1. On the client proxy, change the replyAction = "*"

    Once you have these 2 workarounds done up, the BasicSecurityProfile sample should work.

    Both these bugs will be fixed in the subsequent WCF drop. I hope this at least helps someone.

    Saturday, October 29, 2005 1:13:35 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, October 24, 2005

    In Web Services Enhancements (WSE) 2.0, one could exercise some control over what one xml element/fragments wants to encrypt within a soap:Body. Therefore, if I wanted to encrypt the account string in my credit card type, I could do something like this:

    [At your Service Side]


    Public Class SecuredCreditCard
      <XmlElement(ElementName:="CreditCardType")> _
      Public Type As String
      <XmlElement(ElementName:="CreditCardAccount")> _
      Public Account As SecuredString
    End Class

    Public Class SecuredString
      'Set the Oasis Id that our security reference will point to
      <XmlAttributeAttribute("Id", _
    Namespace:=".../2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")> _
      Public ID As String
      <XmlText()> _
      Public Data As String
    End Class

    [At your Calling side]


    Dim a As localhost.IndexWse = New localhost.IndexWse
    Dim b As localhost.SecuredCreditCard = New localhost.SecuredCreditCard
    Dim z As localhost.SecuredString = New localhost.SecuredString

    Dim c As SoapContext = a.RequestSoapContext

    b.CreditCardType = "VISA"
    z.Id = "uri:demoId.softwaremaker.net" 'or some guid
    z.Value = "123-456-789"
    b.CreditCardAccount = z

    c.Security.Elements.Add(New EncryptedData(tok, "#uri:demoId.softwaremaker.net"))

    Note: To reduce headache-inducing typo bugs, you may want to use some WSE Constants such as
    WSUtility.Prefix
    WSUtility.AttributeNames.Id
    WSUtility.NamespaceURI

    The end result of this is a soap:Body on the wire looks like this:


    <SecureCreditCard>
     <CreditCardType>VISA</CreditCardType>
     <CreditCardAccount d4p1:Id="uri:demoId.softwaremaker.net" xmlns:d4p1=".../2004/01/oasis- 200401-wss-wssecurity-utility-1.0.xsd">
      <xenc:EncryptedData Id="EncryptedContent-3d793117-f020-4236-a0a0-0ed545d9bf1a" Type=".../2001/04/  xmlenc#Content" xmlns:xenc=".../2001/04/xmlenc#">
      <xenc:EncryptionMethod Algorithm=".../2001/04/xmlenc#aes128-cbc" />
      <xenc:CipherData>
      <xenc:CipherValue>FRFCiq...+0W5oS4</xenc:CipherValue>
      </xenc:CipherData>
      </xenc:EncryptedData>
     </CreditCardAccount>
    </SecureCreditCard>

    While I dont know how much of performance benefits this has over one that has the entire SecureCreditCard encrypted (since it is an symmetric-key encryption at its core), I think in terms of latency and throughput, it does offer some benefits especially with a sizable payload (>20-30 kb, for instance ?)

    Windows Communication Foundation (WCF, previously - Indigo) does not currently have that feature build in at the moment (Sept05-CTP or known as the PDC-bits). In other words, in WCF today, you encrypt the entire contents of the soap:Body, lock-stock-barrel. I would still love that WSE feature in there: To be able to exercise finer grain control over what I want to or not to encrypt within a soap:Body.

    Would really like to find out if I am the only odd one out there. Any users using that existing WSE feature out there that would love to see the same in WCF or do you have other better ideas ? Leave a comment or email me via the contact link on the side. Thank you.

    BTW: Whether you encrypt certain elements of the contents or encrypt the entire contents of the soap:Body, both are WS-Security Specifications compliant.
     

    Monday, October 24, 2005 1:00:00 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, October 07, 2005
    Thursday, October 06, 2005 8:23:33 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Wednesday, October 05, 2005

    Mike Taulty is throwing up some very good Windows Communication Foundation (WCF, previously - Indigo) notes via his blog here.

    In one of his post, he asked about what is the ListenerFactory that is analogous to the client-side ChannelFactory. This is a good question and I believe the answer is the System.ServiceModel.ServiceHost.

    There are, however, a few ways to implement a server-side pipe that can process and understand his client-side implementation of his generic ChannelFactory here.

    One of the ways to listen and process the incoming message is actually something he has already cooked up in an earlier post of his. However, to answer his question:- ServiceHost is the answer to the ListenerFactory.

    I took the liberty of writing up some code to wire up some ListenerFactory stacks via the Service.ServiceModel.ServiceHost.


    Module SomeModule
    Sub MyOwnServiceHost
    Dim cBindings As New CustomBinding
    Dim httpTransport As New HttpTransportBindingElement
    Dim textEncoding As New TextMessageEncodingBindingElement
    cBindings.Elements.Add(httpTransport)
    cBindings.Elements.Add(textEncoding)

    Using sh1 As New ServiceHost(Of MyOwnServiceHost)(New Uri("http://localhost:8080/"))
    sh1.AddEndpoint(GetType(MyOwnServiceHost), cBindings, "MyOwnServiceHost")
    sh1.Open()
    Console.WriteLine("Service running ...")
    Console.WriteLine("Press Enter to Exit.")
    Console.ReadLine()
    End Using
    End Sub
    End Module

    <ServiceContract()> _
    Class MyOwnServiceHost
    <OperationContract(Action:="urn:someAction", IsOneWay:=True)> _
    Public Sub DumpWhateverToConsole(ByVal m As Message)
    SomeModule.DumpMessageOutToConsole(m)
    End Sub
    End Class

    Wednesday, October 05, 2005 5:06:29 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, September 26, 2005

    Back to more Windows Communication Foundation (WCF, previously - Indigo), or previously known as Indigo, postings...

    I dont think a lot of people know about one of the aspects of WCF, which pertains to how WCF serializes incoming messages before it sends it to the dispatcher and onto your .NET typed code.

    In .NET 1.*, ASMX disregards the ordering of the data elements in the received messages. This means that for a XML Schema such as this:

    [s:complexType name="CreditCard"]
    [s:sequence]
    [s:element name="AccountName" type="s:string" /]
    [s:element name="CreditCardType" type="s:string" /]
    [s:element name="CreditCardNo" type="s:string" /]
    [s:element name="CreditCardExpiryDate" type="s:string" /]
    [/s:sequence]
    [/s:complexType]

    If you send a (W3C) SOAP Message such as this (Take note that the ordering of [AccountName] is not in-line with the above schema):

      [soap:Envelope]
        [soap:Header /]
        [soap:Body]
          [SubmitCreditCard]
            [crdcard]
              [CreditCardType]AMEX[/CreditCardType]
              [CreditCardNo]1234567890[/CreditCardNo]
              [CreditCardExpiryDate]08082088[/CreditCardExpiryDate]
              [AccountName]William Tay[/AccountName]
            [/crdcard]
          [/SubmitCreditCard]
        [/soap:Body]
      [/soap:Envelope]

    ASMX will allow the message to go through.

    In WCF, there is strict enforcing of the ordering of the data elements. Lets take a quick look:

    WCF Code:
    [DataContract()] _
    Public Class CreditCard
      [DataMember(Name:="CreditCardExpiryDate")] Private _CreditCardExpiryDate As String
      [DataMember(Name:="CreditCardType")] Private _CreditCardType As String
      [DataMember(Name:="CreditCardNo")] Private _CreditCardNo As String
      [DataMember(Name:="AccountName")] Private _AccountName As String

      Public Property CreditCardType() As String
        Get
          Return _CreditCardType
        End Get
        Set(ByVal value As String)
          _CreditCardType = value
        End Set
      End Property

      Public Property CreditCardNo() As String
        Get
          Return _CreditCardNo
        End Get
        Set(ByVal value As String)
          _CreditCardNo = value
        End Set
      End Property

      Public Property CreditCardExpiryDate() As String
        Get
          Return _CreditCardExpiryDate
        End Get
        Set(ByVal value As String)
          _CreditCardExpiryDate = value
        End Set
      End Property

      Public Property AccountName() As String
        Get
          Return _AccountName
        End Get
        Set(ByVal value As String)
          _AccountName = value
        End Set
      End Property
    End Class

    This will generate the schema:
    [xs:complexType name="CreditCard"]
    [xs:sequence]
    [xs:element name="AccountName" nillable="true" type="ser:string" /]
    [xs:element name="CreditCardExpiryDate" nillable="true" type="ser:string" /]
    [xs:element name="CreditCardNo" nillable="true" type="ser:string" /]
    [xs:element name="CreditCardType" nillable="true" type="ser:string" /]
    [!-- I omitted some WCF-specific elements here for simplicity.--]
    [!--I will blog more about this on a later date. See Below **--]
    [/xs:complexType]

    There is a reason I put the Public Property AccountName last in my .NET 2.0/Indigo code above. I wanted to show that how you place the property/field in code has no effect on the schema. If you keep a strong observant eye on the resultant schema, you will notice that it is Alphabetical-Ordering dependent and if I send the below message to it:

    [s:Envelope]
    [s:Header /]
    [s:Body]
    [SubmitCreditCard xmlns="http://demos.softwaremaker.net/SchemaDataOrdering"]
    [crdcard]
    [CreditCardExpiryDate]08082088[/CreditCardExpiryDate]
    [CreditCardNo]1234567890[/CreditCardNo]
    [CreditCardType]AMEX[/CreditCardType]
    [AccountName]William Tay[/AccountName]
    [/crdcard]
    [/SubmitCreditCard]
    [/s:Body]
    [/s:Envelope]

    It will result in a HTTP Error Code: 500 (Internal Server Error). What this means is that you have to keep the ordering of the dispatched message to the published schema or else WCF will reject it.

    The consensus from the field (I felt) is that while most of the projects doesnt even feel the lack of schema-ordering enforcements in .NET 1.*, there may be certain advanced validation scenarios that may need order checking at the schema level. While I welcomed this extra checking, I hope it doesnt come with a performance penalty.

    The good news is that the Service.Runtime.Serialization.XMLFormatter, which is used in WCF, is a lot better performer than its predecessor: the XMLSerializer. It does, however, give the developer less control of the XML Schema though. **WCF will add in its own special elements into the schema**. This will aid in better message versioning and control that comes with the evolutionary nature of distributed loosely-coupled messaging systems such as WCF. I will explain more in a later blog post.

    From what I understand, the WCF team is considering of adding an Order property to the DataMemberAttribute to allow for added customization of this order. Again, I feel that this is a good move as Alphabetical-Ordering dependency will mean that developers may have to consider their naming conventions in code should they require a validation check at the schema level.

    What I would like is an attribute for me to turn-off schema data elements ordering validation and checking should I choose to. In this case, the developers on the field will be comfortable of the options they have at hand if validation / performance tradeoffs becomes an issue.

    P/S: I used my own Manual SOAP Post tool to create some of the scenarios here. You may want to download it here.

    Monday, September 26, 2005 5:44:16 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Tuesday, September 06, 2005

    Microsoft intends to offer an "adapter" under its shared source license for linking its BizTalk integration broker with Windows Communication Foundation (WCF, previously - Indigo), formerly known as Indigo.

    Monday, September 05, 2005 9:41:48 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, July 15, 2005

    As you can see from the comments I left there and I am re-producing it here:

    One of the things I noticed is that the .svc extension is strange if you look at it from a endpoint angle. Having

    http://abc.com/def.svc/mex
    http://abc.com/def.svc/ep1
    http://abc.com/def.svc/ep2

    is rather unnatural. I had a couple of attendees who actually thought it was a typo in the HOL (the HOLs are full of typos, btw) and changed it to

    http://abc.com/ep1/def.svc
    http://abc.com/ep2/def.svc

    Of course that didnt work as well. They had a hard time grappling with the unnatural look and feel of it.

    I would think that receiving client applications would do a double-take on this as well once they look at the actual endpoint address

    Getting rid of the physical file extensions would be a great and welcomed idea! Afterall, it is good convergence with the servlets of J2, Remoting and httpHandlers of .NET, Content Management Servers and others as well.

    If I am not wrong, isnt that how REST Web Service works as well ? Something like http://abc.com/ep1 or http://abc.com/getSomething. It is a verb thingy. There is really no physical file on the other end.

    To me, its simpler as well as now if I have to change any type information, it will be in the .config file only and nothing more. God forbid customers to deploy multiple physical files as well ... and to some of us who are used to doing inline scripting in these asmx or svc files (for debugging and testing purposes, not for production use), .NET 2.0 already gives us dynamic compilation in App_Code


    To me, the solution is clear: Dump the svc file extensions

    If you have other ideas, opinions or just want to echo my same thoughts, do feel free to drop by Steve's post and let him know !

    Friday, July 15, 2005 9:54:04 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  • To those whom have attended Indigo Ascend and have asked me via emails: What acutally happens in the plumbings of the IsOneWay part of a Indigo Duplex Contract ?

    HTTP/1.1 202 Accepted is the answer. This is the explicit return.

    HTTP/1.1 100 Continue

    HTTP/1.1 202 Accepted
    Date: Fri, 15 Jul 2005 08:56:07 GMT
    Server: Microsoft-IIS/6.0
    MicrosoftOfficeWebServer: 5.0_Pub
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50215
    Cache-Control: private
    Content-Length: 0

    This, of course, only applies to the HTTP Bindings.

    "The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.

    The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent's connection to the server persist until the process is completed. The entity returned with this response SHOULD include an indication of the request's current status and either a pointer to a status monitor or some estimate of when the user can expect the request to be fulfilled."

    Friday, July 15, 2005 9:14:47 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  • According to Don's blog here: Indigo has support for REST since Day 1. In the same breadth, he disclosed that it will explicitly support HTTP PUT/POST/DELETE/GET to please the REST purists out there.

    Like Steve mentioned here, I, too, am not a fan of technology stacks that complete with their own ideologies. To me, technology is there just to get a job done efficiently and effectively. My post here attracted quite a fair bit of hits and same-echo-sentiment emails. It even made to ZiffDavis blog list here.

    As Steve has echoed as well, I am also even more convinced now that Indigo is going to be the platform to beat when it comes to distributed communications. No doubt about it.

    I am really glad that the Indigo team, whom I think comprises some of the brightest minds in the software field, is all united to work towards a common goal of creating a religion and ideology-agnostic product. If this is not innovation, I dont know what is.

    Show me the money, Beta1

    Friday, July 15, 2005 4:40:50 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Thursday, June 30, 2005

    I had the recent pleasure of meeting up with active blogger Mitch Denny who is one of the Microsoft Indigo Ascend attendees which I conducted last week in Sydney, Australia.

    He spent some time blogging about what was learnt during the 3-day session. A very good read here, here and here for all who is interested in knowing the color of Indigo.

    What a cool dude. You rock, Mitch !

    Wednesday, June 29, 2005 6:09:31 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, June 18, 2005

    WS-MetadataExchange is used and enabled by default in Indigo and it comes with WS-Policy as well.

    This is one specification that I find really useful because the current convention of using http-get to get the metadata from asmx?WSDL is still a very .NET sort of convention. For my projects, I usually like to put the metadata in a physical file and deploy it as *.wsdl. Other people and toolkits will also have their own naming conventions.

    While using http-get is a very useful convention of retrieving metadata, we cannot assume that all services will support HTTP. In Indigo, it’s common to expose an endpoint that only listens over IPC or SOAP-over-TCP.

    At its current Beta 1 drop, only http / https will be supported. I do forsee that tcp will be supported in the next major drop.

    In Indigo, the WS-MetadataExchange endpoints are added to the (http) service by default at the container-baseAddress/containee-endpointAddress as a mex suffix. You can also choose to define your own custom mex endpoints. Another wonderful thing it supports is that it allows the specifying of a custom metadata file (which I know I will be definitely be using). In other words, instead of getting Indigo to automatically generate the metadata, it will send the requestor to the uri location of the metadata file I specify.

    If you have done some UDDI work before, you would be accustomed to the convention of sending standardized (W3C) SOAP Request messages for querying purposes. WS-MetadataExchange uses the same sort of principles, albeit with different querying implementations.

    Here is how it works. There is no better way to illustrate this than to get really friendly with the wire-layer plumbings. I have a tool here that will give you a good view of the exchange.

    SPONSOR.jpg
    Getting an mcdba certification is not a problem if you have done cisco training as well as other security training programs like mcp but there is no replacement of microsoft training.

    You need to send a standard SOAP request to the listening mex endpoint that goes like this (Replace the square brackets with angle ones)

      [s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"]
        [s:Header]
          [a:Action s:mustUnderstand="1"]http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request[/a:Action]
          [a:MessageID]uuid:f22ee227-3eeb-460d-9352-1a34e97bf911;id=0[/a:MessageID]
          [a:To s:mustUnderstand="1"]http://localhost/servicemodelsamples/service.svc/mex[/a:To]
          [a:ReplyTo]
            [a:Address]http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous[/a:Address]
          [/a:ReplyTo]
        [/s:Header]
        [s:Body]
          [GetMetadata xmlns="http://schemas.xmlsoap.org/ws/2004/09/mex" /]
        [/s:Body]
        [!-- OR an Empty SOAP Body will do just as fine --]
        [!-- s:Body /--]
      [/s:Envelope]

    In the tool I had build, you need to put the a:Action value (in bold above) into the SOAPAction textbox as this has to be propagated up to the HTTP-Headers as a SOAPAction header. This is one of the sticklers of using http to query for any SOAP Web Service. Once you clicked post, you will see a good-looking response with all the metadata of WSDL and WS-Policy in the SOAP body. I took out a lot of details in the constraints of space. You should be able to get the point.

      [s:Envelope xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope"]
        [s:Header]
          [a:Action s:mustUnderstand="1"]http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Response[/a:Action]
          [a:RelatesTo]uuid:f22ee227-3eeb-460d-9352-1a34e97bf911;id=0[/a:RelatesTo]
          [a:To s:mustUnderstand="1"]http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous[/a:To]
          [ActivityId xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics"]uuid:a55fa135-e1b9-4557-a7c3-39cbf042f85d[/ActivityId]
        [/s:Header]
        [s:Body]
          [wsx:Metadata xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"]
            [wsx:MetadataSection Dialect="http://schemas.xmlsoap.org/wsdl/" Identifier="http://tempuri.org/"]
              [wsdl:definitions]
                [!--WSDL and XSD GUNK--]
                [!--XSD GUNK--]
                [!--WS-Policy GUNK--]
              [/wsdl:definitions]
            [/wsx:MetadataSection]
          [/wsx:Metadata]
        [/s:Body]
      [/s:Envelope]

    You will be able to load endpoints, bindings and types dynamically at runtime with such information.

    Do take note that Indigo is extremely strict about the mediaTypes headers and you need to set the contentType of the Http-Headers to application/soap+xml. This can be done in the configuration file.

    Do download it and try it.

    If you think this is a cool new feature in the Microsoft technology space, it is not.

    Web Services Enhancements (WSE) 2.0 also had it. All you need is to send in a "http://schemas.microsoft.com/wse/2003/06/RequestDescription" in the Action of a SOAP Message request to a listening WSE 2.0 service and you will be presented with the WSDL as well. This is what WseWsdl2.exe does you switch in a TCP address.

    Saturday, June 18, 2005 5:08:50 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, June 11, 2005

    I will be delivering Indigo Ascend in Asia Pacific in the coming months on behalf of the Indigo and Ascend team in MSFT Corp, Redmond, US.

    It will start in Sydney, Australia later this month, then move upwards (northwards) to my own local backyard, Singapore. There are a few more countries Microsoft and I are interested to look at bringing this event as well.

    This will be a good time for me to meet up with real customers from the enterprises who are using Microsoft distributed technologies or are planning to look into using it in the future. Drop me an email here if you would like to engage me for a discussion.

    If you are reading this blog post and you work for an ISV or an enterprise that does a fair bit of distributed computing technology and you are interested in attending this Indigo Ascend in Singapore (I think we are a little bit late in nominations for Australia), do drop me a mail here and I will see what I can do to hook you up for this 3 day event.

    If you are from anywhere else besides Australia or Singapore (in APAC) and would love to attend an event like this, do drop me an email as well and I will see what I can do to bring Indigo Ascend to your country.

    I have been invited to deliver a few Ascends before such as Visual Studio 2005 and such. However, I have always turned it down because I dont consider myself to be a "professional" trainer since I have always been on the field working on real projects with real problems in distributed technologies for some time (and not some simulated fanciful classroom labs scenarios) ...

    ... BUT...

    Indigo is an Ascend which I am proud and excited to deliver because it is a future facet of Windows Server 2003 that I have spent quite some time on and I believe it is something that real customers need in the field to solve real-world problems today.

    There is really nothing quite like it out there at the moment or in the immediate future outside of Microsoft. It is really one of Microsoft's innovation at its best.

    Saturday, June 11, 2005 11:35:54 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, May 28, 2005

    This will be interesting ...

    I think I will reserve my comments on this for now.

    Friday, May 27, 2005 11:23:39 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, May 21, 2005

    I know it is supposed to be here. However, I think it is taking some time to propagate to the server farms. So, just stay tuned.

    If it still doesnt work after some time, may want to try this: http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=b789bc8d-4f25-4823-b6aa-c5edf432d0c1&genscs=0&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2ff%2fa%2f3%2ffa3b19ba-6129-41e8-93d8-498cc6b52b14%2fwinfxsetup.exe

    Something that is rather useful that is gathered from the usergroups:

    ... found a logfile (dd_indigo_retMSI60A6.txt) with the following entry:

    MSI (s) (B0:1C) [12:29:27:752]: MainEngineThread is returning 1638
    Another version of this product is already installed.  Installation of this
    version cannot continue.  To configure or remove the existing version of
    this product, use Add/Remove Programs on the Control Panel.
    {C350D87C-7B67-43E2-B717-E9ADABE2F631}

    So I ran this command:

    msiexec /x {C350D87C-7B67-43E2-B717-E9ADABE2F631}

    and now the Indigo setup worked! It will probably work for you as well!

    Saturday, May 21, 2005 1:42:23 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, April 30, 2005

    With reference to my earlier post here, more details on the conference (SDA.NET 2005) are now publicly available here. This is a paid event and it is rarity in Singapore as technological conferences are usually presented free. BUT I am sure attendees can find a lot of value here as top notch speakers from all over the world will be flying over here to share their industry experience and knowledge.

    Who are these speakers, you ask ? There is the famous Ingo Rammer and Clemens Vasters and of course, moi .

    I will be making 2 presentations in the VIP Tracks, namely

  • Demystifying WSDL (26 May 2005 1045 hours)

    While developers rely on the many powerful features of today's IDEs, inner technical plumbings are often ignored and worst yet - misrepresented and misunderstood. This ignorance of inner workings can lead developers to choose the wrong technologies and solutions for solving specific problems. Nevertheless, when it comes to troubleshooting the nooks, crannies and crevices at crunch time with no extra help, nothing beats a dirty pair of hands, a hammer and screwdriver. William Tay attempts to get everyone's hands dirty with a detailed look at WSDL, one of the most core and mature XML service technologies of today.

    Topics to be covered include: what is WSDL, WSDL's critical role in service-orientated architecture (SOA), and WSDL's core elements and definitions. He will also survey WSDL best practices (eg. interoperability, extensibility, versioning, etc.) and the application of WSDL concepts in Indigo. The new features and enhanced functionality incorporated into the upcoming release of WSDL 2.0 are explained and compared with the current WSDL version.

    NOTE: This is a (Level 400) deep technical session that is not for the faint-hearted. However, it will be a angle-bracket fest.

  • SOAP Message-based Security: Today and Tomorrow (26 May 2005 1415 hours)

    One of the three key pillars of critical importance in the adoption of SOAP messaging-based services in an enterprise is security. In fact, the security aspect of standards-based messaging system has been singled out by worldwide CXOs as the most inhibiting factor in the mainstream-wide adoption within an enterprise. The ratification of WS-Security 1.0 by OASIS on 6 April 2004 has gone into great lengths to change that perception. William will show how and what you can do to secure your SOAP messaging-based services today. You will also learn how the same standards-based WS-Security Specifications can be used to secure the next generation of distributed web services with Indigo.

    All 3 of us are presenting on Indigo as well. This will be a good time to catch a preview of Indigo and have a feel of what it is all about. I really hope to see a good turnout there and it will be a good time to catch up with Ingo, Clemens and the rest of the folks.

    See you there.

  • Friday, April 29, 2005 11:20:56 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Monday, April 11, 2005
    Lets take a look at the meaning and symbolism of the color Indigo. I will attempt to slot in my own views on how the color maps into the technology.
    Monday, April 11, 2005 2:02:17 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  • There was Viper (I am sure there is a play somewhere here with COBRA or izzit CORBA ?), Falcon, Wolfpack, COM+ (I dont think it has a codename), .NET Remoting and now Indigo, which happens to be Green at first.

    Of course, the Development and Database tools were codenamed after places (Everett, Orcas, Yukon, Whidbey, ...) Incidentally, the belief was that the further the codenamed "place" was from Redmond, the later the shipping dates will be. I dont really know the accuracy of that though.

    Of course, my interest has always been in the domains of distributed computing and I have been on Viper since Day 1 and moving along with each new evolution of distributed computing technology. I am deeply entrenched in Indigo today, which some people have argued it is more of a revolution of distributed systems in terms of its perception. I dont disagree. However, I always chose to believe that Information Technology should be deployed for the sake of Business Innovation and not just for the sake of technology. This hasnt happen before BUT I strongly believe it is set to change with the coming of age of technological (horizontal) and business (vertical) standards and Indigo is set to deliver that set of technological standards while enabling vertical standards to be built on top of it. Put it all together and you get real Service-Orientation which preaches to the idea that Business drives IT and not the other way around.

    Monday, April 11, 2005 1:15:19 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Saturday, April 02, 2005
    As usual, I find the documentation of the Indigo CTP bits rather lacking. This is to-be-expected for any CTP Releases. Besides the declaration of attributes, Indigo makes heavy use of configuration to enable an Aspected-Oriented style of programming (AOP). This is really good as it really separates the technical goo from the functional business gunk. This is all good BUT the documentation for the configuration section (plus the schematic view) is rather lacking from the CTP documentation.
    Friday, April 01, 2005 10:25:10 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, March 25, 2005
    Finally, it is available to the public ! Go get it here. The PressPass is here.
    Friday, March 25, 2005 1:05:36 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Thursday, March 24, 2005

    While still playing around with the Indigo March-CTP bits and having lots of fun exploring Addresses, Bindings and Contracts (ABC), I was configuring and playing around with the Instancing behavior of an Indigo Service (which I will talk more about later), I created 4 different services of the same interface type and contract, each implementing a different instance behaviour. I am hosting this svc in IIS and therefore, my endpoint address is provided by the host IIS. Therefore, in my config file, I have this:

        <services>
          <service
              serviceType="IndigoBehaviourInstance.PrivateDischargePatientService"
              behaviorConfiguration="SomeDischargePatientBehavior">
            <endpoint address=""
                      bindingSectionName="wsProfileDualHttpBinding"
                      bindingConfiguration="BindingOne"
                      contractType="IndigoBehaviourInstance.IDischargeProcess,IndigoBehaviourInstance" />
          </service>
          <service
              serviceType="IndigoBehaviourInstance.SingletonDischargePatientService"
              behaviorConfiguration="SomeDischargePatientBehavior">
            <endpoint address=""
                      bindingSectionName="wsProfileDualHttpBinding"
                      bindingConfiguration="BindingOne"
                      contractType="IndigoBehaviourInstance.IDischargeProcess,IndigoBehaviourInstance" />
          </service>
          <service
              serviceType="IndigoBehaviourInstance.SharedDischargePatientService"
              behaviorConfiguration="SomeDischargePatientBehavior">
            <endpoint address=""
                      bindingSectionName="wsProfileDualHttpBinding"
                      bindingConfiguration="BindingOne"
                      contractType="IndigoBehaviourInstance.IDischargeProcess,IndigoBehaviourInstance" />
          </service>
          <service
              serviceType="IndigoBehaviourInstance.PerCallDischargePatientService"
              behaviorConfiguration="SomeDischargePatientBehavior">
            <endpoint address=""
                      bindingSectionName="wsProfileDualHttpBinding"
                      bindingConfiguration="BindingOne"
                      contractType="IndigoBehaviourInstance.IDischargeProcess,IndigoBehaviourInstance" />
          </service>     
        </services>

    As we can see from here, all bindings and contract types are the same related to these 4 different endpoint services...and since the endpoint address is provided by the host, the only thing different is the serviceType, bearing in mind that each service is implemented in by its own class. This does make the above configuration less intuitive as it should be. Flexibility should be given to all different serviceTypes to be configured much more intuitively. In this case, if the serviceType attribute is an element, it allows for that flexibility.

        <services>
          <service behaviorConfiguration="SomeDischargePatientBehavior">
            <serviceType type="IndigoBehaviourInstance.PrivateDischargePatientService" />
            <serviceType type="IndigoBehaviourInstance.SingletonDischargePatientService" />
            <serviceType type="IndigoBehaviourInstance.SharedDischargePatientService" />
            <serviceType type="IndigoBehaviourInstance.PerCallDischargePatientService" />  
            <endpoint address=""
                      bindingSectionName="wsProfileDualHttpBinding"
                      bindingConfiguration="BindingOne"
                      contractType="IndigoBehaviourInstance.IDischargeProcess,IndigoBehaviourInstance" />
          </service>
        </services>

    ...or something to that effect...Now if the (multiple) endpoint elements can be done this way, why not the serviceType ?

    Am I missing something here ?

    Wednesday, March 23, 2005 9:00:12 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Sunday, March 20, 2005
    As blogged earlier, I have been crossing more and more into the Indigo realm and ripping the bits apart to see what it is made of. Some of my immediate work assigments will primarily revolve around Indigo-WSE-SOAP and as someone who works in an SI environment, interoperability is something I am very concerned about and I am therefore very particular on what goes out on the wire.
    Sunday, March 20, 2005 3:31:30 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Wednesday, March 16, 2005

    ...or is it purple I am seeing...?

    New exciting work assignments come with the dawn of this impending day in the very near horizon. I will update as we go along.

    Tuesday, March 15, 2005 10:31:50 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions

  •  Friday, October 29, 2004
    Friday, October 29, 2004 3:33:55 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer 
  • Blog reactions