Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 无法浏览到WCF服务:HTTP 400错误请求_Asp.net_Wcf_Iis - Fatal编程技术网

Asp.net 无法浏览到WCF服务:HTTP 400错误请求

Asp.net 无法浏览到WCF服务:HTTP 400错误请求,asp.net,wcf,iis,Asp.net,Wcf,Iis,我有一个调用2个WCF服务的VS2010 MVC3解决方案。在我的第一台电脑上一切正常。我有另一台计算机,在那里我安装了相同的操作系统、相同的VS、相同的SQL Server Express、相同的IIS。。。我在第二台计算机上复制了解决方案的源代码。运行解决方案时,一切正常 但在第二台计算机上: 我无法浏览到服务URL!?一, 我无法更新服务引用!?二, 1当我浏览到http://localhost/PLATONServices/RequestService.svc 我收到一个HTTP400错

我有一个调用2个WCF服务的VS2010 MVC3解决方案。在我的第一台电脑上一切正常。我有另一台计算机,在那里我安装了相同的操作系统、相同的VS、相同的SQL Server Express、相同的IIS。。。我在第二台计算机上复制了解决方案的源代码。运行解决方案时,一切正常

但在第二台计算机上:

我无法浏览到服务URL!?一,

我无法更新服务引用!?二,

1当我浏览到http://localhost/PLATONServices/RequestService.svc 我收到一个HTTP400错误请求

2我收到一个HTTP状态为400的请求失败:错误的请求METADATE包含无法解析的引用:'http://localhost/PLATONServices/RequestService.svc"

有什么想法吗

因为两台计算机上的代码源相同,并且第一台计算机上的一切都正常,所以问题出在其他地方。我在两台计算机上都使用IIS6,但我看不出有任何区别

我找了一整天都没找到

谢谢

更新

以下是WCF的跟踪:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131075</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2012-05-13T08:33:37.1384484Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{5d80ddb2-6cf8-4e65-bc9b-3f4b7b880605}" />
<Execution ProcessName="w3wp" ProcessID="5280" ThreadID="13" />
<Channel />
<Computer>THINKPAD</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/fr-BE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>
<Description>Throwing an exception.</Description>
<AppDomain>/LM/W3SVC/1/ROOT/PLATONServices-2-129813716146273047</AppDomain>
<Exception>
<ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>There is a problem with the XML that was received from the network. See inner exception for more details.</Message>
<StackTrace>
at System.ServiceModel.Channels.HttpRequestContext.CreateMessage()
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>System.ServiceModel.ProtocolException: There is a problem with the XML that was received from the network. See inner exception for more details. ---&gt; System.Xml.XmlException: The body of the message cannot be read because it is empty.
   --- End of inner exception stack trace ---</ExceptionString>
<InnerException>
<ExceptionType>System.Xml.XmlException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
**<Message>The body of the message cannot be read because it is empty.</Message>**
<StackTrace>
at System.ServiceModel.Channels.HttpRequestContext.CreateMessage()
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>**System.Xml.XmlException: The body of the message cannot be read because it is empty.**</ExceptionString>
</InnerException>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

确保服务是在应用程序中设置的,如本文所述


WCF相关组件是否安装在第二台机器上?这些是从打开或关闭Windows功能对话框中配置的,该对话框可以在Windows的“添加/删除程序”中找到。它们通常在Microsoft.Net Framework 3.5.1部分下。我安装的与我的另一台计算机完全相同。我还尝试在Microsoft.Net Framework 3.5.1下安装WCF HTTP激活,同时打开或关闭Windows功能,但没有纠正问题。谢谢。你打开/查看服务跟踪日志了吗?这会告诉你什么是故障是的,我已经打开了服务跟踪日志。我更新我的问题以显示痕迹。@Bronza要查看此帖子,我已经查看了此帖子,所有建议都已完成,但未成功。无论如何,谢谢。即使您只是在浏览器窗口中打开服务,也会出现此错误?