Sunday, August 29, 2010

Microsoft’s Windows Server AppFabric Customer Advisory Team ( CAT)

Microsoft’s Windows Server AppFabric Customer Advisory Team ( CAT) has launched a new blog focused on AppFabric (both Windows Server AppFabric and Azure AppFabric), WCF, WF, BizTalk, data modeling and StreamInsight. This team contains the artists-formerly-known-as-BizTalk-Rangers, and they provide deep expertise on BizTalk Server, Windows Server AppFabric, WCF, WF, AppFabric Caching and StreamInsight (CEP). These technologies become more and more important in time to come, when it comes to integration, process automation, SOA and Cloud Computing. This is something to look at closely and I suggest to digest it’s content. Also I suggest to read Richard’s post on Microsoft Customer Advisory Teams, and why should know them.


Technorati:

Saturday, August 21, 2010

BizTalk 2010: Changed features and tools

 

I have been reading through BizTalk 2010 Technical Review and noticed that a few things have been changed in BizTalk 2010 compared to current 2009 version. SQL Adapter has been removed and one should now turn to WCF-SQL Adapter that is a part of BizTalk Adapter Pack 2.0. Although in my BizTalk Server 2010 Beta environment on VPC, I still see the SQL Adapter.

In forums I notice still a lot of people use the standard out-of-the box SQL Adapter and they will have to make the shift towards WCF-SQL Adapter in future.For anyone who likes wants to learn more, the article on Packt Publishing by Richard Seroter called New SOA Capabilities in BizTalk Server 2009: WCF SQL Server Adapter is a good starting point and as a follow up my previous post WCF-SQL Table Operations discusses how to set it up the adapter and how CRUD operations on tables in SQL Server work. 

Another change is that BizTalk Explorer tool in Visual Studio 2010 is not available for BizTalk Server 2010. Any administrative task you as an administrator of developer wants to do with a Graphical UI is BizTalk Server Administration Console. I think a lot of people stop using this feature in 2006 as Administrative Console came available.

In the Administration console you will also find the BizTalk Server Settings Dashboard, and this is a new feature. Performance settings previously managed through the registry and other locations, are now been centralized in this dashboard. To manage settings (i.e. performance) for the group, hosts, and host instances, you can now use this dashboard. These settings control throttling, thresholds and other runtime parameters in a single location and all settings can be exported and imported to move them between environments. Thiago has written an excellent post on this called BizTalk Server 2010 Beta: Settings Dashboard and Latency control per host.

Cheers.

Technorati:

Wednesday, August 11, 2010

Microsoft Windows Azure Revisited

Well it almost seems ages ago, but it almost two years ago Microsoft launched Windows Azure. After the PDC’08 I wrote a post called the future is in the cloud and some responded: “this cloud thing is going to be huge. But, the question if Microsoft will also be huge. I think the clear market leader at the moment is Amazon, followed by Google”.

Where is it now? According to this article ‘Microsoft's Windows Azure: What a difference a year makes a lot has changed. I notice it to as Windows Azure is getting more press releases here in the Netherlands in different magazine (on- and offline). Even I have just recently wrote another article around Service Bus for Dutch Technet magazine, which basically a little more detailed story found on Windows Azure website.

image

Cloud computing is starting to be big business and Microsoft will be one of the providers for it together with Google and Amazon. As IT professional I am starting to get more involved into it, like integration between on-premise systems with SalesForce (CRM Cloud application). See some of my previous posts.

I do believe that it will not take long before companies will fully embrace cloud computing and adopt Windows Azure or offerings by Google, Amazon and others. By then a lot of us will work on applications and services running in the cloud and connecting them to on-premise applications and systems. BizTalk certainly will play a role in it.

BizTalk, SalesForce and MSMQ – Part II

In this post I would like to continue, where I left of in Part I where a did a run down in setting up an account at SalesForce, building a service and how to consume its WSDL. Also explained some security details necessary for communication with your SalesForce service. In an orchestration you can consume a web service build in SalesForce, through running BizTalk WCF Service Consuming Wizard. If you run the wizard and pick WDSL generated for your service BizTalk will generate schema and binding file for you. Schema en binding file shown below.

image

image

Binding file will be helpful in creating WCF-Custom send port. I have built an orchestration that consumes my created SalesForce web service. The orchestration is initiated (activated) by picking up a file form a folder location. Xml file contains account name I want to retrieve details from SalesForce. Information in the file will be used to call the service and response message is sent to MSMQ.

image

In MessageAssign shape code from ForceToken is called to obtain sessionId:

image

I have created a Windows Application to read message from the queue. Request message looks like this:

image

Response from web service using the request above will result in message containing it to queue.

image

I have created a windows application (test application) to read the message from the queue.

image

I can directly call my SalesForce service through .net (GetDetails), read from queue and write to queue. In .Net you are able to create proxy code from WSDL, through same steps as explained in part I (through adding a web reference).

Above you will find code used to test service.

One side note I would like to mention now is that if logins to SalesForce fail a couple of times you will be temporarily locked out of salesforce.com due to failed login attempts. So if forgot your password, that you have to ask for new one (I do not know how long your are locked out). Then take into account that your security token is tied to your password and subject to any password policies your administrators have configured. Whenever your password is reset, your security token is also reset. In first part you will see how. During writing of this post I was locked out.


If I try to get details from an account I click GetDetails, which in this case only returns website from the account.

image

If I click ReadFromQueue I will get complete response from the web service.

image

Code for ReadFromQueue:

I have created another web service on SalesForce in which I can update annual revenue for account.

image

I followed basically same procedure as for first web service created in SalesForce. I generated the WSDL, saved it to file and through BizTalk WCF Service Consuming Wizard I got schema and binding file. I created a new orchestration that reads files from MSMQ with new annual revenue information to be updated.

image

In my test application I can change to annual revenue from 1000 to 2000 and then click SendToQueue.

I change value inside my test app textbox including messagetype that has to be returned.

image

If I look at my account details now I see they changed.


image

With binding files generated by BizTalk you can import these inside your application through BizTalk Administrator console so that WCF-Custom send ports are generated for you.

image



If you right click on one of these generated port and click properties and then configure you will see details.



image



Action is filled in and URI and if you go to the net tab the binding then you also noticed that is filled in.



image



As you can see integration with SalesForce through web services is pretty straight forward. In coming posts I would like to share different implementations using same sample and dive into logging and support.



Cheers!


Technorati:

Friday, August 06, 2010

WCF-SQL Adapter Table Operations

In this post I like to show all table operations possible with WCF-SQL Adapter. The WCF based SQL Adapter can be used to connect BizTalk applications to SQL Server. WCF-SQL Adapter is part of BizTalk Server Adapter Pack 2.0, but can also be downloaded separately. To work with the adapter you will need to install the WCF LOB Adapter SDK SP2 before installing this adapter. Something that is overlooked easily, which also accounts for the fact that this adapter is offered as a supplement to BizTalk Server 2009. You must have a valid license for the BizTalk Server in order to use the SQL adapter and be eligible for support and to receive updates.

Important to note here are the supported operating systems:

  • Windows Server 2003 Service Pack 2
  • Windows Server 2008
  • Windows Vista
  • Windows XP Service Pack 3
  • Windows XP SP3
  • Windows Server 2003 SP2
  • Windows Server 2003 R2
  • Windows Server 2008
  • Windows Vista
  • and required is .NET 3.5 SP1.

The Adapter Metadata wizard is supplied through WCF LOB Adapter SDK and necessary to generate schema’s through Visual Studio .NET.

The SQL adapter can be used in BizTalk either as a WCF-Custom port or a WCF-SQL port. If you want to use the SQL adapter through a WCF-Custom port, you do not need to add the WCF-Custom port to the BizTalk Server Administration console, because the WCF-Custom port is added to the BizTalk Server Administration console by default. However, if you want to use the SQL adapter through a WCF-SQL port, you must first add the WCF-SQL adapter to the BizTalk Server Administration console. To add the WCF-SQL Adapter you need to start the BizTalk Server Administration Console and than perform the following steps:

1. In the console tree, expand the BizTalk Group, expand Platform Settings, and then click Adapters.

2. Right-click Adapters, point to New, and click Adapter.

clip_image001

3. In the Adapter Properties dialog box, specify a name for the adapter and from the Adapter list, select WCF-SQL.

clip_image002

4. Click Ok.

Having the adapter in place you can use it for your solutions. You can download sample from Microsoft related SQL Adapter through BizTalk Adapter Pack 2.0 samples. There you will find the Performing Operations on Tables sample that shows how to perform operations on tables in SQL Server, but this only shows you the select operation (i.e. download is called SelectTable.exe).

To perform operations on SQL Server by using the WCF-SQL adapter with BizTalk Server, you must perform a set of design-time and run-time tasks using Visual Studio and BizTalk Server Administration console respectively. These high level tasks to create a message based solution are:

  • Create BizTalk project, and generate schema.
  • Create messages instances.
  • Build and deploy the BizTalk project.
  • Configure the application.
  • Start the application.

Downloaded sample executes the SELECT operation on the EMPLOYEE table in a SQL Server database. This sample performs the following operations:

  • Picks up the request message to execute the SELECT operation from a predefined file location.
  • Sends the request to the SQL Server database to perform the operation.
  • Receives the response from the SQL Server database and copies the response at another predefined file location.

Download sample contains code and sqlscript is provided to create the database. I like to show all the CRUD operations (i.e. CREATE, REQUEST, UPDATE and DELETE). You can create the database using SQL Server Management Studio and load/execute the script (2005 or 2008 found in SelectTable solution sqlscripts folder). Other step to perform is creating a BizTalk project.

BizTalk Project and generate schema (‘s)

First, we need the XML schemas, which represent our data source. By installing the WCF LOB Adapter SDK SP2, you will have a metadata browser built into Visual Studio. NET at your disposal. You can access this from a BizTalk project by right-clicking the project, choosing Add then Generated Items and selecting Consume Adapter Service.

clip_image002

This action opens a new window that provides us the interface to connect to, browse, and select database objects for service interaction. The very first thing we need to do here is choose the sqlBinding as the service binding, and then configure a connection string. The simplest working connection string consists of an Initial Catalog value for the database, and a valid Server name entry. Note that the adapter now uses a connection string in the form of a URI instead of the traditional Data Source=;Initial_Catalog=;User_ Id=;Password= style.

clip_image002[6]

Once a satisfactory connection string is defined, the Connect button can be clicked to establish an active connection to the target database. If the connection is successful, one see the category browser with a set of database object categories.

image

On the root "/" character a range of un-typed generic functions are displayed, which can be exploited. Click on tables and you will see a number of Tables, select Employee.

image

Click the Delete, Insert, Select and Update statement in available categories and operations. Click the Add button to add the operations.

image

After clicking the Ok button at the bottom, schema (and a single binding file) is added to our associated BizTalk project in Visual Studio.NET.

image

The binding can be used later, when solution is deployed and ports have to be configured for SQL Server (i.e. Send Port).

Create message instances

Next step is to generate messages from generated schema, which can be routed from Recieve location in Receive Port to a send port with WCF-SQL Adapter (messaging based solution). Generating the first message is easy, as you can right click on the TableOperation.dbo.Employee.xsd and select Generate Instance and an instance of top element is created (i.e. delete).

image

You will get a instance of message as depicted below:

image

By opening up the TableOperation.dbo.Employee.xsd in file-editor you can move the next operation to top, so you can then in Visual Studio generate the next instance for an operation or you can use XML-Editor inside Visual Studio (closing schema, right click and select open with… and then select XML Editor) to move elements around. In end you will have four xml instance for TableOperations, save to file as xml (type all files, encoding UTF-8!).

Select:

<ns0:Select xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee%22>
<ns0:Columns></ns0:Columns>
<ns0:Query></ns0:Query>
</ns0:Select>

Insert:

<ns0:Insert xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee%22>
<ns0:Rows>
<ns1:Employee xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22>
<ns1:Employee_ID></ns1:Employee_ID>
<ns1:Name></ns1:Name>
<ns1:DOJ></ns1:DOJ>
<ns1:Designation></ns1:Designation>
<ns1:Job_Description></ns1:Job_Description>
<ns1:Photo></ns1:Photo>
<ns1:Rating></ns1:Rating>
<ns1:Salary></ns1:Salary>
<ns1:Last_Modified></ns1:Last_Modified>
<ns1:Status></ns1:Status>
<ns1:Address></ns1:Address>
</ns1:Employee>
</ns0:Rows>
</ns0:Insert>

Update:

<ns0:Update xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee%22>
<ns0:Rows>
<ns0:RowPair>
<ns0:After>
<ns1:Employee_ID xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Employee_ID>
<ns1:Name xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Name>
<ns1:DOJ xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:DOJ>
<ns1:Designation xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Designation>
<ns1:Job_Description xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Job_Description>
<ns1:Photo xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Photo>
<ns1:Rating xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Rating>
<ns1:Salary xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Salary>
<ns1:Last_Modified xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Last_Modified>
<ns1:Status xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Status>
<ns1:Address xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Address>
</ns0:After>
<ns0:Before>
<ns1:Employee_ID xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Employee_ID>
<ns1:Name xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Name>
<ns1:DOJ xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:DOJ>
<ns1:Designation xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Designation>
<ns1:Job_Description xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Job_Description>
<ns1:Photo xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Photo>
<ns1:Rating xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Rating>
<ns1:Salary xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Salary>
<ns1:Last_Modified xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Last_Modified>
<ns1:Status xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Status>
<ns1:Address xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22></ns1:Address>
</ns0:Before>
</ns0:RowPair>
</ns0:Rows>
</ns0:Update>

Delete:

<ns0:Delete xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee%22>
<ns0:Rows>
<ns1:Employee xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo%22>
<ns1:Employee_ID></ns1:Employee_ID>
<ns1:Name></ns1:Name>
<ns1:DOJ></ns1:DOJ>
<ns1:Designation></ns1:Designation>
<ns1:Job_Description></ns1:Job_Description>
<ns1:Photo></ns1:Photo>
<ns1:Rating></ns1:Rating>
<ns1:Salary></ns1:Salary>
<ns1:Last_Modified></ns1:Last_Modified>
<ns1:Status></ns1:Status>
<ns1:Address></ns1:Address>
</ns1:Employee>
</ns0:Rows>
</ns0:Delete>

Build and deploy the BizTalk project

Only schemas are required for a messaging only scenario with WCF-SQL Adapter to perform operations on SQL Server. Therefore after assigning a strong name and application name to BizTalk project it can be build and deployed.

image

Configure the application

After solution has been deployed it is time to configure the ports. FILE ports are easy and focus here will be configuring the WCF-SQL Send Port. Through BizTalk Management Console one can browse to SelectTable application and right click the application and select Import Bindings … and navigate to file called WcfSendPort_SqlAdapterBindings_Custom.bindinginfo.xml, select and click Open. You will notice that a Send Port will be created automatically.

image

If you look at created send port and configuration you will notice that everything is there. I can tell that this will not work for all the operations as I experience the following error described in this blog post: Why does the Adapter say ‘Action is not understood’ even though I am using the binding file generated by the ‘Consume Adapter Service’ wizard? I choose to delete three operations and create three similar send ports based on first generated send port. Next steps are setting filters on WCF-Send Port and File Send Port. Configuration is as follows:

Port Name

Type

Filter

RcvPortTableOperations

FILE

SndDeleteOperation

WCF-SQL

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#Delete

SndInsertOperation

WCF-SQL

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#Insert

SndSelectOperation

WCF-SQL

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#Select

SndUpdateOperation

WCF-SQL

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#Update

SndOperationResponse

FILE

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#SelectResponse

OR

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#SelectResponse


OR

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#SelectResponse


OR

BTS.MessageType == http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee#SelectResponse

Start the application

In the end your messaging solutions can be depicted as below. After configuration you can start BizTalk application.

image

Select Operation:

image

Response:

image

Insert Operation:

image

Response:

image

Results so far if you query Employee Table are:

image

Update Operation:

image

Response:

image

Result after update if you query Employee Table again are:

image

Last operation will be delete.

Delete Operation:

image

Response:

image

Result after delete if you query Employee Table again are:

image

I hope with this post I was able to show all operations (CRUD) on table. The sample from MSDN shows only SELECT operation and here I have extended on that, showing all operations and how to setup WCF-SQL Adapter and steps to do, before you can execute all operations on a SQL Table.

Cheers!


Technorat: