servicecontract

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

老子叫甜甜 提交于 2019-12-23 03:34:26
问题 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 Studio by following this guide. https://msdn.microsoft.com/en-us/library/ff649818.aspx This worked wonderful if you add a reference to the WCF Service Library project from your client (Windows Forms project). And add a using statement to the

generate wcf server code from wsdl files

吃可爱长大的小学妹 提交于 2019-12-20 04:49:38
问题 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: <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05

Single endpoint with multiple service contracts

◇◆丶佛笑我妖孽 提交于 2019-12-19 07:48:13
问题 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 IWiredService { [OperationContract] void AddWired(); } [ServiceContract] public interface IInternetService { [OperationContract] void AddInternet(); } Lets think like IInternetService is my main webs service and i want to implement IwiredService and IWirelessService

how to apply OperationContract to all methods in interface

∥☆過路亽.° 提交于 2019-12-12 17:22:40
问题 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 is an OperationContract " ? thank you 回答1: Yes, you can use AOP framework for that. E.g. with PostSharp: [Serializable] public sealed class AutoServiceContractAttribute : TypeLevelAspect, IAspectProvider { // This method is called at build time and

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

这一生的挚爱 提交于 2019-12-11 12:14:18
问题 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 the BaseWCFServiceProxy.cs the Proxy class of Base WCF Service using SVCUtil.exe. The ClientWCFService and ClientASMXservice are working fine in StandAlone environment. Now, I created a Consumer Console Application using the same proxy class

Generic ServiceContract

人走茶凉 提交于 2019-12-11 07:24:40
问题 [ServiceContract] public interface ISecurities<T> : IPolicyProvider where T: EntityObject { [OperationContract(Name="GetAllSecurities")] IEnumerable<T> GetSecurities(); [OperationContract] IEnumerable<T> GetSecurities<T1>(List<T1> lstIdentifiers) where T1 : FI_CusipMaster; [OperationContract] T GetSecurity<T1>(T1 lstIdentifiers) where T1 : FI_CusipMaster; } //Host ///CADIS Contract ServiceHost dmHost = new System.ServiceModel.ServiceHost(typeof(GlobalInvestors.FIPA.BLL.UDI.CADISSecurities));

WCF service exposing 2 endpoints on 2 different service contracts

99封情书 提交于 2019-12-09 18:10:21
问题 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 to be able to browse both localhost/WebServiceName/Service1/Service.svc and localhost/WebServiceName/Service2/Service.svc . Other applications referencing localhost/WebServiceName/Service1/Service.svc should see only the interface containing the

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

流过昼夜 提交于 2019-12-09 16:00:57
问题 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 ip); } I have a class which implements these two contracts. I have created two endpoints for both contracts. But I'm not able to access the service from client code. It displays a big error when I try to update the service reference as: Metadata contains an error that

What is the format of the DataContractAttribute.Namespace Property?

依然范特西╮ 提交于 2019-12-08 09:33:15
问题 This MSDN article recommends always to provide a namespace to a ServiceContract and DataContract. Examples usually have a "schema" prefix and a URI type pattern for the namespace such as Namespace="urn:WCFEssentials/Samples/2008/12" instead of a traditional C# namespace with dot-notation such as Namespace="MyNamespace.MyDataClasses" What is the suggested format the namespace property? Do we need the schema prefix? Why is this format suggested? 回答1: It's an XML Namespace. Those can either be

Wcf service inheritance (Extend a service)

拥有回忆 提交于 2019-12-08 01:14:45
问题 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 containing only the services and one class containing the services and the callbacks. For example : [ServiceContract] [ServiceBehavior(InstanceContextMode=InstanceContextMode::Single, ConcurrencyMode=ConcurrencyMode::Multiple)] public ServiceClass {