by community-syndication | Jun 17, 2011 | BizTalk Community Blogs via Syndication
Introduction
In this article we are going to see the end to end integration of Azure AppFabric Service bus and Silverlight. First we are going to create a very basic "Hello World" Silverlight application that interacts with a WCF operation called "GetWelcomeText" and displays the text returned in the UI. In order to explain the core concepts clearly, we are going to keep the sample as simple as possible. The initial solution is going to look as shown below. The SL application hosted on a local IIS/AppFabric(server) web server and accessed via a browser as shown below.
Next, we are going to extend the same sample "Hello World" example to introduce Azure AppFabric service bus as shown in the below picture and show the power of AppFabric Service bus platform, which enables us to use the remote WCF services hosted geographically somewhere in the wild.
Original Source: http://blogs.digitaldeposit.net/saravana
The first part of the article doesn’t going to touch anything on Azure AppFabric service bus, it’s all about creating a simple SL/WCF application.
Create a Hello World Silverlight Application
Open Visual Studio (use Run as Administrator), and Click New Project from the Start page, which will bring the "New Project" window as shown below
Select Silverlight from Installed Templates, and choose "Silverlight Application" from the list. Provide "AppFabricSBandSLIntegration" as the name and click OK. In the next screen ("New Silverlight Application"), just leave the default values and click OK. The solution structure will look as shown below.
Add a simple WCF service:
Right click on AppFabricSBandSLIntegration.Web ASP.NET application and select "Add New Item", which brings the "Add New Item" window as shown below.
Select "Web" from Installed templates and "WCF Service" from the list provide "AdminService.svc" as the name and click "Add".
Next, rename the default method name "DoWork" to "GetWelcomeText" and changed the return type from "void" to "string" both in IAdminService.cs and AdminService.cs files. The implementation now looks as shown below.
Rebuild the solution by pressing Ctrl+Shift+B.
Convert the web application to use IIS:
By default the ASP.NET web application will be configured to run on a local server (cassini), for our demo we are going to configure it to run under IIS/AppFabric(server). Right click on the AppFabricSBandSLIntegration.Web project, select "Properties". In the properties windows select "Web" from LHS and select the option "Use Local IIS Web Server". Click on "Create Virtual Directory" button to create the virtual directory and click OK on the popup window (you must have opened Visual Studio by Run as Administrator; else this step will give error.)
Build the solution by pressing Ctrl+Shift+B, and navigate to http://localhost/AppFabricSBandSLIntegration.Web/AdminService.svc and make sure no errors encountered.
Configure web.config file with appropriate WCF settings
For this step we are going to use the WCF service configuration tool SvcConfigEditor.exe. Open a Visual Studio command prompt and type SvcConfigEditor.exe. Once the application is opened, click File/Open and navigate to web.config file found under AppFabricSBandSLIntegration.Web folder.
Click on "Create a New Service" link and click the browse button. Navigate to AppFabricSBandSLIntegration.Web/bin/ AppFabricSBandSLIntegration.Web.dll and select AppFabricSBandSLIntegration.Web.AdminService once selected the screen should look as shown below
Click on the "Next" button in the wizard and make sure the contract is selected as shown below.
Click "Next", On "What communication mode is your service using?" option select "HTTP"
Click "Next", On "What method of interoperability do you want to use?" option select "Basic web service interoperability"
Click "Next", On "What’s your address of your end point", clear http:// and click "Yes" on the warning.
On the final summary screen, click "Finish". Your web.config file will now look as shown below.
Rebuild the solution by pressing Ctrl+Shift+B. Right click on AdminService.svc file and select "View in Browser". Make sure it displays as shown below without any errors.
Now we have completed all the required stuff on the WCF services side, let’s move on to the client side Silverlight application.
Prepare the Silverlight application to communicate with the WCF Service.
Add Service Reference:
The very first step is to create the service reference to our AdminService.svc WCF service. Right click on the AppFabricSBandSLIntegration Silverlight project and select "Add Service Reference", which will bring the window as shown below.
Paste the url of our AdminService.svc file and click "Go". Once the service is resolved, provide "AdvancedServiceReference" as the namespace and click "OK".
The above step should automatically add ServiceReference.ClientConfig file to the AppFabricSBandSLIntegration Silverlight project as shown below.
Open the MainPage.xaml file and add a TextBlock as shown in the below snippet.
Open the MainPage.Xaml.cs file and add the following lines of code. Basically we are instantiating the proxy client, hooking up the "Completed" event and call the asyn method GetWelcomeTextAsync. Once we receive the response from WCF service, SL runtime will automatically execute the code present in the event handler. We are simply displaying the "Hello World from WCF Service" text returned from WCF service in the text block we created in the previous step.
At this stage everything is completed and pressing the "F5" button should execute the ASP.NET/Silverlight application and display the following result
In part 2 of the article, we’ll see how we can introduce Azure AppFabric Service bus in the middle between the Silverlight client and the WCF service. You may be wondering, why I have used the SvcConfigEditor.exe to configure the WCF service rather just simply asking the user to paste 4 lines of configuration Xml. The main reason for using the tool is, when we modify the configuration for Azure AppFabric Service Bus, it makes it easy to understand all the available configuration options.
Nandri
Saravana Kumar
by community-syndication | Jun 17, 2011 | BizTalk Community Blogs via Syndication
I always take compiler warnings seriously and at least investigate them before releasing. In one of the solutions I work on I consequently received the warning ’Cannot resolve the ’schemaLocation’ attribute’. This solution contains a BizTalk project with a lot of schemas. For each schema multiple occurrences of this warning where reported. This lead to […]
Blog Post by: Randal van Splunteren
by community-syndication | Jun 16, 2011 | BizTalk Community Blogs via Syndication
Just a quick tip, when you are trying to debug a Silverlight application by putting break point in the Silverlight code and you see the message "Breakpoint will not currently be hit. No symbols loaded for this document." with a hallow icon and warning symbol.
The reason for this is, Silverlight debugging is not enabled on the web application hosting the Silverlight XAP file. You can fix this easily by going to "Properties" of the web application, choose "Web" from LHS tab, and under Debuggers section select the check box "Silverlight".
Nandri!
Saravana
by community-syndication | Jun 16, 2011 | BizTalk Community Blogs via Syndication
I get an exception when configuring BizTalk 2010.
BizTalk application server.
Separate SQL server for the databases.
Exception: System.EnterpriseServices.TransactionProxyException
Looking at http://support.microsoft.com/kb/293799
When a System.EnterpriseServices.TransactionProxyException exception is triggered during a transaction completion, it cannot be caught from other application domains. Instead, you receive a System.Runtime.Serialization.SerializationException exception that resembles the following:
Unhandled Exception: System.Runtime.Serialization.SerializationException: Type ‘System.EnterpriseSer vices.TransactionProxyException’ in Assembly ‘System.EnterpriseServices, Version=2.0.0.0, Culture=ne utral, PublicKeyToken=b03f5f7f11d50a3a’ is not marked as serializable.
Gave me a hint to the problem, however was not the solution or any where near to it be careful following this I did not.
I saw that the databases were created during the configuration, and then deleted; only leaving the management database in a weird state. So the communication to the database server was fine.
I did some more investigation and found the dtctester tool great for testing if my dtc was set up correctly, as this is one thing that BizTalk leverages extensively.
I ran the ‘dtctester’ tool, and it came up with the following:
Executed: dtctester.exe
DSN: PMS
User Name: *******
Password: ********
tablename= #dtc16032
Creating Temp Table for Testing: #dtc16032
Warning: No Columns in Result Set From Executing: ‘create table #dtc16032 (ival
int)’
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Error:
SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver]
Distributed transaction error’
Error:
SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cur
sor state
Typical Errors in DTC Output When
a. Firewall Has Ports Closed
-OR-
b. Bad WINS/DNS entries
-OR-
c. Misconfigured network
-OR-
d. Misconfigured SQL Server machine that has multiple netcards.
Aborting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
Ok, so my problem was DTC.
I found a great response to a similar problem that told me to look at a couple of DTC issues. (http://dbaspot.com/sqlserver-server/215054-msdtc-doesnt-seem-work.html)
http://support.microsoft.com/kb/817064
http://support.microsoft.com/kb/301600
If you are running Win2K3 SP1, you will need to reset the DTC security parameters:
http://support.microsoft.com/kb/899191
Since you are beginning the transaction on a remote host, that host will also need to properly configure its DTC services.
Finally, if the communication must transit any firewalls, then you will need to restrict RPC ports on both Client and Server for Internet Ports, and then authorize these Ports in the firewall ACLs.
http://support.microsoft.com/kb/300083
http://support.microsoft.com/kb/250367/EN-US
I checked the firewall, no problem, I checked the other things, and made a change to the DTC security not via the method mentioned but via the component services.
Everyone should know by now to change the security settings under component services for the dtc on the sql server and the BizTalk server.
Go to the Component services/My Computer/Distributed Transaction Controller/LocalDTC
Properties/security
Ensure that everything in here is checked, (Remote admin is optional)
I usually select no Authentication required, and ensure that the network service account is running the service.
I did this, thinking I’ve found the problem..
Nope same problem re occurs
I find out that the SQL server is clustered, so I go to the cluster manager, and look at the dtc settings, and open the localdtc from there, the same thing, all the settings are correct because I had already changed them.
Then I notice, CLUSTER DTC, and expand that and mange that. The cluster has its OWN instance of DTC, of course, it does not use the local DTC at all.
I look at the security settings of the cluster DTC, and change those to match, and wolla it works. Nice to know if the SQL server is clustered
Always look at DTC, if your BizTalk does not wish to install to a remote SQL server.
by community-syndication | Jun 16, 2011 | BizTalk Community Blogs via Syndication
By default Silverlight applications are allowed to access resources (services) only from the location from where they originated. From Silverlight 2.0 support was included to access services from a remote server (cross-domain), as long as the remote server allows the Silverlight application to access it. This gave administrators more control on who is accessing the resource, and can impose certain restrictions.
The security policy system in the Silverlight runtime requires that a policy file (clientaccesspolicy.xml) be downloaded from a target domain before a network connection is allowed to access a network resource under that target domain.
Basics:
When a connection request is initiated from Silverlight application, the SL runtime tries to download the security policy file using the HTTP protocol. The SL runtime first tries to download a SL policy file with the name “clientaccesspolicy.xml” at the root of the requested target domain using HTTP protocol. If it can’t find “clientaccesspolicy.xml” file, it will try and download “crossdomain.xml” file, which was developed by Adobe for Flash. Both the files are recognised by SL runtime.
If the policy file retrieved is successfully parsed and grants permission, a connection is finally opened to the target host. If the policy file retrieved is invalid, the connection to network resource is denied by SL runtime. For more information on policy file please refer to http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx
Challenge with AppFabric Service bus
From the above AppFabric Service bus architecture picture, we can imagine your SL application is running on the LHS (on-premises). The WCF services that the SL application dependant on is deployed on the RHS (on-premises). The communication between the SL and WCF deployed on two geographically separate premises are connected using the Windows AppFabric Service bus.
The important point to note here is the SL application is not going to originate/reside in the same location as the WCF services (RHS on-premise). The SL application would have originated from different source, may be from a local web server on the LHS on-premise. So for the SL runtime the WCF services are from a different domain and cross-domain security policy file (clientaccesspolicy.xml/crossdomain.xml) is required to establish a connection.
Here comes the challenge, as explained in the basics topic earlier. The SL runtime is going to look for clientaccesspolicy.xml file on the root of the requested target domain. In the AppFabric Service bus case, the root is actually the Service bus namespace. Ex:
http://yournamespace.servicebus.windows.net , not the actual location of WCF services on the RHS on-premise. The SL runtime will try to make a HTTP request, equivalent of
http://yournamespace.servicebus.windows.net/clientaccesspolicy.xml
And since that file is not available in that location, it will throw a security exception and won’t allow any further network connection.
Previous hacky solutions:
So far developers tackled this challenge by creating a REST service on the WCF RHS on-premise covering the root URL, something as shown below.
[ServiceContract]
public interface IClientAccessPolicy
{
[OperationContract]
[WebGet(UriTemplate = “clientaccesspolicy.xml”)]
Message GetPolicyFile();
}
Few examples:
http://blogs.u2u.be/peter/post/2011/02/08/Silverlight-and-the-Windows-Azure-AppFabric-Service-Bus.aspx
http://code.msdn.microsoft.com/CSAzureServiceBusSLRest-41878c00
One of the challenges with this approach is you need to make sure you register the REST service at the end, after registering all your real WCF services. Since the REST service is at the root and it doesn’t have a unique URI, registering it first will result in taking the complete namespace and trying to register any other services will result in an error saying
“The specified address already exists.Address…..”
Developers tacked this scenario by either manually registering the REST (clientacccesspolicy.xml) service at the end, or by using some custom WCF behaviour logic to delay its registration process.
Hidden Gem in AppFabric SDK 2.0 CTP – Easy Solution
As part of the AppFabric SDK V2.0 CTP samples (download details provided at the end), Microsoft released a sample application called “ClientAccessPolicyPublisher”, which allows you to upload your clientaccesspolicy.xml file to your root service bus namespace. Once the file is uploaded you can access it by simply navigating to it using the URL as shown below.
http://yournamespace.servicebus.windows.net/clientaccesspolicy.xml
This completely eliminates all the challenges we have discussed so far and it makes AppFabric service bus easily accessible via Silverlight applications.
The tool is simple to use, open command prompt and execute the exe Microsoft.ServiceBus.Samples.ClientAccessPolicyPublisher.exe
After providing AppFabric Service bus shared secret credentials, it will show the options as shown above. “P” will upload the default clientaccesspolicy.xml file (found under the same folder), which is pretty generic and allows the entire http* and https* connections. If you got specific restrictions you can specify your own.
The other options are self explanatory, which allows to see the existing policy file and delete it if required.
Important: The sample project points to the “appfabriclabs.com” and its hardcoded in code, so you need to open program.cs file and find and replace all “appfabriclabs.com” with “windows.net”.
Example:
var acsEndpoint = “https://” + serviceNamespace + “-sb.accesscontrol.windows.net/WRAPv0.9/”;
Download Details:
http://www.microsoft.com/download/en/details.aspx?id=17691
WindowsAzureAppFabricSDKSamples_V2.0-CS.zip
\AppFabric SDK V2.0 CTP\Samples\ServiceBus\Silverlight\ClientAccessPolicyPublisher
Special thanks to Mikael Hakansson for pointing me to this SDK sample. When I was there in Stockholm, Sweden for the BizTalk user group meeting and biztalk360.com promotion, I was discussing this topic with Mikael, since it’s in our road map to enable biztalk360 to use AppFabric service bus to support remote customer BizTalk server environment.
Nandri
Saravana
by community-syndication | Jun 16, 2011 | BizTalk Community Blogs via Syndication
Found via Rahul Garg
This training kit contains a complete set of materials that will enable you to learn the core developer capabilities in BizTalk Server 2010. This kit includes lab manuals, PowerPoint presentations and videos, all designed to help you learn about BizTalk Server 2010. There is also an option below to download a Virtual Machine that is ready for you to use with the training kit.
http://www.microsoft.com/download/en/details.aspx?id=14865
The material looks really extensive, haven’t see one like this for any of the previous versions of the product.
After completing this course, students will be able to:
- Work with schemas, maps, and pipelines, and create flat file schemas.
- Configure a new FTP, HTTP and Windows SharePoint Services (WSS) adapter for BizTalk Server
- Use BizTalk Orchestration Designer to create and test a simple orchestration.
- Configure orchestration properties and variables, deploy an orchestration, and create and deploy a rule set and execute those rules from within an orchestration.
- Define, deploy, and map a BAM observation model.
- Use the deployment and management features in BizTalk Server
- Build a simple Windows Communication Foundation (WCF) service and client and configure BizTalk Server to use a WCF Adapter.
- Create a Microsoft .NET class library project that will contain a WCF Adapter.
- Deploy artifacts needed for processing certain EDI documents and for turning XML messages into EDI.
Nandri!
Saravana
by community-syndication | Jun 15, 2011 | BizTalk Community Blogs via Syndication
For the BizTalk Portuguese Community, I publish an article call “Microsoft BizTalk Server seen by the programmer’s eyes” on the Magazine “Programar”. J%u00e1 est%u00e1 dispon%u00edvel a 29%u00aa edi%u00e7%u00e3o da Revista PROGRAMAR, uma publica%u00e7%u00e3o digital gratuita com diversos artigos relacionados com desenvolvimento de software. Esta edi%u00e7%u00e3o cont%u00e9m um artigo da minha autoria sobre Microsoft BizTalk Server […]
Blog Post by: Sandro Pereira
by community-syndication | Jun 15, 2011 | BizTalk Community Blogs via Syndication
When you install the Windows Azure AppFabric SDK, it extends your machine configuration files with set of WCF custom extensions (behaviour, bindings, bindingElement) to help you build the AppFabric service bus based applications. Examples:
- basicHttpRelayBinding
- netTcpRelayBinding
- ws2007HttpRelayBinding
- serviceRegistrySettings
- transportClientEndpointBehavior
- tcpRelayTransport
- httpRelayTransport
- httpsRelayTransport
- onewayRelayTransport
As soon as you start working, you will notice couple of issues.
- Broken Visual Studio IntelliSense, and
- Broken IIS 7.0/7.5 AppFabric settings.
For Broken Visual Studio IntelliSense, there is very good article (Intellisense when editing Service Bus configuration files? Yes please!) from Paolo Salvatori explaining how you fix it.
For the broken IIS 7.0/7.5 settings there are few blog posts recommending you to replace the ServiceBus_schema.xml file that comes as part of the Azure SDK samples under the "%SystemRoot%\System32\inetsrv\config\schema" folder.
Example 1:
http://www.infosysblogs.com/cloudcomputing/2011/06/basic_steps_to_expose_the_on-p.html#more
Once the Azure SDK installed, copy the ServiceBus_schema.xml file from <installation folder>\Labs\IntroServiceBus2010Part1\Source\Assets to %SystemRoot%\System32\inetsrv\config\schema directory.
Example 2:
http://msdn.microsoft.com/en-us/evalcenter/wazplatformtrainingcourse_introductiontotheappfabricservicebus2010part1_topic4
Additionally, as Windows Server AppFabric uses the Microsoft.WebAdministration (MWA) API to read and write configuration files, you will provide a custom MWA schema for some of the elements from the Web.config file to be correctly recognized. This will give you the possibility to enable the Auto-Start feature from the Internet Information Services (IIS) Manager.
- Copy the ServiceBus_schema.xml file located under the Source\Assets folder of this lab to the %SystemRoot%\System32\inetsrv\config\schema directory. This file contains the schema that will be used by the Windows Server App Fabric to read the configuration file for your service.
There is a better and easy way
The easy fix is to install the patch explained in this KB article http://support.microsoft.com/kb/980423
After installing the fix, I didn’t encounter any issues on the AppFabric Server (IIS Manager 7.0) related to custom service bus WCF elements.
Nandri!
Saravana Kumar
by community-syndication | Jun 15, 2011 | BizTalk Community Blogs via Syndication
HP Business Data Warehouse Appliance
The Microsoft and HP Business Data Warehouse appliance Optimized for SQL Server 2008 R2, provides the best performance possible for data mart and small data warehouse workloads with data volumes of up to 5 TB. The appliance helps reduce the time and cost of implementing a data warehouse through deployment of an optimized, pre-configured solution that has been designed, tuned, tested by Microsoft and HP.
http://www.microsoft.com/sqlserver/en/us/solutions-technologies/Appliances/HP-bdw.aspx
Blog Post by: cvidotto
by community-syndication | Jun 15, 2011 | BizTalk Community Blogs via Syndication
www.sqlserverlaunch.com – Includes:
Blog Post by: cvidotto