Metadata error when running WCF service as particular user

天大地大妈咪最大 提交于 2020-01-03 05:57:11

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/4727091/metadata-error-when-running-wcf-service-as-particular-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!