标签: protocolexception

ProtocolException:预期的':status'标头不存在

在工作应用程序中突然发生网络调用失败并出现协议异常.该应用程序一直工作到昨天,今天所有的网络呼叫都失败了.这些调用适用于HTTP,但使用HTTPS失败.

这是日志,

java.net.ProtocolException: Expected ':status' header not present
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:262)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:145)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:53)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-18 14:59:01.103 30746-30746/? W/System.err:     at codmob.com.campuswallet.app.ApiClient$1.intercept(ApiClient.java:66)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
10-18 14:59:01.103 30746-30746/? W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) …
Run Code Online (Sandbox Code Playgroud)

android protocolexception retrofit retrofit2 okhttp3

19
推荐指数
3
解决办法
1万
查看次数

获取 ProtocolException 运行时错误 Blazor 项目

我正在使用 Visual Studio Professional 2019 版本 16.8.1 开发一个简单的 Blazor ASP.NET CORE Web 程序集项目(异常也发生在版本 16.8.0 中)。

有时,当我启动应用程序时,我会收到运行时错误“无法启动调试适配器异常类型Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException并且项目无法在浏览器中启动”。

应用程序启动的浏览器是新的 Microsoft Edge。

该消息可以在下面看到:

在此处输入图片说明

c# asp.net protocolexception blazor

18
推荐指数
2
解决办法
3618
查看次数

从WCF REST获取错误详细信息

我有.Net WCF客户端使用的REST服务.

遇到错误时,REST服务返回HTTP 400 Bad Request,其响应主体包含JSON序列化详细信息.

如果我使用Fiddler,Javascript或直接从C#执行请求,我可以在发生错误时轻松访问响应正文.

但是,我正在使用ChannelFactory具有6个非常复杂的接口的WCF .此代理抛出的异常始终为a ProtocolException,没有有用的详细信息.

当我收到此错误时,有没有办法获得响应正文?


更新

我意识到使用.Net有很多不同的方法可以做到这一点,还有其他方法可以获得错误响应.他们知道但不回答这个问题很有用.

我们正在使用的REST服务将发生变化,当它们执行时,复杂的接口会更新.使用ChannelFactorywith new接口意味着我们将获得编译时(而不是运行时)异常,并使这些代码更容易维护和更新.

使用WCF通道时,有没有办法让错误HTTP状态的响应体?

.net rest wcf channelfactory protocolexception

9
推荐指数
3
解决办法
6056
查看次数

在客户端处理WCF服务重新启动

我有一个GUI客户端,它运行在服务器盒上作为Windows服务托管的WCF服务上运行.WCF服务在PerCall InstanceContextMode中运行,并且客户端具有服务客户端的单例实例,并且我想避免在每次调用时重新实例化单例,因为它使我的许多异步调用变得困难.

对我来说问题是,在重新启动Windows服务之后,每次客户端进行调用时都会收到如下异常消息:

由于服务器启动的关闭,输出会话自动关闭,因此该通道不能再用于发送消息.通过将DispatchRuntime.AutomaticInputSessionShutdown设置为false来禁用自动关闭,或者考虑使用远程服务器修改关闭协议.

什么是最好的解决方法?我可以将try-catch子句放在对服务客户端的所有调用周围,并在通信异常上重新实例化单例实例,但这将涉及大量的样板代码.

wcf exception-handling protocolexception

7
推荐指数
1
解决办法
1万
查看次数

为什么XML-RPC API端点会随机抛出ProtocolError -1?

我们围绕Magento的XML-RPC API构建了一个广泛的中间件系统.我们用Python封装了端点并且正在做很多多线程.

在看似随机的时间间隔内,API会响应

ProtocolError for www.mydomain.com/api/xmlrpc/: -1
Run Code Online (Sandbox Code Playgroud)

这是Apache有趣的方式说"503服务不可用",如果是这样,为什么会这样?

处理此异常的理想方法是什么?异常重试似乎会让问题变得更糟.

Web服务器是Ubuntu 10.04.1 PHP 5.3.2-1ubuntu4.5,带有Suhosin-Patch和Zend Engine v2.3.0使用Python的xmlrpclib调用API.

apache api xmlrpclib magento protocolexception

5
推荐指数
1
解决办法
885
查看次数