May 2007 - Posts

Well Microsoft Teched is here!!!!!!!!

This year I will be sharing stage again with my friend Sonu Arora who is the Program Manager for the WCF Line of Business Adapters SDK (official name until they change it again).  We will be talking about using WCF to build Line of Business Adapters, Architecture principles among other topics. The best part is that we are going to (surprise surprise) build a real adapter as part of one of our demonstrations!! We also are going to show how to consume adapters from .NET apps, BizTalk Server and SharePoint Server Business Data Catalog. I'll be posting the code online soon.

So if you are looking into using WCF fro interacting with your LOB system or you want to get familiar with some of the new technologies on BizTalk Server R2 swing by our session.I am also going to be around the Connected Systems area, if you are on the area and you are interested on chatting about SOA, BizTalk, WCF, etc come by and introduce yourself.

 

Posted by gsusx | 6 comment(s)
During the months I have been doing some experiments with Windows Workflow (WF) and SQL Server Service Broker (SSB). SSB is a natural fit for a WF persistence service given features such as conversation group locking, security, etc. My friend Roger Wolter (one of the minds behind the first version of SSB) has started blogging his thoughts about the WF and SSB integration.

 

Posted by gsusx | with no comments
A few weeks ago my good friend Harry Pierson mentioned me that Pat Helland was back at Microsoft working on the Developer Division. For those of you who haven’t heard about him; Pat has been one of the main contributors to transactional programming technologies during the last 20 years. His contributions include technologies such as MTS, COM+ and the recent SQL Server Service Broker. Before returning to Microsoft Pat spent two years working on Amazon.com Web Services. Well, now Pat is not only back at Microsoft but he started blogging again!!!
Posted by gsusx | 1 comment(s)
Filed under:

One of the really cool features included in the Orcas bits is the integration between Microsoft AJAX 1.0 and WCF. My buddy Steve Maine has been doing an amazing job evangelizing this technology. One of the components that make possible the “WCF-Atlas” magic is the DataContractJsonSerializer. This is the component that serializes .NET objects into a JSON representation and deserializes JSON data back into .NET objects. Using the DataContractJsonSerializer is fairly similar to using other .NET serializers. Let’s take the following WCF Data Contract as an example:

    [DataContract]

    public class Sample

    {

        [DataMember]

        public int Field1;

        [DataMember]

        public string Field2;

        [DataMember]

        public bool Field3;

    }

 

The following code serializes an instance of that contract in a JSON representation.

Sample obj = new Sample();

 obj.Field1 = 111;

 obj.Field2 = "test";

 obj.Field3 = true;

 FileStream stream = new FileStream(file path…, FileMode.OpenOrCreate);

DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Sample));

serializer.WriteObject(stream, obj);

stream.Close();

 

This code produces the following JSON serialized format.

{"Field1":111,"Field2":"test","Field3":true}

 

The deserialization process is also very similar to the existing .NET serializers.

FileStream stream = new FileStream(file path…, FileMode.Open);

DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Sample));

Sample  obj= (Sample)serializer.ReadObject(stream);

 

Simple and brilliant, like all good technologies.

Posted by gsusx | 5 comment(s)
Filed under: ,

The Web Services Transaction v1.1 specifications (WS-Coordination, WS-AtomicTransaction and WS-BusinessActivity) have been approved as OASIS Standards.

Posted by gsusx | 6 comment(s)
Filed under: ,

I got some interesting comments on my recent post about the differences between the MSMQ and WCF-NetMSMQ BizTalk Server adapters from a developer perspective. As I explained in that post, one of the main reasons for choosing WCF-NetMSMQ adapter over the MSMQ adapter is the possibility of having type information (a.k.a WCF contract) available at design time. Let’s take a look to a practical example.

Assume that we have the following orchestration that adds two numbers. One of my friends likes to say that is the most inefficient name to add two numbers; but is great for a demo though.

  

Figure 1: BizTalk Orchestration

The orchestration is being activated thru a MSMQ message received by the WCF-NetMsmq adapter. The following picture shows the receive location configured to do so.

  

Figure 2: NetMsmq Receive location

The next step is to use the WCF Service Publishing Wizard to expose the orchestration as a WCF Service. One of the main steps in this process is to point the Wizard to a configured receive location in order to generate the correct binding information.

  

Figure 3: WCF Publishing Wizard: NetMsmq binding

The WSDL generated from this process looks like the following

<wsdl:definitions name="BizTalkServiceInstance" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">

            <wsdl:documentation>

                        <CreationInfo Created="2007-05-03 22:02:36Z"/>

            </wsdl:documentation>

            <wsp:Policy wsu:Id="NetMsmqBinding_IOneWayAsync_policy">

                        <wsp:ExactlyOne>

                                    <wsp:All>

                                                <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>

                                                <msmq:MsmqVolatile xmlns:msmq="http://schemas.microsoft.com/ws/06/2004/mspolicy/msmq"/>

                                                <msmq:MsmqBestEffort xmlns:msmq="http://schemas.microsoft.com/ws/06/2004/mspolicy/msmq"/>

                                                <wsaw:UsingAddressing/>

                                    </wsp:All>

                        </wsp:ExactlyOne>

            </wsp:Policy>

            <wsdl:types>

                        <xsd:schema targetNamespace="http://tempuri.org/Imports">

                                    <xsd:import schemaLocation="http://r2:80/BtsMathService/BtsMathService_MainProcess_InPort.svc?xsd=xsd2" namespace="http://BtsMathService.InputType"/>

                        </xsd:schema>

            </wsdl:types>

            <wsdl:message name="BtsMathService_MainProcess_InPort_Operation_1_InputMessage">

                        <wsdl:part name="part" element="q1:Root" xmlns:q1="http://BtsMathService.InputType"/>

            </wsdl:message>

            <wsdl:portType name="BtsMathService_MainProcess_InPort">

                        <wsdl:documentation>service "BtsMathService.MainProcess" port "InPort"</wsdl:documentation>

                        <wsdl:operation name="Operation_1">

                                    <wsdl:documentation>operation "Operation_1"</wsdl:documentation>

                                    <wsdl:input message="tns:BtsMathService_MainProcess_InPort_Operation_1_InputMessage"/>

                        </wsdl:operation>

            </wsdl:portType>

            <wsdl:binding name="NetMsmqBinding_IOneWayAsync" type="tns:BtsMathService_MainProcess_InPort">

                        <wsp:PolicyReference URI="#NetMsmqBinding_IOneWayAsync_policy"/>

                        <soap12:binding transport="http://schemas.microsoft.com/soap/msmq"/>

                        <wsdl:operation name="Operation_1">

                                    <wsdl:documentation>operation "Operation_1"</wsdl:documentation>

                                    <soap12:operation soapAction="Operation_1" style="document"/>

                                    <wsdl:input>

                                                <soap12:body use="literal" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>

                                    </wsdl:input>

                        </wsdl:operation>

            </wsdl:binding>

            <wsdl:service name="BizTalkServiceInstance">

                        <wsdl:port name="NetMsmqBinding_IOneWayAsync" binding="tns:NetMsmqBinding_IOneWayAsync">

                                    <wsdl:documentation>net.msmq://server/private/testqueue</wsdl:documentation>

                                    <soap12:address location="net.msmq://r2/private/testqueue"/>

                                    <wsa10:EndpointReference>

                                                <wsa10:Address>net.msmq://server/private/testqueue</wsa10:Address>

                                    </wsa10:EndpointReference>

                        </wsdl:port>

            </wsdl:service>

</wsdl:definitions>

  

Now we are ready to implement the client code. This process is not different of implementing any WCF client mainly because THE TYPE INFORMATION IS AVAILABLE AT DESIGN TIME.

BtsMathService_MainProcess_InPortClient proxy = new BtsMathService_MainProcess_InPortClient();

Root request= new Root();

request.param1= 12;

request.param2= 45;

proxy.Operation_1(request);

  

The msmq interactions are configured at the binding level.

<?xml version="1.0" encoding="utf-8"?>

<configuration>

            <system.serviceModel>

                        <bindings>

                                    <netMsmqBinding>

                                                <binding name="NetMsmqBinding_IOneWayAsync">

                                                            <security mode="None">

                                                                        <transport msmqAuthenticationMode="WindowsDomain" msmqEncryptionAlgorithm="RC4Stream"

                                                        msmqProtectionLevel="Sign" msmqSecureHashAlgorithm="Sha1" />

                                                                        <message clientCredentialType="Windows" />

                                                            </security>

                                                </binding>

                                    </netMsmqBinding>

                        </bindings>

                        <client>

                                    <endpoint address="net.msmq://server/private/testqueue" binding="netMsmqBinding"

                                bindingConfiguration="NetMsmqBinding_IOneWayAsync" contract="BtsMathService_MainProcess_InPort"

                                name="NetMsmqBinding_IOneWayAsync" />

                        </client>

            </system.serviceModel>

</configuration>

  

Having the contract information available at design time facilitate the interactions for products that are completely type dependant such as, surprise surprise, BizTalk Server!!! It also removes the knowledge dependency between the message sender and the receiver. But the most important factor is that this apporach uses Msmq where is should be used, at the transport level, and not impacting directly the business logic. 

Posted by gsusx | 5 comment(s)
Filed under: ,

If you have been following this blog during last year you know I have been doing a lot of work with J2EE .NET Web Services interoperability. Specifically, a lot of my work and papers have been focused on Oracle .NET interoperability. Well, a few weeks ago Oracle awarded me with an Oracle ACE (the equivalent to a Microsoft MVP). The Oracle ACE program has some fundamental differences with the Microsoft MVP program including the fact that Oracle employees can be awarded too. I am truly honored for receiving this award and I am really looking forward to keep working with the Oracle and Microsoft product teams and the developer community in general.

PS: There are a lot of people that, in some way or another, contributed to my papers. Specially, I would like to thanks my good friends Kirsti and Ben Elliott for making some of my papers understandable for human beings (or at least they tried hard to do so).

Posted by gsusx | 1 comment(s)
Filed under:
More Posts