Showing posts with label WCF secure service. Show all posts
Showing posts with label WCF secure service. Show all posts

Wednesday, 29 April 2015

How to pass Microsoft Developing Microsoft Azure and Web Services 70-487 exam

Hi All,
I've recently certified Microsoft Azure with WCF Certification 70-487,
I've notice that Microsoft has changed From 30 April 2014, the questions on this exam include content covering Visual Studio 2013 and updates to Microsoft Azure.

I've have few good tips for exam, which I'm sharing with this blogs,

  • If you are afraid 70-487 exam, then do not need to hasitate, It's pretty easy exam you need to make sure with latest dump.
  1.  Microsoft has divided this exam into two section.
  •  Case  Study
  • General Question
    In my case almost 26 Case study Question and 33 general Question

1) General Question
2) Case Study
3) LAURA Third party Dump -2013 September
4) Sure Pass Dump

Above Link will navigate you to download.

Few of the website which was usually referred by me.

Let me know in case if you needed any further help.

Thanks,
Gauttam
     
 

Sunday, 24 August 2014

creating a simple WCF secure service

This article discusses the simplest way to write, configure and consume Windows Communication Foundation (WCF) service, using Visual Studio 2010.

Problem Statement

Assume that
ZYZ Inc is one of the leading mobile menufacturing companies in India. Currently ABC Inc uses an XML based web service that provides the details of the various mobile models available for sale. The management of the ZYZ Inc wants their Web service to accommodate features such as reliable messaging, transactions, security and this web service should be accessible from any application of all platforms.

The developers of ZYZ Inc know that they can fullfill all the above requirements by developing the service in WCF.

Prerequisite: Create tblProduct in SqlServer for this Demo.

image1.gif

Solution

Task 1: Creating a WCF Service
To create a WCF service you need to perform the following tasks:

  1. Open Microsoft Visual Studio.
  2. Select "File" - "New" - "Website". A dialog box appears, as shown in the following figure.

    image2.gif
  3. Select the WCF Service template under the Visual Studio installed templates section.
  4. Click on the "OK" Button. The "App_Code/Service.cs" file appears, as shown in the following figure.

    image3.gif
  5. Add the following namespaces to the "App_Code/Service.cs" file:
    using System.Data;using System.Data.SqlClient;
     
  6. Remove the following code snippet from the Service class:
    public string GetData(int value)
    {
        return string.Format("You entered: {0}", value);}
    public CompositeType GetDataUsingDataContract(CompositeType composite)
    {
        if (composite == null)
        {
            throw new ArgumentNullException("composite");
        }
        if (composite.BoolValue)
        {
            composite.StringValue +=
    "Suffix";
        }
        return composite;}
     
  7. Open "App_Code/Iservice.cs" and remove the following highlighted code from the interface:
    [ServiceContract]public interface IService{
        [OperationContract]
       
    string GetData(int value);
        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);
       
    // TODO: Add your service operations here// Use a data contract as illustrated in the sample below to add composite types to service operations.[DataContract]public class CompositeType{
       
    bool boolValue = true;
       
    string stringValue = "Hello ";
        [DataMember]
       
    public bool BoolValue
        {
           
    get { return boolValue; }
           
    set { boolValue = value; }
        }
        [DataMember]
       
    public string StringValue
        {
           
    get { return stringValue; }
           
    set { stringValue = value; }
        }
    }
     
  8. Add the following namespace in the "App_Code/Iservice.cs" interface:
    using System.Data;
     
  9. Type the following code snippet for the "Iservice" interface as shown in the following figure.

    image4.gif
  10. Type the following code for the "Service.cs" file as shown in the following figure.

    image5.gif
  11. Verifying WCF Service.

    Press F5 to run your service; you will get a browser window as shown in the following figure.

    image6.gif
Task 2: Creating ASP.Net Client Application
  1. Open Visual Studio then click on "File" - "New" - "Web Site" - "ASP.Net website".
  2. Drag and drop a TextBox, Button and GrideView as shown in the following figure.

    image7.gif
  3. Switch to the Solution Explorer. Right-click on the root directory (the solution) and click on "Add Service Reference". Provide the WSDL file link in the Address TextBox, as shown in the following figure.

    image8.gif
  4. Click the "Ok" Button
  5. For the Click event of the Show Button write the following code:
    int Id = Convert.ToInt32(TextBox1.Text);
    ServiceReference1.
    ServiceClient proxy = new ServiceReference1.ServiceClient();
    GridView1.DataSource = proxy.QueryProduct(Id).Tables[0];
    GridView1.DataBind();
     
  6. Press F5 to run your ASP.Net application. Enter a product id in the TextBox and click on the Show Button. If everything goes well you will get the following output as shown in the following figure.

    imagenew9.gif