今天写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. js闭包使用

    闭包就是在一个函数内定义一个内部函数 并返回内部函数 function f1(){ var a=1; add=function(){a=a+1;} function f1Sub(){ console. ...

  2. new(C# 参考)

    在 C# 中,new 关键字可用作运算符.修饰符或约束. new 运算符 用于创建对象和调用构造函数. new 修饰符 用于隐藏基类中被继承的成员. new 约束 用于在泛型声明中约束可能用作类型参数 ...

  3. HTML超标记语言

     Html超文本标记语言,负责描绘Web世界的骨架. 〇.工具 http;//www.w3cchool.com.cn 一.Tim Bemers Lee 万维网之父: Html设计者: W3C创始人: ...

  4. null 和 NULL 判断

    遇到问题,服务器传回 null,我擦嘞,接收不了. 解决如下: NULL 直接 判断就好,能在 xcode 上直接敲出 null 的话  可以  ==[NSNull class] 或者[respons ...

  5. Spring Boot项目的打包和部署

    补充一点:搜索了下别人Spring Boot部署方案,大多都说:①packaging设为war:②要添加Spring Boot的tomcat依赖:③修改output路径,但是使用STS新建Spring ...

  6. SDN三种模型解析

    数十年前,计算机科学家兼网络作家Andrew S. Tanenbaum讽刺标准过多难以选择,当然现在也是如此,比如软件定义网络模型的数量也很多.但是在考虑部署软件定义网络(SDN)或者试点之前,首先需 ...

  7. 数据库(SQL SERVER)常用知识点

    1,连接数据库字符串 Data Source=192.168.1.249;Initial Catalog=bbx_uf_jiekou;User ID=sa;Password=123 Data Sour ...

  8. ios6 滤镜相关知识内容网址

    http://blog.csdn.net/justinjing0612/article/details/8145607#

  9. 通过挂载系统光盘搭建本地yum仓库

    1,配置本地yum源: 把系统光盘挂载到文件夹aaa(aaa为自己创建的文件夹). [root@localhost /]# mount dev/cdrom /aaa 2,修改yum配置文件: yum的 ...

  10. I2C VHDL程序

    http://blog.sina.com.cn/s/blog_9bd80b7601012o9y.html library ieee ; use ieee.std_logic_1164.all ; us ...