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
2
votes
2 answers

Constructor Logic In Service Contract

I have a service contract: [DataContract] public class Something { [DataMember] public MyEnum SomeEnumMember {get;set;} } Some of our devs are doing this sort of thing: public Something() { SomeEnumMember = MyEnum.SecondEnumValue; } I…
Dave Ziegler
  • 1,737
  • 3
  • 19
  • 36
2
votes
1 answer

Wcf service inheritance (Extend a service)

The program I am working on exposes both callbacks and services using wcf. Basically, what the services do is simply return some variables value. As for the callback, they simply update those variables. I want to be able to expose one class…
Sim
  • 265
  • 1
  • 4
  • 14
1
vote
1 answer

WCF Exception when returning list of interface objects

I am getting the following exception when I call the WCF Service from ASP.NET website. How can we overcome it? Note: By applying break point in service project, I have verified that the service is returning two valid objects. Note: In service, I am…
LCJ
  • 22,196
  • 67
  • 260
  • 418
1
vote
2 answers

How to generate all datacontract class

I have build chat service with WCF. I have class that marked as datacontract attribute [DataContract] public class Message { string _sender; string _content; DateTime _time; [DataMember(IsRequired=true)] public string…
Hensembryan
  • 1,067
  • 3
  • 14
  • 31
1
vote
2 answers

System.Exception.Data will not serialise on DataContract?

I have some WCF services using dataContracts and i wanted to I was hoping to pass a Exception with custom Dictionary< string , object > data in the Data property, but when i add any data on this array before throwing i get the following error in the…
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
vote
2 answers

WCF - Generalizing Action String

I have to take some pre-defined WSDL's (I do not control these), and expose them on our device to reply to various SOAP/UPnP requests. Anyway, I have all of this working, but the problem comes through because I have one service that could be…
ifdef_debug
  • 11
  • 1
  • 2
1
vote
1 answer

Multiple endpoint with multiple contracts in WCF

Hi I have 2 service contracts IService1 and IService2 I want different endpoints for each service contract also I want to use only basichttpbinding. Suppose IService1 address is http://localhost:4040/MyApp/Service1.svc then I want to access…
meetjaydeep
  • 1,752
  • 4
  • 25
  • 39
1
vote
2 answers

WCF service only receiving 65536 String.Length size only, not more than that

I have created a WCF service which receives String (Text/Json) as a request, but the problem is it is only able to receive String length of 65536 (String.Length). I have tried below (binding maxReceivedMessageSize="2147483647") by googling but there…
NDestiny
  • 1,133
  • 1
  • 12
  • 28
1
vote
1 answer

WCF service with protocol buffer, how the config file will look like

I worked on WCF before. But I am very new in protocol buffers. I went through its advantages and how to use it. Basically i want to plug in the protocol buffers into my existing 'WCF library'. So what changes should i make in my existing…
Lina
  • 163
  • 13
1
vote
1 answer

Consume WCF service from client without WCF Service Library project/assembly reference

The following question may be a duplicate, but there wasn't enough information to answer my question from it. Is possible to access WCF Service without adding Service Reference? I've setup a TCP service, using a WCF Service Library project in Visual…
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245
1
vote
3 answers

Generic ServiceContract

[ServiceContract] public interface ISecurities : IPolicyProvider where T: EntityObject { [OperationContract(Name="GetAllSecurities")] IEnumerable GetSecurities(); [OperationContract] IEnumerable GetSecurities(List
Bhaskar
  • 127
  • 1
  • 18
1
vote
1 answer

generate wcf server code from wsdl files

Greetings, I would like to generate some contract based on wsdl file. I used svcutil but I suspect it generated it wrong as all contract methods have void returned type. Is there any tool for this purpose? EDIT: here is the wsdl file: …
niao
  • 4,972
  • 19
  • 66
  • 114
1
vote
1 answer

Is changing a parameter in a OperationContract to it's Nullable equivalent considered a breaking change?

Consider the following ServiceContract-Interface: [ServiceContract] public interface ITest { [OperationContract] void MyMethod(int a, int b); } Now we change it to the following (effectively changing parameter int a to a int?…
Shion
  • 1,499
  • 2
  • 14
  • 29
1
vote
1 answer

Incorrect generating of service reference

I have class Request derived from Dictionary. It has additional fields. Then I have Service Contract: string MakeRequest(Request request); After that I generate Service Reference for this contract. But VS by some reason generates…
Alexei Malashkevich
  • 1,575
  • 1
  • 17
  • 34
1
vote
1 answer

WCF ServiceContract and svcutil issue

I have a public interface auto-generated bu svcutil: [System.ServiceModel.ServiceContractAttribute(Namespace="...", ConfigurationName="...")] public interface MyInterface Then I have asmx web service inheriting it and working fine. I am trying ot…
Valko
  • 340
  • 2
  • 10