11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

amrameshreddy.blog.comMicrosoft Web Service ExtensionsDuring the evolution of web services, Microsoft provided an add-on framework to the core.NET runtime (both 1.1 and 2.0) in support of the evolving web service standards. With .NET1.1 Microsoft released version 1.0 and 2.0 of Web Services Enhancements (WSE). With therelease of .NET 2.0, Microsoft updated WSE to version 3.0.WSE 2.0 offered no direct validation of producing services that were guaranteed to beBasic Profile compliant. Because ASP.NET 3.0 added the WebServiceBinding attribute toprovide validation of conformance to Basic Profile 1.1, WSE 3.0 inherited that capability.Additionally, the Microsoft Patterns and Practices team published a reference application10 demonstrating how to build services that conform to WS-I Basic Profile along with animplementation guidance document. 11Windows Communication Foundation Basic Profile SupportWCF enables WS-I Basic Profile 1.1 through the BasicHttpBinding class. So, with WCF, writingbase-level interoperable services that confirm to WS-I Basic Profile is as easy as leveraging theBasicHttpBinding class through code, as shown in Listing 13-2.Listing 13-2. Applying Basic Profile in CodeUri baseAddress = new Uri( "http://localhost:8080/MyService" );//Instantiate new ServiceHostmyServiceHost = new ServiceHost( typeof( MyService ), baseAddress );//the following for programmatic addition of Basic Profile 1.1BasicHttpBinding binding = new BasicHttpBinding();myServiceHost.AddServiceEndpoint(typeof( IMyInterface,binding,baseAddress);In Listing 13-2, we just add the BasicHttpBinding instance to the ServiceHost instance’sendpoints. Again, the power of WCF is that you can also enable the same capability for BasicProfile 1.1 support declaratively through configuration, as shown in Listing 13-3.Listing 13-3. Applying Basic Profile Through Configuration

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!