Enterprise Application Sample for Windows Azure

 

 

Microsoft has released an end to end enterprise application sample for Windows Azure and Microsoft cloud technologies.

It is a service-oriented application based on the .NET Framework 4.0, including ASP.NET and Windows Communication Foundation (WCF).

It illustrates many of the .NET enterprise development technologies that can be used for building highly scalable, “cloud-connected” applications.

The application demonstrates a single code base that works on traditional servers, Hyper-V private clouds, and in the Windows Azure public cloud, including hybrid cloud scenarios.

The download includes the automated setup for the .NET StockTrader 5.5 and the Configuration Service 5.5, with associated technical documents that explain how to run and reconfigure the .NET StockTrader service-oriented application. Additional documentation in the download provides the steps necessary to implement the Configuration Service 5.5 in your own applications and services for central configuration management; distributed caching; load-balancing and failover across clustered service nodes. The sample includes:

· .NET StockTrader 5.5 composite Web application and middle tier services.
· Optional Windows Azure Projects for deploying to the cloud.
· New modes for Advanced Web Service (WS-*) message-level security and interoperability with a variety of non-Microsoft platforms via the SOA architecture.
· Configuration Service 5.5 with technical guides and samples.
· Capacity planning tool for running multi-agent benchmarks against the .NET StockTrader services.
· WSTest 1.5 Web services benchmark.

 

 

Advertisements

Calling WCF Service inside MS Office applications

One of the easier ways to call a WCF Service inside MS Office applications (Word/Excel) is using the WCF Service moniker component.

Let us see how we can do this.

1. Create a sample WCF Service

[ServiceContract(Namespace=”http://WCFMSOfficeTest.com”)]
public interface IMSOfficeTestService
{
[OperationContract]
int AddData(int value1, int value2);
}

2. Implement the Service

public class MSOfficeTestService: IMSOfficeTestService
{
public int AddData(int value1, int value2)
{
return value1+value2;
}

3. Host the service with BasicHttpBinding and open the Mex Endpoint.

4. Create a Macro

4.1 Open Excel -> Developer -> Macros -> Create. Name it WCFCall
Sub WCFCall()

Dim address As String

address= “service:mexAddress=’http://localhost:8500/MSOfficeTestService/mex’,” ‘metadata location
address= address+ “address=””http://localhost:8500/MSOfficeTestService/””,” ‘service location
address= address+ “contract=””IMSOfficeTestService””, contractNamespace=””http://WCFMSOfficeTest.com””,”
address= address+ “binding=””BasicHttpBinding_IMSOfficeTestService””, bindingNamespace=””http://WCFMSOfficeTest.com”””

Dim wcfscv As Object
Set wcfscv As = GetObject(address)
Dim value1 As Integer

Dim value2 As Integer
value1 = Sheet1.Cells(1, 1)

value2 = Sheet1.Cells(1, 2)

Sheet1.Cells(1, 3) = wcfscv.GetData(val1, val2)
End Sub

5.  Enter values in A1 & B1

6. Run the Macro

7. Results will be displayed in C1.

It is an easy way and if you want to get the data from a WCF Service directly into excel for calculations this is one of the way to do it.