在我的网页中,我向WCF服务发出Ajax请求。如果服务抛出错误,那么将在JSON中传回。然后,JavaScript错误处理程序会显示一个隐藏的div,其中包含一个预先填充了我的详细信息的mailto URL,以便团队成员(这是一个小型内部应用程序)可以向我发送包括堆栈跟踪在内的错误。以下是测试运行的结果URL示例:
mailto:tttttttt@mmmmmmmmm.com?subject=potential%20seed%20save%20failed&body=Potential%20seed%20URL%20=%20unknown%0DResponse%20%3A%20%7B%22ExceptionDetail%22%3A%7B%22HelpLink%22%3Anull%2C%22InnerException%22%3Anull%2C%22Message%22%3A%22testing%22%2C%22StackTrace%22%3A%22%20%20%20at%20SavePotentialSeedSearches.WCFService.StorePotentialSeed(String%20url%2C%20String%20name)%20in%20C%3A%5C%5CTFS%5C%5CProjects%5C%5CSeeds%5C%5CPreliminaries%5C%5CSavePotentialSeedSearches%5C%5CWCFService.svc.cs%3Aline%2021%5Cu000d%5Cu000a%20%20%20at%20SyncInvokeStorePotentialSeed(Object%20%2C%20Object%5B%5D%20%2C%20Object%5B%5D%20)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object%20instance%2C%20Object%5B%5D%20inputs%2C%20Object%5B%5D%26%20outputs)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean%20isOperationContextSet)%22%2C%22Type%22%3A%22System.ArgumentException%22%7D%2C%22ExceptionType%22%3A%22System.ArgumentException%22%2C%22Message%22%3A%22testing%22%2C%22StackTrace%22%3A%22%20%20%20at%20SavePotentialSeedSearches.WCFService.StorePotentialSeed(String%20url%2C%20String%20name)%20in%20C%3A%5C%5CTFS%5C%5CProjects%5C%5CSeeds%5C%5CPreliminaries%5C%5CSavePotentialSeedSearches%5C%5CWCFService.svc.cs%3Aline%2021%5Cu000d%5Cu000a%20%20%20at%20SyncInvokeStorePotentialSeed(Object%20%2C%20Object%5B%5D%20%2C%20Object%5B%5D%20)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object%20instance%2C%20Object%5B%5D%20inputs%2C%20Object%5B%5D%26%20outputs)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean%20isOperationContextSet)%22%7D
那是2354个字符。
Other answers建议超过2000个字符的网址是个坏主意,因为有些浏览器可能会遇到这些问题。但是,是否可以通过浏览器以任何方式解析mailto URL,还是将它们立即传递给默认邮件工具?如果他们被提交,是否有人有关于各种邮件工具(特别是Outlook)可以处理的mailto URL长度的数据?