WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible

今天写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.

时间: 2024-08-27 11:15:37

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

关于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实现序列化接口即可

dubbo异常: Failed to invoke the method getXXXX in the service 异常解决方案

解决方案: 1.将dubbo.registry.address修改为正确地址 2.遇到该异常可能还有其他情况: 实体类没有实现java.io.Serializable,因为是远程服务,所有必须实现序列化接口 暂时就是这么些,欢迎大家补充! 原文地址:https://www.cnblogs.com/vycz/p/12078716.html

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

查看了网友们的错误原因, 需要进行实例化的类没有进行实例化,具体没有实例化的类会在错误信息中显示,在错误信息中搜索"Serializable"即可找到将其实现序列化可消除错误. 是在使用Dubbo提供服务是在主机上启动了虚拟机的网络,在Windows中具体可以,在运行中输入"CMD"在CMD窗口中输入"ifconfig"命令查看,如果有其他除本地的网络链接,通过命令或者将其手动禁止,再启动Dubbo服务可以解决问题. 防火墙对应端口没有开启 我这

添加@ControllerAdvice后报错 Failed to invoke @ExceptionHandler method

首先.单独使用ControllerAdvice 无法正常工作.需要配合@EnableWebMvc 使用. @ControllerAdvice @EnableWebMvc pulbic class ExceptionControllerAdvice{ @ExceptionHandler(NotFoundException.class) @ResponseBody public Map<String,Object> notFoundExc(NotFoundException exc,HttpSer

Initialization failed for Block pool &lt;registering&gt; (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 <registering> (Datanode Uuid unassigned) service to IP1:8020 Invalid volume failure  config value: 12017-02-27 16:19:44,740 FATAL datanode.DataNode: Initialization

svcs (service status) 和 svcadm (service administration) 使用

1. svcs  显示服务实例的状态信息 svcs - report service status  显示服务状态命令 DESCRIPTION The svcs command displays information about service instances as recorded in the service configuration repository. 该命令显示记录在服务配置库中的服务实例信息 The first form of this command prints one

com.alibaba.dubbo.rpc.RpcException: Forbid consumer 10.254.7.50 access service com.qingmu.core.service.ContentService from registry 192.168.200.128:2181 use dubbo version 2.8.4

Could not complete request com.alibaba.dubbo.rpc.RpcException: Forbid consumer 10.254.7.50 access service com.qingmu.core.service.ContentService from registry 192.168.200.128:2181 use dubbo version 2.8.4, Please check registry access list (whitelist/

How to Remove A Service Entry From Win10 Service List

.warnbanner { width: 600px; background-color: #FFEFCE } .warnbanner.border { border: 0px } .warnbanner .title { position: relative; height: 24px; line-height: 24px; background-color: #FF9900; text-align: center; vertical-align: middle } .warnbanner .

Web Service(1):用Web Service实现客户端图片上传到网站

由于项目需要,通过本地客户端,把图片上传到网站.通过webservice. 这是客户端代码: 1 private void btnimg_Click(object sender, EventArgs e) 2 { 3 this.yanzheng(); 4 mylocalhost.MySoapHeader myheader = new mylocalhost.MySoapHeader();///这是soapheader 5 mylocalhost.MyWebService myService =