gpt4 book ai didi

wcf - 这可能是由于服务端点绑定(bind)不使用 HTTP 协议(protocol)

转载 作者:行者123 更新时间:2023-12-03 05:11:50 34 4
gpt4 key购买 nike

我的本​​地计算机上有一个运行良好的 WCF 服务。我将其放在服务器上,但收到以下错误:

An error occurred while receiving the HTTP response to http://xx.xx.x.xx:8200/Services/WCFClient.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.]

我已经访问了 url 中的服务,它工作正常。我为该函数所做的只是将字符串返回到图像名称,因此传递的数据并不很多。我追踪了日志,它给了我相同的信息。这是我的客户端配置:

<binding name="basicHttpBinding_IWCFClient" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<endpoint name="basicHttpBinding_IWCFClient"
address="http://localhost:4295/Services/WCFClient.svc"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_IWCFClient"
behaviorConfiguration="WCFGraphicManagementTool.Services.ClientBehavior"
contract="WCFClient.IWCFClient" />

这是我的服务器配置:

<service behaviorConfiguration="WCFGraphicManagementTool.Services.WCFClientBehavior"
name="WCFGraphicManagementTool.Services.WCFClient">
<endpoint name="basicHttpBinding_IWCFClient"
address=""
binding="basicHttpBinding"
contract="WCFGraphicManagementTool.Contracts.IWCFClient" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
<behavior name="WCFGraphicManagementTool.Services.WCFClientBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceThrottling maxConcurrentCalls="120" maxConcurrentSessions="120"
maxConcurrentInstances="120" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

由于它在我的本地计算机上运行,​​因此它会是服务器上的设置吗?

最佳答案

我认为存在序列化问题,您只需在<configuration>中的服务配置中添加以下代码即可找到确切的错误部分。

配置更新后"App_tracelog.svclog"文件将创建,您的服务所在的位置只需打开 .svclog文件并在左侧面板上找到红色线,这是错误的,请参阅其描述以获取更多信息。

我希望这将有助于发现您的错误。

<configuration>
...
...

<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
<listeners>
<add name="ServiceModelTraceListener" />
</listeners>
</source>
<source name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
<listeners>
<add name="ServiceModelTraceListener" />
</listeners>
</source>
<source name="System.Runtime.Serialization" switchValue="Verbose,ActivityTracing">
<listeners>
<add name="ServiceModelTraceListener" />
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="App_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp" />
</sharedListeners>
</system.diagnostics>

</configuration>

更新:如果您找不到更新的"App_tracelog.svclog"文件然后请找到 "<some GUID>App_tracelog.svclog"喜欢 "a39e3026-5dd8-4d39-842a-04d486615eedApp_tracelog.svclog"

关于wcf - 这可能是由于服务端点绑定(bind)不使用 HTTP 协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5870958/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com