今天写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. My安卓知识5--百度地图api的使用,周边信息检索

    虽然查了很多资料,但是这个问题还是解决不了,不知道为什么检索城市内的相关信息能用,检索周边信息语句就是用不了.代码如下,第一段是检索保定市内的加油站,第二段是检索周边的加油站.centerToMyLo ...

  2. xcode8 上传ipa文件无法构建版本

    在xcode8 升级后上传ipa文件 需要设置一个安全提示,现在上传app store的方式为xcode或者 application loader 一.xcode 准备工作完成后点击Product-- ...

  3. sublime配置react

    http://www.cnblogs.com/terrylin/p/4942332.html

  4. ArrayList与LinkedList用法与区别

    1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构.  2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedLis ...

  5. C# Form.Close 的释放问题

    今天使用From窗口Close后,发现From的资源还存在,并没有释放资源,只有在程序关闭的时候才去释放. Form1:button按钮 private void button1_Click(obje ...

  6. .net 发展史

    2002年年初 -Visual Studio 2002 & .Net Framework 1.0 2003年春天 -Visual Studio 2003 & .Net Framewor ...

  7. Android Service完全解析,关于服务你所需知道的一切(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/11952435 相信大多数朋友对Service这个名词都不会陌生,没错,一个老练的A ...

  8. vim的批量注释与删除注释

    vim的批量注释与删除注释 方法一:块选择模式 批量注释: Ctrl + v 进入块选择模式,然后移动光标选中你要注释的行,再按大写的I进入行首插入模式输入注释符号如 // 或 #,输入完毕之后,Vi ...

  9. 从MyEclipse转战到IntelliJ IDEA的经历

    从MyEclipse转战到IntelliJ IDEA的经历 我一个朋友写了一篇"从Eclipse到Android Studio"博文,于是心潮澎湃我也想一篇,分享自己用这个IDEA ...

  10. STM32移植RT-Thread的串口只能接收一个字节数据的问题

    打开设备的函数参数要与注册设备函数参数要一致, 注册设备的函数及其参数如下: /* register UART1 device */ rt_hw_serial_register(&serial ...