我正在开发一个WCF服务,我正在Cassini中测试它。我也有一个控制台应用程序,并有一个Web引用。到cassini托管的svc。这工作正常,我可以调用服务方法。但是,当我将svc部署到IIS并尝试运行到控制台应用程序时,我收到此错误。
System.ServiceModel.FaultException`1未处理
Message =在消息NotifRQRequest中反序列化其中一个标头时出错。有关详细信息,请参阅InnerException 来源= mscorlib服务器堆栈跟踪:
在System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息 回复,MessageFault错误,字符串操作,MessageVersion版本, FaultConverter faultConverter)
在System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime) 操作,ProxyRpc& RPC)
在System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins, 对象[]出局,TimeSpan超时)
在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage) methodCall,ProxyOperationRuntime operation)
在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 消息)
在[0]处重新抛出异常:
在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32类型)
在TestConsole.ServiceReference1.IPush.RQ(NotifRQRequest请求)
在TestConsole.ServiceReference1.PushClient.TestConsole.ServiceReference1.IPush.NotifRQ(NotifRQRequest) 请求)在ServiceReference1 \ Reference.cs中:第37165行 在TestConsole.ServiceReference1.Client.RQ(安全性安全性,操作操作,消息ID消息ID,回复回复,收件人到, NotifRQ notifRQ1)ServiceReference1 \ Reference.cs:37176行 在TestConsole.Program.Main(String [] args)
在System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,String [] args)
在System.AppDomain.ExecuteAssembly(String assemblyFile,Evidence assemblySecurity,String [] args)
在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在System.Threading.ThreadHelper.ThreadStart_Context(对象状态)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean ignoreSyncCtx)
在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态)
在System.Threading.ThreadHelper.ThreadStart()
的InnerException:
我正在运行x64环境。甚至尝试更改到不同的应用程序池。
非常感谢任何建议或提示。
谢谢,
编辑1: 刚注意到一件事。 svc使用wsdl中列出的大约5个xml命名空间。在cassini中,我可以浏览,即我可以点击localhost / Notification / NotificationService.svc?xsd = xsd0,但我不能在IIS上做同样的事情!!!
<xsd:schema targetNamespace="http://www.opentravel.org/OTA/2003/05/Imports">
<xsd:import schemaLocation="http://localhost/Notification/NotificationService.svc?xsd=xsd0" namespace="http://www.opentravel.org/OTA/2003/05"/>
<xsd:import schemaLocation="http://localhost/Notification/NotificationService.svc?xsd=xsd1" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
<xsd:import schemaLocation="http://localhost/Notification/NotificationService.svc?xsd=xsd3" namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing"/>
<xsd:import schemaLocation="http://localhost/Notification/NotificationService.svc?xsd=xsd2" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
<xsd:import schemaLocation="http://p/Notification/NotificationService.svc?xsd=xsd4" namespace="http://htng.org/2011A"/>
</xsd:schema>
编辑2: 似乎这似乎只发生在64位机器上,并且在32位上工作正常。
答案 0 :(得分:0)
原来是web.config
中指定的Redirect模块配置的问题