Questions tagged [servicecontract]

A Service Contract is a contract between a (web) service (such as a WCF service) and a client.

A contract between a (web) service and its client is called a Service Contract. Both the service and its client typically express this contract through an interface, which in WCF is attributed with ServiceContract.

References

86 questions
9
votes
5 answers

WCF contract changes that affect clients

I was curious if someone could outline which types of WCF contract (interface) changes on the server side would break a client trying to send in a message, and why. I believe WCF can handle certain discrepancies, but I'm not sure exactly what you…
Andy White
  • 86,444
  • 48
  • 176
  • 211
9
votes
1 answer

Can I change namespace of WCF ServiceContract interface without changing the service?

Is there a way to change the .NET namespace of a WCF ServiceContract Interface yet still make the WCF service backwards-compatible with clients that are using the old (identical except for namespace) ServiceContract? For example, suppose I have (in…
Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129
9
votes
4 answers

Refactoring God objects in WCF services

We came across a god object in our system. The system consists of public service exposed to our clients, middle office service and back office service. The flow is the following: user registers some transaction in public service, then manager from…
Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75
8
votes
2 answers

WCF class implementing two operation contracts in different service contracts with same name

I have declared two service contracts as follows: [ServiceContract] public interface IContract1 { [OperationContract] double Add(int ip); } [ServiceContract] public interface IContract2 { [OperationContract] double Add(double…
Archie
  • 2,564
  • 8
  • 39
  • 50
8
votes
3 answers

WCF service exposing 2 endpoints on 2 different service contracts

I have an WCF service which I am trying to configure so that it exposes 2 endpoints, refering to different functionalities, under different URLs. What I want to have is Service1, exposing methods A, B, C, and Service2, exposing methods D, E. I want…
Coral Doe
  • 1,925
  • 3
  • 19
  • 36
5
votes
1 answer

Single endpoint with multiple service contracts

How can I write a WCF web service that has single endpoint but multiple service contract? Example: [ServiceContract] public interface IWirelessService { [OperationContract] void AddWireless(); } [ServiceContract] public interface…
svlytns
  • 83
  • 1
  • 8
5
votes
0 answers

could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that

All, i'm getting following error while loading WCF Sevice. The operation 'GetEffort' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other…
Binu Bhasuran
  • 468
  • 1
  • 4
  • 9
4
votes
3 answers

Why do WCF services use interfaces as a Service Contract instead of an abstract class?

This is a question I got asked in an interview. When you create a WCF service, you get two files; "IService.cs" and "Service.cs". Why is it a class implementing an interface versus a class inheriting an abstract class. Don't reply saying that you…
fbhdev
  • 526
  • 7
  • 17
4
votes
1 answer

WCF namespace usage

Ok - straight forward and simple question (2 part) - looking for a simple answer. In a WCF Service contract you can provide a namespace on your contract... Question is this: First - Why (for real...need solid details here) is the http:// model…
dbobrowski
  • 846
  • 2
  • 9
  • 18
3
votes
1 answer

Could not find endpoint element with name ' and contract 'I' in the ServiceModel client configuration section.

I am working on a Base WCF Service- Client WCF service - Consumer Base Wcf servcie model as following: In this model, I have created a Base WCF service and created 1 WCF service i.e; ClientWCFService and 1 ASMX service i.e; ClientASMXservice using…
Rupendra
  • 608
  • 2
  • 11
  • 42
3
votes
2 answers

Can I expose a data member in a WCF ServiceContract?

In a WCF service, is it possible to include a data member inside a ServiceContract definition? Doing something like this: namespace My.Service.Contracts { [ServiceContract] public interface IMyService { [OperationContract] …
Bahaa
  • 1,577
  • 18
  • 31
3
votes
1 answer

Provide ServiceKnownType during runtime?

I've got a working WCF interface using more than 100 ServiceKnownType in the contract like this: [ServiceKnownType(typeof(RowUser))] [ServiceKnownType(typeof(RowRegion))] [ServiceKnownType(typeof(RowDocument))] [... loads more…
Sam
  • 28,421
  • 49
  • 167
  • 247
3
votes
1 answer

how to use MessageParameterAttribute in wcf

I wanted to know what is the use of MessageParameterAttribute in wcf. In my function: [OperationContract] public float GetAirfare( [MessageParameter(Name=”fromCity”)] string originCity, [MessageParameter(Name=”toCity”)] string destinationCity); I…
Archie
  • 2,564
  • 8
  • 39
  • 50
3
votes
1 answer

What is a Service Contract in WCF?

What exactly is a service contract in WCF? I can't seem to be able to find a clear definition of what is it. If you have have a link that defines what it is that would be great.
Jack Thor
  • 1,554
  • 4
  • 24
  • 53
2
votes
1 answer

WCF - how can I define services in a more object-oriented way?

What is the best way to access a remote object model over WCF? I have one system layer (A) with an object-oriented model and want to access this model from another layer (B) The required objects should be loaded by B on-demand. As an example,…
Max
  • 153
  • 9
1
2 3 4 5 6