KYIV, Ukraine, June 7, 2011.
Pursuing a long-term strategy, Ukraine has finalized construction of a new solar energy power station in Crimea. Being highly dependent on imported energy resources, the country puts a lot of efforts to make the internal energy production and consumption more efficient. The newly built solar plant is also a part of the National Projects, aimed at lessening the imported energy consumption by 30 percent by year 2015.
The construction of the solar power plant capable of producing 25 thousand megawatt-hours of environmentally clean electrical energy per year has been accomplished in accordance with Nature Energy project. Such capacity will meet the needs of about 5000 households in the area and will help reduce carbon dioxide emissions by 20 thousand tons per year.
Natural Energy is one of Ukraine's National Projects launched by the Ukrainian leadership in late 2010. It is aimed at producing electric energy from the 'clean' sources such as the sun and the wind in the amount of 2000 MW. The objective of such initiative is to supply the area with low transportation cost electricity and preserve the environment making these areas attractive for tourism development.
The State Agency of Ukraine for Energy Efficiency and Energy Conservation which developed a program of energy efficiency, reports that the share of alternative energy shall make up to 30 percent of Ukrainian energy market before 2015. Nowadays, around 60 percent of energy resources, mainly natural gas, in the country is imported.
Ukraine has an extensive potential market of solar energy projects. The capacity of solar radiation in Ukraine reaches from 800 to 1450 W / m squared per year. Hence Ukraine's geographical position, the southern regions of the country bear the highest potential: Crimea, Mykolaiv, Kherson and Odesa regions.
The main incentive for the growth of Ukraine's solar Photovoltaic market is a so-called green tariff system, introduced in September 2008 and amended in April 2009, which introduced fixed feed-in tariffs for electricity from renewable sources for 20 years.
Ukraine is the twelfth largest energy market in the world with an installed capacity of 54 GW as of 2009, exporting its excess electricity to such countries as Russia, Slovakia, Romania, Poland, Moldova and Hungary.
пятница, 8 июня 2012 г.
New Solar Station in Crimea Becomes Ukraine's Green Strategy Milestone
вторник, 5 июня 2012 г.
суббота, 2 июня 2012 г.
App Fabric Service Bus.
Hello! . App Fabric Service Bus. This publication is the second of its kind, dedicated to this mechanism. At first I recall, we met with the definition and basic scenarios of technology and know how to create your first namespaces. Here you can watch it at this link:. Introduction to AppFabric Service Bus. scenarios. Today, the post will be more technical - will try to create and use a WCF- service by. Service Bus.
Thus, the problem is as follows: to build a WCF- service, which contains a single method. The method will accept a string parameter and immediately return it to the client. This service will try to host a service on the bus. That is, in fact Service Bus will act as a relay messages between the client and the WCF- service. To solve the problem created a new Solution to the following projects:. EchoService. Client. ,. EchoService. Server. ,. EchoService. Source. In the studio, it looks like this:.
EchoService. Client. is a console application through which users can send messages to the server. EchoService. Server. - This is our server ( also console application), based on which will open WCF- host who runs one we want to WCF- Service. Since both the client and the server requires a contract WCF- service - we put it in a shared assembly called. EchoService. Source. In this assembly is a single interface, the code is shown below.
using System;.
using System. Collections. Generic;.
using System. Linq;.
using System. Text;.
using System. ServiceModel;.
namespace EchoService. Source.
{.
[ServiceContract (Name = 'EchoContract', Namespace = 'http://samples. microsoft. com / ServiceModel / Relay / ')].
public interface IEchoContract.
{.
[OperationContract].
string Echo (string message);.
}.
}.
Nothing unusual - a standard interface with a single method of Echo, takes a string parameter and returns. In the assembly. EchoService. Server. is the implementation of this interface - it's a class called. EchoServer. - The code is also presented below.
using System;.
using System. Collections. Generic;.
using System. Linq;.
using System. Text;.
using EchoService. Source;.
using System. ServiceModel;.
namespace EchoService. Server.
{.
[ServiceBehavior (Name = 'EchoService', Namespace = 'http://samples. microsoft. com / ServiceModel / Relay / ')].
public class EchoServer: IEchoContract.
{.
public string Echo (string message).
{.
Console. WriteLine ('Received: { 0 }', message);.
return message;.
}.
}.
}.
There are also all standard - class implements an interface marked with the attribute and IEchoService. ServiceBehavior. (thus the class is marked as the implementation of WCF- service). Echo method in addition to returns came in the parameter string back to the client, and displays it in the server console. But the main functionality of the server is contained in a file Program. cs. Let's look at its contents:.
using System;.
using System. Collections. Generic;.
using System. Linq;.
using System. Text;.
using Microsoft. ServiceBus;.
using System. ServiceModel;.
using System. ServiceModel. Description;.
namespace EchoService. Server.
{.
class Program.
{.
static void Main (string [] args).
{.
Console. Title = ' server ';.
Console. Write ('Enter Service Bus namespaces ');.
string serviceNamespaceDomain = Console. ReadLine ();.
Console. Write ('Issuer Name:');.
string issuerName = Console. ReadLine ();.
Console. Write ('Issuer Secret:');.
string issuerSecret = Console. ReadLine ();.
Uri address = ServiceBusEnvironment. CreateServiceUri ('sb', serviceNamespaceDomain, 'EchoService');.
TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior ();.
sharedSecretServiceBusCredential. CredentialType = TransportClientCredentialType. SharedSecret;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerName = issuerName;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerSecret = issuerSecret;.
ServiceHost host = new ServiceHost (typeof (EchoServer), address);.
IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings (DiscoveryType. Public);.
foreach (ServiceEndpoint endpoint in host. Description. Endpoints).
{.
endpoint. Behaviors. Add (sharedSecretServiceBusCredential);.
}.
host. Open ();.
Console. WriteLine (' Location of service:' address);.
Console. WriteLine (' Press [Enter] to exit ');.
Console. ReadLine ();.
host. Close ();.
}.
}.
}.
Let's take a detailed look at what 's going on. So, the first to start the service required input data, namely kridenshaly to access. Service Bus. and the name of namespaces. It is just going in the first lines of the program. It then creates a unique address universal access service ( at the output we get here is the address in this format:. sb:/ /. servicebus. windows. net / EchoService. ). To access the. Service Bus. All clients must be authenticated. In our case, the so-called authentication. SharedSecret. and there is the following code segment:.
TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior ();.
sharedSecretServiceBusCredential. CredentialType = TransportClientCredentialType. SharedSecret;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerName = issuerName;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerSecret = issuerSecret;.
This authentication method is similar to the standard scheme, in which steam is passed username / password ( also supports the following authentication schemes:. Saml. ,. SimpleWebToken. and. Unauthenticated. ). So in the end with the standard tools of the assembly. System. ServiceModel. dll. creates a WCF- host and run our Echo- service ( of course with each access point is set created earlier behavior, ensuring the ability to connect authenticated users only ).
Let's take a look at the source code of the client.
using System;.
using System. Collections. Generic;.
using System. Linq;.
using System. Text;.
using Microsoft. ServiceBus;.
using System. ServiceModel;.
using EchoService. Source;.
namespace EchoService. Client.
{.
class Program.
{.
static void Main (string [] args).
{.
Console. Title = ' Client ';.
Console. Write ('Enter Service Bus namespaces ');.
string serviceNamespaceDomain = Console. ReadLine ();.
Console. Write ('Issuer Name:');.
string issuerName = Console. ReadLine ();.
Console. Write ('Issuer Secret:');.
string issuerSecret = Console. ReadLine ();.
Uri serviceUri = ServiceBusEnvironment. CreateServiceUri ('sb', serviceNamespaceDomain, 'EchoService');.
TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior ();.
sharedSecretServiceBusCredential. CredentialType = TransportClientCredentialType. SharedSecret;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerName = issuerName;.
sharedSecretServiceBusCredential. Credentials. SharedSecret. IssuerSecret = issuerSecret;.
ChannelFactory. channelFactory = new ChannelFactory. ('RelayEndpoint', new EndpointAddress (serviceUri));.
channelFactory. Endpoint. Behaviors. Add (sharedSecretServiceBusCredential);.
IEchoContract channel = channelFactory. CreateChannel ();.
((ICommunicationObject) channel). Open ();.
Console. WriteLine (' Enter text to send to the server:');.
string input = Console. ReadLine ();.
while (! String. IsNullOrEmpty (input)).
{.
try.
{.
Console. WriteLine (' The server responded: {0 }', channel. Echo (input));.
}.
catch (Exception e).
{.
Console. WriteLine (' Error:' e. Message);.
}.
input = Console. ReadLine ();.
}.
((ICommunicationObject) channel). Close ();.
channelFactory. Close ();.
}.
}.
}.
Algorithm to connect to the bus completely identical to that meter in the back end. The differences lie only in the fact that we do not open a new host, and the open channel with the code here:.
ChannelFactory. channelFactory = new ChannelFactory. ('RelayEndpoint', new EndpointAddress (serviceUri));.
channelFactory. Endpoint. Behaviors. Add (sharedSecretServiceBusCredential);.
IEchoContract channel = channelFactory. CreateChannel ();.
((ICommunicationObject) channel). Open ();. All that's left to do is add a couple of lines of code in the configuration files of both projects. At the back end to add the following configuration:.
At the same client sends the following snippet:.
In both cases indicated the main access point and a new service called Binding. netTcpRelayBinding. (this type of bindings in the assembly. Microsoft. ServiceBus. dll. and provides safe and reliable means of communication between computers. Service Bus. ).
Everything is ready, it remains to be done only a small step before starting the system. And it found on the site kridenshaly to access (this is our. Issuer Name. and. Issuer Secret. Required by both the client and server). You can find them in the section. >AppFabric - Service Bus. namespaces in the property under the name. Default Key.
By clicking on the button. View. opens a modal window, which is just and will include data necessary for us.
That's all the preparation can be considered completed. To demonstrate, I 'll show you a couple of screenshots showing the operation of the system.
As you can see the system works fine, but for a service we would not have put a considerable effort, the majority of routine work for us to perform a new WCF- Binding, which is in a namespace. Microsoft. ServiceBus.
In this post you can complete the. The source files of the project can be taken at the following link:. AppFabric Service Bus Echo Service. Very soon we will get acquainted with more progressive and sophisticated variants of Service Bus, but for now thank you for your attention, I hope the publication was useful and interesting:).
Подписаться на:
Комментарии (Atom)



