gpt4 book ai didi

WCF 服务在本地运行时总是返回发现页面

转载 作者:太空宇宙 更新时间:2023-11-03 15:01:41 24 4
gpt4 key购买 nike

使用 WCF 测试客户端,我在尝试调用方法时得到了这个:

The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR:

000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY:

Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px}TagService Service

Server stack trace: 
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IDataTagService.GetTagDefinitions(String projectID, Nullable`1 tagType)
at DataTagServiceClient.GetTagDefinitions(String projectID, Nullable`1 tagType)

在我看来是发现页面。这在部署时有效,但在本地无效?这也曾经在本地工作,但不知何故已经开始显示这种行为。我不确定是什么改变导致这一切突然中断。

编辑:我已经将范围缩小到:

<security mode="Transport">

如果我将其更改为 none 并使用 http url,它会起作用,但我希望我的本地副本能够镜像生产,所以有人知道我如何找到这个问题的根本原因吗?

编辑:我卸载并重新安装了 IIS,运行应用程序以使 asp.net 和 wcf 与 IIS 一起工作,启用了 ssl,然后又回到了我开始的地方。啊!

最佳答案

这是由于 securitySwitch 没有被关闭,或者至少没有配置造成的。放

<secureWebPages mode="Off" ignoreHandlers="None">
</secureWebPages>

解决了问题,并被 web.release.config 转换覆盖。

以前只是<secureWebPages />

http://code.google.com/p/securityswitch/

关于WCF 服务在本地运行时总是返回发现页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20975358/

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