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
0
votes
1 answer

class implemeting service contracts base class for another class WCF

I have a class implementing a service contract. Another class being derived from this class and in turn implements another service contract Class A: a.IA { } Class B: A, b.IB { } How do I expose the endpoints for contract IB? The endpoints I…
genericuser
  • 1,430
  • 4
  • 22
  • 40
0
votes
2 answers

What is the meaning of [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] in the official WCF tutorial?

I'm trying to follow the official basic tutorial on WCF: https://learn.microsoft.com/en-us/dotnet/framework/wcf/getting-started-tutorial At one point, when defining the service contract, the tutorial asks us to type the following code: using…
user4385532
0
votes
3 answers

construct soap request from wsdl and service contract with jquery

I am trying to get data from a wcf web service using jQuery. My jQuery code is as follows: jQuery.ajax({ type: "POST", url: serviceWebPath, data: data, …
Tom Macdonald
  • 6,433
  • 7
  • 39
  • 59
0
votes
0 answers

How to fix/diagnose "The remote server returned an error: (400) Bad Request." for a query working on site A but not on site B

I have a singleton C# service that exposes it's API via a service contract. A specific function runs fine in the development environment I have setup, but I get an error 400 from this service on a specific query (the other queries work just fine,…
0
votes
0 answers

WCF pass integer array through object parameter

I am trying to send an int array over a WCF connection using a method call that takes an object. But i am receiving this error 'System.ServiceModel.CommunicationException' in mscorlib.dll ("There was an error while trying to serialize parameter…
Newguy75
  • 3
  • 4
0
votes
1 answer

WCF service contract and data contract

I have following code [ServiceContract(Namespace = "http://www.myweb.com/prod")] public interface IBaseService { [OperationContract] public string GetName(IDMessageContract ID) } [ServiceContract(Namespace =…
meetjaydeep
  • 1,752
  • 4
  • 25
  • 39
0
votes
2 answers

Service contract design (operations signature)

I'm designing some services and I would like to get some feedback about the conventions I'm using. For all operations, I always define a 'Context' object and a 'Result' one, because of the following advantages: extensibility: I can add parameters…
fra
  • 3,488
  • 5
  • 38
  • 61
0
votes
1 answer

Rest service returns “method not allowed” on webpage

I'm trying to pass object parameter as JSON format to WCF restful service. service contract code like this; [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate…
0
votes
1 answer

how to add a parameter to soap body in wcf

Our clients want to use the following soap message to call my WCF Service: str ex func str
Fer
  • 1,962
  • 7
  • 29
  • 58
0
votes
1 answer

assembly: ContractNamespace() , this option is not available in AssemblyInfo.cs file?

I tried adding an assembly level contract namespace so that both the contracts one at service and one at client level are part of one namespace. In the AssemlbyInfo.cs file , [assembly: ContractNamespace()] option is not available. .Net framework …
SunilA
  • 513
  • 8
  • 19
0
votes
2 answers

Calling a content page's javascript from a master pages javascript

I am working on a web app that can display data in two drastically different formats. To do this, I am using a master page with two different content pages for the differing views. I am using .svc files to do AJAX style server requests. I would…
unbootabru
  • 347
  • 1
  • 3
  • 9
0
votes
1 answer

WCF. Create generic Servicecontract. Fill from client

Maybe it is duplicate, but I couldn't succeed to find needed answer. Actually I am trying to build generic wrapper in order to work with Entity/L2Sql via wcf. So on the server side: [ServiceBehavior(InstanceContextMode =…
Roma Borodov
  • 596
  • 4
  • 10
0
votes
0 answers

C# ServiceBehavior custom json serialization

When deserializing a request I get a non-null but empty dictionary. Object I want to post: public class Data { public IDictionary Dictionary { get; set; } } Here is the body I send with my…
Mizipzor
  • 51,151
  • 22
  • 97
  • 138
0
votes
1 answer

Can I find out what WCF methods are supported on the endpoint before calling it?

I have a versioning issue with a WCF service contract in which one of the many endpoints which are called for the operation is missing one method from the contract. My question is, how can I make sure the command is available on the client before…
devlord
  • 4,054
  • 4
  • 37
  • 55
0
votes
2 answers

WCF class implementing multiple service contracts

I have a class TestService which implements two service contracts called IService1 and IService2. But I'm facing a difficulty in implementation. My code looks as follows: Uri baseAddress = new Uri("http://localhost:8000/ServiceModel/Service"); Uri…
Archie
  • 2,564
  • 8
  • 39
  • 50