运行WCF服务为特定的用户时,元数据错误 [英] Metadata error when running WCF service as particular user

查看:134
本文介绍了运行WCF服务为特定的用户时,元数据错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署了一个WCF服务,当应用程序池运行作为一个特定的域用户的伟大工程,但是当我更改应用程序池作为一个不同的用户身份运行,我得到一个XPATH错误,我的服务甚至没有回报元数据。我很困惑 - 我的新用户有权所有服务文件(包括配置文件),正常运行作为一个应用程序池的身份,和数据库的权限并不重要,因为我不能连拉了一个合同清单

任何人都可以揭示出这个一些启示?当我尝试使用WCF测试客户端来连接我连接我得到了错误的文本。更改应用程序池作为第一个用户运行和测试客户端将一份合同清单,我可以在所有调用的方法没有任何问题。请救救我!

  

错误:无法导入   WSDL:portTypeDetail:是一个例外,   甩在运行WSDL导入   延伸:   System.ServiceModel.Description.DataContractSerializerMessageContractImporterError:   架构与目标命名空间   HTTP://UsBankRtSvc.Model/2010/Service   不能found.XPath到错误   资源:   //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:portType[@name='UsBankRealTimeServiceContract']Error:   无法导入WSDL:bindingDetail:   发生错误导入   WSDL:端口类型的WSDL:绑定   相关on.XPath到WSDL:端口类型:   //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:portType[@name='UsBankRealTimeServiceContract']XPath到误差源:   //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:binding[@name='DefaultEndpoint']Error:   无法导入WSDL:portDetail:有   是一个错误导入WSDL:绑定   该WSDL:端口依赖   on.XPath到WSDL:绑定:   //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:binding[@name='DefaultEndpoint']XPath   到误差源:   //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:service[@name='UsBankRealTimeSvc']/wsdl:port[@name='DefaultEndpoint']Warning:   没有code是generated.If你   试图生成一个客户此,   可能是因为元数据   文件没有包含任何有效的   合同或servicesor,因为所有   合同/服务被发现到   存在于/引用程序集。校验   你通过了所有的元数据   文件到tool.Warning:如果您   想生成的数据合同   从模式确保使用的   / dataContractOnly选项。

解决方案

也有类似的问题。我通过授予IIS_WPG组全面进入到c固定它:\ WINDOWS \ TEMP文件夹中的服务器上

I have deployed a WCF service that works great when the application pool runs as a particular domain user, but when I change the application pool to run as a different user, I get an XPATH error and my service doesn't even return metadata. I'm perplexed - my new user has permissions to all the service files (including config files), runs fine as an app pool identity, and database permissions don't matter because I can't even pull up a contract list.

Can anybody shed some light on this? I've attached the text of the error I get when I try to connect using the WCF Test Client. Changing the app pool to run as the first user and the test client pulls up a contract list, and I can call a method without any issues at all. Please save me!

Error: Cannot import wsdl:portTypeDetail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporterError: Schema with target namespace 'http://UsBankRtSvc.Model/2010/Service' could not be found.XPath to Error Source: //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:portType[@name='UsBankRealTimeServiceContract']Error: Cannot import wsdl:bindingDetail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:portType[@name='UsBankRealTimeServiceContract']XPath to Error Source: //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:binding[@name='DefaultEndpoint']Error: Cannot import wsdl:portDetail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:binding[@name='DefaultEndpoint']XPath to Error Source: //wsdl:definitions[@targetNamespace='http://UsBankRtSvc.Model/2010/Service']/wsdl:service[@name='UsBankRealTimeSvc']/wsdl:port[@name='DefaultEndpoint']Warning: No code was generated.If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or servicesor because all contracts/services were discovered to exist in /reference assemblies. Verify that you passed all the metadata documents to the tool.Warning: If you would like to generate data contracts from schemas make sure to use the /dataContractOnly option.

解决方案

Had a similar issue. I fixed it by granting the IIS_WPG group full access to the c:\windows\temp folder on the server.

这篇关于运行WCF服务为特定的用户时,元数据错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆