今天写WCf 时遇到如下报错:

调试过程发现,各个过程都无异常,但是返回给调用端数据时出现如下错误。

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.

最后检查,导致此错误的原因是
[DataContract]
    public class Student
    {
        [DataMember]
        public int PersonId { get; }
        [DataMember]
        public string Name { get; set; }
        
    }
    
    改成如下就好了:
    [DataContract]
    public class Student
    {
        [DataMember]
        public int PersonId { get;private set; }
        [DataMember]
        public string Name { get; set; }
        
    }
    
   wcf 服务序列化只读属性会出现问题,导致Failed to invoke the service.

WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible的更多相关文章

  1. com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findUserByUserNo in the service wusc.edu.facade.user.service.PmsUserFacade.

    017-04-25 10:55:30,505 INFO [AbstractRegistry.java:302] : [DUBBO] Register: consumer://192.168.1.101 ...

  2. 关于dubbo调度时出现Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method insertTestTb in the service cn.cuibusi.core.service.TestTbService.的解决办法

    在用dubbo跨项目调度service时出现如下错误: 错误原因:pojo没有实现序列化 解决方法:在pojo实现序列化接口即可

  3. com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method

    查看了网友们的错误原因, 需要进行实例化的类没有进行实例化,具体没有实例化的类会在错误信息中显示,在错误信息中搜索“Serializable”即可找到将其实现序列化可消除错误. 是在使用Dubbo提供 ...

  4. [TODO]com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method

    异常信息如下: 2018-10-30 20:00:50.230 ERROR java.util.concurrent.ExecutionException: com.alibaba.dubbo.rpc ...

  5. bubbo调用Failed to invoke remote method异常解决

    bubbo调用服务异常: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getPlanFlowInfo, pr ...

  6. com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method解决方法

    报错日记: Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getUserAuthLeve ...

  7. Docker: Failed to get D-Bus connection: No connection to service

    Issue: When you execute systemctl command in docker container, you may receive following error. Erro ...

  8. dubbo+zookeeper报错:com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method

    com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method可能的错误原因有三个前两个是从网上摘得, 第三个是自己解决的 1.需要进行 ...

  9. Initialization failed for Block pool <registering> (Datanode Uuid unassigned) service to IP1:8020 Invalid volume failure config value: 1

    2017-02-27 16:19:44,739 ERROR datanode.DataNode: Initialization failed for Block pool <registerin ...

随机推荐

  1. Java-计划存储

    Hive:Hive文档 Hdfs官方 Spark官方 About云中文论坛 书单:2015豆瓣书单 豆瓣千人8.0+书单 编程入口:Eclipse servlet java8 快捷键整理  MyBat ...

  2. linux下查看cpu物理个数、核数、逻辑cpu数

    一.首先要明确物理cpu个数.核数.逻辑cpu数的概念 1.物理cpu数:主板上实际插入的cpu数量,可以数不重复的 physical id 有几个(physical id) 2.cpu核数:单块CP ...

  3. MacDev.Mach-O.Programming-Part-III:MachOView-v2.4.9200.dmg-crash

    MachOView-v2.4.9200.dmg Crash 在OS X(其版本号: 10.11.6 (15G31))下载MachOView-2.4.9200.dmg后,打开Fat Binary后,Ma ...

  4. 金蝶 K/3 Cloud 服务端控件编程模型

    如下图是服务端已有的控件编程模型

  5. 【windows 下安装 mysql-server 无法登录问题解决】

    ----------------------------- 无感的首行 ----------------------------- 新版 mysql-server 5.7 安装后发现无法使用 mysq ...

  6. city-picker 选择省市县的一个控件,好用。

    我觉得好奇怪,这么好一个插件,为什么没有设置值的方法,还是我才疏学浅?? 我看有的人做法是把,把源代码里面的自动扫描机制注释掉 // $(function () { // $('[data-toggl ...

  7. IE WebBrowser事件触发

    <= IE6: IE6 下如果iframe很多,子框架的BeforeNavigate2,DownloadBegin,DownloadComplete,DocumentComplete可能交替出现 ...

  8. 按Enter键触发事件

    1.document.onkeydown=function(e){        var keycode=document.all?event.keyCode:e.which;        if(k ...

  9. ubuntu 终端设置(颜色与长路径)

    Linux给人最大的享受就是可以根据个人喜好去定制令自己舒服的系统配置,像终端颜色的设置就是一个典型的例子. 图1 系统默认状态下的终端显示     在没有经过自定义配置的终端下工作久了,难免容易疲劳 ...

  10. 易学PHP——WAMP环境搭建

    安装前的准备 查看本机的类型(x86/x64,即 32 位还是 64 位) 安装好 VC9/VC11/VC14 运行库(需要按照本机的类型选择安装) 创建好一个安装路径用于安装整套 amp 环境(我使 ...