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 IMyService, 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 IMyServiceV1 that contains an operation named DoSomethingElse. You need to ensure that existing client applications are still able to access the

IMyService.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 IMyService, 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 IMyServiceV1 that contains an operation named DoSomethingElse. You need to ensure that existing client applications are still able to access the

IMyService.DoSomething
method without modifying client code.

Which code segment should you use?

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

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

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

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



Leave a Reply 1

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


williercain

williercain

It’s a good post.