本帖最后由 ljmemail 于 2010-05-18 15:34:44 编辑

解决方案 »

  1.   

    完整的错误信息如下
    {"从另一方收到未进行安全处理或安全处理不正确的错误。有关错误代码和详细信息,请参阅内部 FaultException。"}未处理 System.ServiceModel.Security.MessageSecurityException
      Message="从另一方收到未进行安全处理或安全处理不正确的错误。有关错误代码和详细信息,请参阅内部 FaultException。"
      Source="mscorlib"
      StackTrace:
        Server stack trace: 
           在 System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
           在 System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
           在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
           在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
           在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
           在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
           在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
        Exception rethrown at [0]: 
           在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
           在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
           在 CardManager.ReferenceLib.IServiceLib.GetExitRecordsByQuary(GetExitRecordsByQuaryRequest request)
           在 CardManager.ReferenceLib.ServiceLibClient.CardManager.ReferenceLib.IServiceLib.GetExitRecordsByQuary(GetExitRecordsByQuaryRequest request) 位置 c:\documents and settings\administrator\my documents\visual studio 2008\projects\ningxiatoll\cardmanager\service references\referencelib\reference.cs:行号 34998
           在 CardManager.ReferenceLib.ServiceLibClient.GetExitRecordsByQuary(String cardid, String entrynetworkstring, String entrystation, String exitnetwork, String exitstation, DateTime exittime, String entrycarnum, String exitcarnum, String rcarcalss, String carclass) 位置 c:\documents and settings\administrator\my documents\visual studio 2008\projects\ningxiatoll\cardmanager\service references\referencelib\reference.cs:行号 35013
           在 CardManager.FrmCardExitRecords.QuaryRow() 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\NingXiaToll\CardManager\FrmCardExitRecords.cs:行号 218
           在 CardManager.FrmCardExitRecords.QuarytoolStripButton_Click(Object sender, EventArgs e) 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\NingXiaToll\CardManager\FrmCardExitRecords.cs:行号 446
           在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
           在 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
           在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
           在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
           在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
           在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
           在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
           在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           在 System.Windows.Forms.Control.WndProc(Message& m)
           在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
           在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
           在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           在 System.Windows.Forms.Application.Run(Form mainForm)
           在 CardManager.Program.Main() 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\NingXiaToll\CardManager\Program.cs:行号 18
           在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           在 System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.ServiceModel.FaultException
           Message="无法处理消息。这很可能是因为操作“http://tempuri.org/IServiceLib/GetExitRecordsByQuary”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。"
           InnerException: 
      

  2.   

    你的测试环境中的 服务器的时间与客户机的时间相差多少?试试让他们的时间一致(通过internet同步时间)