前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Temp权限引起的WCF问题

Temp权限引起的WCF问题

作者头像
张善友
发布2018-01-19 15:59:14
7890
发布2018-01-19 15:59:14
举报
文章被收录于专栏:张善友的专栏

WCF按照BasicHttpBinding方式发布,部署到服务器上,再在其他项目中引用的时候,就会出现不能正确下载元数据的错误。使用svcutil.exe工具进行测试,出现下面的问题。在Log跟踪中看到:

代码语言:js
复制
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent%22> 
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system%22> 
<EventID>131075</EventID> 
<Type>3</Type> 
<SubType Name="Error">0</SubType> 
<Level>2</Level> 
<TimeCreated SystemTime="2009-09-10T08:28:29.0217396Z" /> 
<Source Name="System.ServiceModel" /> 
<Correlation ActivityID="{00000000-0000-0000-0f00-0060010000fb}" /> 
<Execution ProcessName="w3wp" ProcessID="5628" ThreadID="5" /> 
<Channel /> 
<Computer>OA-HRPAYOPR</Computer> 
</System> 
<ApplicationData> 
<TraceData> 
<DataItem> 
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord%22 Severity="Error"> 
<TraceIdentifier>http://msdn.microsoft.com/zh-CN/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier> 
<Description>Throwing an exception.</Description> 
<AppDomain>/LM/W3SVC/1688268109/Root-1-128970447760280025</AppDomain> 
<Exception> 
<ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType> 
<Message>Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8.  The client and service bindings may be mismatched.</Message> 
<StackTrace> 
at System.ServiceModel.Channels.HttpInput.ThrowHttpProtocolException(String message, HttpStatusCode statusCode, String statusDescription) 
at System.ServiceModel.Channels.HttpInput.ValidateContentType() 
at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception&amp; requestException) 
at System.ServiceModel.Channels.HttpRequestContext.CreateMessage() 
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, ItemDequeuedCallback 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.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2() 
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke() 
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks() 
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state) 
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) 
at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) 
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) 
</StackTrace> 
<ExceptionString>System.ServiceModel.ProtocolException: Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8.  The client and service bindings may be mismatched.</ExceptionString> 
<DataItems> 
<Data> 
<Key>System.ServiceModel.Channels.HttpInput.HttpStatusCode</Key> 
<Value>UnsupportedMediaType</Value> 
</Data> 
<Data> 
<Key>System.ServiceModel.Channels.HttpInput.HttpStatusDescription</Key> 
<Value>Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.</Value> 
</Data> 
</DataItems> 
</Exception> 
</TraceRecord> 
</DataItem> 
</TraceData> 
</ApplicationData> 
</E2ETraceEvent>
Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8.  The client and service bindings may be mismatched 
  Cannot process the message because the content type ‘application/soap+xml; charset=utf-8′ was not the expected type ‘text/xml; charset=utf-8′. 

查了好久,得到A few tips when using WCF with BizTalk Server 2006 R2的启示,估计可能是C:\WINDOWS\TEMP没有写权限。将其设为everyone可读写后,则完全正常了。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2009-09-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档