wcf

A reference to the dll could not be added

做~自己de王妃 提交于 2020-02-08 19:23:34
问题 When I add a .dll file as a reference in C# application it shows an error : A reference to the "....dll" could not be added.Please make sure that the file is accessible and that it is a valid assembly or COM component. ILDissassembler says there is no valid CLR header so I try to register it using regsvr32 and that gives me another error: The module "" was loaded but the call to DLLRegisterServer failed with error code '0x80004005' I am using VS2010 ultimate version on a 64bit Windows 7

WCF技术剖析之十九:深度剖析消息编码(Encoding)实现(上篇)

淺唱寂寞╮ 提交于 2020-02-08 09:33:07
[爱心链接: 拯救一个25岁身患急性白血病的女孩[内有苏州电视台经济频道《天天山海经》为此录制的节目视频(苏州话)] ]消息作为WCF进行通信的唯一媒介,最终需要通过写入传输层进行传递。而对消息进行传输的一个前提或者是一项必不可少的工作是对消息进行相应的编码。WCF提供了一系列可供选择的编码方式,它们分别在互操作和性能各具优势。在本篇文章我们将对各种编码方式进行消息的讨论。 从互操作性的角度来看,编码方法很大程度上决定了跨平台支持的能力。有的编码方式是平台无关的,有的则仅限于某种特定的平台。WCF提供了3种典型的编码方式:Binary、Text和MTOM。Binrary以二进制的方式进行消息的编码,但是仅限于.NET平台之间的通信;Text则提供平台无关的基于文本的编码方式。MTOM编码基于WS-MTOM规范,对于改善大规模二进制数据在SOAP消息的传输性能具有重大的意义,既然该编码方式遵循相应的规范,无疑这也是一种跨平台的编码方式。 在正式介绍WCF消息编码之前,我们很有必要了解如下几个实现编码的核心对象:XmlDictionary、XmlDictionary和XmlDIctionaryWriter。 一、XmlDictionary XmlDictionary,顾名思义,它是一个字典,它是从事编码和解码双方共享的一份“词汇表”。这样的说法可能有点抽象,我们不妨做一个类比。比如我说

WCF技术剖析_学习笔记之一

给你一囗甜甜゛ 提交于 2020-02-08 08:27:40
本系列适合新手,从0学起。共同学习,共同探讨。 基础概念 SOA:就是采用Web服务的架构 它有一些特性,需要了解: 1、自治的:不依赖于访问它的客户端和其他服务,可以独立的进行部署和实施版本策略和安全策略。 2、依赖于开放的标准:让不同的厂商开发的服务能够进行互操作。 3、支持跨平台 4、鼓励创建可组合的服务 5、鼓励服务的复用 6、强调松耦合:契约的实现 WCF应用实例,帮助理解WCF服务的基本结构 过程: 1、构建解决方案 Contracts:定义服务的契约(接口部分) Services:定义服务的实现(具体逻辑实现) Hostiing:宿主 另外还有一个是客户端,位于独立的解决方案中 Client 具体如下图所示: 2、创建服务契约 wcf包含四种契约:服务契约,数据契约,消息契约和错误契约。这里介绍第一种。 服务契约 using System; using System.ServiceModel;//WCF框架的绝大部分实现和API定义在该程序集中 namespace YH.WCFServices.Contracts { /// <summary> /// 定义服务契约 /// </summary> [ServiceContract(Name="CalculatorBervice",Namespace="http://www.aoyou.com/")]/

How to Configuring WCF services to work with both HTTP and HTTPS - multiple bindings not working

回眸只為那壹抹淺笑 提交于 2020-02-08 07:23:27
问题 Iam fairly new to Silver-light and WCF, so please bear with me. I have silver-light application that calls .svc service. The service is being called successfully over https but i would also like to make it work with calls over plain http. What modifications do i need to make to my web.config and ServiceReferences.ClientConfig files below. My complete system.serviceModel section in my Web.config file is this. <system.serviceModel> <bindings> <customBinding> <binding name="MyApp.Web.GetData

What causes WCF Error 404.17 to be shown?

偶尔善良 提交于 2020-02-08 05:31:10
问题 I was getting this error: 404.17 - The requested content appears to be script and will not be served by the static file handler I'm running IIS 8.5 on Windows 8, VS2013. My App pool is set to .NET 4 (I believe the move from .Net 2 to .Net 4 is what caused the problem). My service code is .NET 3.5. I checked that .NET 3.5 and 4.5 are both enabled as features, along with Extensibility for both, ISAPI extensions and filters. I tried: Uninstalling and re-installing ASP.NET 4.5 Running

What could be the reason that my custom REST serializer is not working?

青春壹個敷衍的年華 提交于 2020-02-07 05:27:04
问题 Both methods MyBehavior::CreateSerializer() are not called of some reason, but ReplaceBehavior() method is working. It is changing default behavior with my custom one. Do someone know where could be the problem? The point is to write custom REST WCF serializer that should generate non-XML text format result. public class MySerializerFormatAttribute : Attribute, IOperationBehavior { public void AddBindingParameters(OperationDescription description, BindingParameterCollection parameters) { }

WCF webservice hosted on IIS returns empty xml response

不打扰是莪最后的温柔 提交于 2020-02-07 05:23:04
问题 I have created a rest wcf service that is hosted on IIS window server environment. When I try accessing the service(http://localhost:8081/Service1.svc/EmployeeDump) from IIS it returns blank xml response. It does not give any error, just a blank xml is returned. However, service wsdl(metadata) file is accessible from browser. The service works fine when I run it on Visual Studio and endpoint methods returns data response in xml. But when I host same service in IIS server, it returns blank

Is it possible to persist and then forward WCF messages to destination services?

梦想与她 提交于 2020-02-07 04:10:53
问题 The goal I'm working toward is having a WCF routing service that can receive messages from clients, persist them to some type of data store, and then process/send them to their destination WCF services. Things to consider: You can create a routing service by using the ClientViaBehavior (outlined here and here) The ClientViaBehavior will not work with basicHttpBinding, so I need to use wsHttpBinding (basicHttpBinding doesn't set the "To" header on the message, found out the hard way) The WCF

WCF MessageContract formatting issue

旧巷老猫 提交于 2020-02-06 18:01:37
问题 I have a problem of WCF definition of MessageContact and client calling function. Scenario; Client called the service with a string type reference ID and server responds instance of type of AudioObject. AudioObject consists of Stream as MessageBodyMember and FormatObject as a MessageHeader. Following is WCF code snippet. [ServiceContract] public interface IAudioStreamService { [OperationContract] AudioObject GetAudioDataStream(StringMessage RefID); } //StringMessageContract [MessageContract]

ASP.NET 2.0 Session terminating unexpectedly

徘徊边缘 提交于 2020-02-06 05:47:06
问题 We have an ASP.NET 20 Web Application and all of sudden we start experiencing a weird session timeout which is kicking out the users from the system. The system also invokes WCFs that uses membership authentication and every other invocation we are getting this error: The message could not be processed. This is most likely because the action 'http://tempuri.org/MyWCFService' is incorrect or because the message contains an invalid or expired security context token or because there is a