Questions tagged [operationcontract]

70 questions
3
votes
6 answers

WCF MessageContract Inheritance

I am fairly new to WCF and just have a question on how to correctly get MessageContract inheritance working. A simplified version of my setup is as follows - a "base" message type, and then another "test" message which inherits from…
Frank Bell
  • 139
  • 1
  • 7
3
votes
2 answers

WCF Post with Query String

I am currently developing a Windows Service hosted WCF service. One of the methods has a URI which is set up to receive a callback from a payment provider. This is the interface contract... [OperationContract] [WebInvoke(UriTemplate =…
David Muir
  • 139
  • 2
  • 6
2
votes
1 answer

WCF service with 4 input parms and 3 out parms gets reordered by Add Service Reference in Proxy Class Project

I've looked in SO and elsewhere and seen questions posed about this along with some answers that still make no sense to me in my case. I'm refactoring my working VStudio 2010 solution which has: one project with an ASMX webservice another separate…
John Adams
  • 4,773
  • 25
  • 91
  • 131
2
votes
1 answer

Can I call multiple operation contracts when ConcurrencyMode is Single

I have a WCF service with 3 operation contracts. I set [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single)] for this service. My basic doubt is can I able to call all the 3 service at a time or only one contracts can be called at once. Please…
Maddy
  • 164
  • 2
  • 13
2
votes
2 answers

WCF Generics - Why do DataContract and CollectionDataContract allow formatted naming, but not DataMember, OperationContract or ServiceContract?

Basically as the title says: [DataContract(Name = "{0}Item")] //This will format properly public class GenericItem { [DataMember(Name = "The{0}")] //This will NOT format properly public T TheItem { get; set;…
myermian
  • 31,823
  • 24
  • 123
  • 215
2
votes
3 answers

Use parameter "params string[]" in WCF Rest endpoint

I would like to define an OperationContract, which I can pass any number of string parameters. The values should be interpreted as an array of string. Is there any possibility to use this type of parameter in an OperationContract and define this in…
rbr94
  • 2,227
  • 3
  • 23
  • 39
2
votes
1 answer

Does WCF UserNamePasswordValidator require checking PrimaryIdentity.IsAuthenticated?

Currently I have a service that uses a UserNamePasswordValidator to authenticate the client user. The code for the validation goes as follows: public override void Validate(String userName, String password) { if (userName == null) ||…
Jesse
  • 8,605
  • 7
  • 47
  • 57
2
votes
3 answers

How to create generic WCF OperationContract to retrieve data from a SQL table

I've been given the task of creating a .net interface for a table that will be retrieved a database. One of the obvious things that the interface must do is retrieve data from the table. So.... I could write a function that simply does Select * from…
Vivian River
  • 31,198
  • 62
  • 198
  • 313
2
votes
1 answer

Update Service Reference does not work when the [OperationContract] method have colletion as argument

I have a very strange problem which I do not understand. I have my WCF interface which methods are decorated with the [OperationContract] attribute. Then I have my Service Reference folder which I update every time I change my interface. Everything…
user2323704
  • 853
  • 1
  • 7
  • 13
2
votes
3 answers

how to apply OperationContract to all methods in interface

Im creating a service contract in my wcf application and it contains a lot of methods. I find it very annoying to write an OperationContract attribute to all of them. Is there any simple way how to say "every method in my ServiceContract interface…
John Smith
  • 1,783
  • 6
  • 22
  • 36
2
votes
2 answers

Provide whole library's functionality via WCF

I want to build a WCF Service application, which is supposed to use a library of mine in order to make all the library's methods available for the service's client. There must be a better way than explicitly writing an OperationContract for each…
wodzu
  • 3,004
  • 3
  • 25
  • 41
2
votes
2 answers

How To Use Interface as DataContract in WCF

I need invoke webservice operations using standard wsdl, but data objects must be different in client and in the server. Using interfaces for data objects in a common library, making proxy classes for it in client and in server. Then, I'm declaring…
thr0w
  • 1,454
  • 3
  • 10
  • 7
2
votes
1 answer

In WCF can I have a wildcard character in a literal segment of my UriTemplate?

I am authoring a RESTful WCF service using .Net 4.0. I want the following two URLS: /root/document/{ids}?fields={fields} /root/externaldocument/{ids}?fields={fields} to map to the same interface member: Documents GetDocuments(string ids, string…
Joe Alfano
  • 10,149
  • 6
  • 29
  • 40
2
votes
1 answer

WCF Service Implementation

I've scoured the internet, several books, and even consulted some peers. Nothing really states if what I'm attempting to do is bad practice or not. The short; is I'm just doing a fire-and-forget from the client. [ServiceContract] public interface…
Greg
  • 11,302
  • 2
  • 48
  • 79
2
votes
1 answer

Strange issue with wcf service

I have this strange problem. I wrote a wcf service and added a service reference to other project so that I can use it. Usage in a project with a reference to this service looks like this: private DataAccessServiceReference.DataAccessServiceClient…
Jarek Mazur
  • 2,052
  • 1
  • 25
  • 41