Which code segment should you use?

You have created a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The existing service interface is named MyService, and contains the following code segment.

[ServiceContract(Name="SvcOrder", Namespace="http://contoso.com/services")]
public interface IMyService
{
[OperationContract]
void DoSomething();
}

You create a new service named MyServiceV1 that contains an operation named DoSomethingElse.
You need to ensure that existing client applications are still able to access the MyService.DoSomething method without Modifying client code.
Which code segment should you use?

You have created a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The existing service interface is named MyService, and contains the following code segment.

[ServiceContract(Name="SvcOrder", Namespace="http://contoso.com/services")]
public interface IMyService
{
[OperationContract]
void DoSomething();
}

You create a new service named MyServiceV1 that contains an operation named DoSomethingElse.
You need to ensure that existing client applications are still able to access the MyService.DoSomething method without Modifying client code.
Which code segment should you use?

A.
[ServiceContract(Namespace="http://contoso.com/services/V1")]
public interface IMyServiceV1 : MyService
{
[OperationContract]
void DoSomethingElse();
}

B.
[ServiceContract(Name="SvcOrder")]public interface IMyServiceV1 : MyService
{
[OperationContract]
void DoSomethingElse();
}

C.
[ServiceContract(Name="SvcOrderV1 Namespace="http://contoso.com/services")]
public interface IMyServiceV1 : MyService
{
[OperationContract]
void DoSomethingElse();
}

D.
[ServiceContract(Name="SvcOrder", Namespace="http://contoso.com/services")]
public interface IMyServiceV1 : MyService
{
[OperationContract]
void DoSomethingElse();
}



Leave a Reply 0

Your email address will not be published. Required fields are marked *