javascript - 未处理的异常:System.TimeoutException:请求 channel 在00:01:59.4579323之后等待答复时超时

标签 javascript plugins dynamics-crm-online

我是crm2011的新手

我尝试创建一个插件,然后使用“插件注册”工具进行注册

这是Plugin.cs文件的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using Xrm;
using System.Runtime.Serialization;

namespace NewPlugin
{
public class Plugin : IPlugin
{
    /// <summary>
    /// A plugin that creates a follow-up task activity when a new account is created.
    /// </summary>
    /// <remarks>Register this plug-in on the Create message, account entity,
    /// and asynchronous mode.
    /// </remarks>
   public void Execute(IServiceProvider serviceProvider)
    {
        //Extract the tracing service for use in debugging sandboxed plug-ins.
        ITracingService tracingService =
            (ITracingService)serviceProvider.GetService(typeof(ITracingService));

        // Obtain the execution context from the service provider.
        IPluginExecutionContext context = (IPluginExecutionContext)
            serviceProvider.GetService(typeof(IPluginExecutionContext));

        // The InputParameters collection contains all the data passed in the message request.
        if (context.InputParameters.Contains("Target") &&
            context.InputParameters["Target"] is Entity)
        {
            // Obtain the target entity from the input parameters.
            Entity entity = (Entity)context.InputParameters["Target"];

            throw new InvalidPluginExecutionException("Plugin could not be registered");  
        }
    }        }
}
}


但是当我注册此插件时,出现以下错误

Unhandled Exception: System.TimeoutException: The request channel timed out while   waiting for a reply after 00:01:59.4579323. Increase the timeout value passed to the call   to Request or increase the SendTimeout value on the Binding. The time allotted to this   operation may have been a portion of a longer timeout.

Server stack trace: 
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at    System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly)
at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
Inner Exception: System.TimeoutException: The HTTP request to 'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc' has exceeded the allotted timeout of 00:01:59.9970000. The time allotted to this operation may have been a portion of a longer timeout.
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
Inner Exception: System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)


如果您能解决这个问题,请帮助我。

最佳答案

在这里,这将帮助任何对此进行挣扎的人:请访问以下网站:azure preconfiguured它已准备好进行编译,并且具有单击方法,并且已经处于天蓝状态。我的第二个猜测是正确的,您没有关闭所有适当的端口和防火墙,并购买了证书和域……因此,只需检查一下并进行编译即可。我不喜欢crm2011,但我现在比我更了解。我不知道我可以做ajax和javascript以及通过iframe做的几乎所有事情。欢呼声希望这会使事情变得容易。

很好,所以您对于Iplugins的crm和cs脚本还很陌生? SDK很棒,绰绰有余。
您的行看起来很紧,但是我看到一些行需要进行擦洗。我在crm上花费的时间不多,但是由于插件是公正且可执行的脚本,因此我对此有一点了解,因此非常类似于JavaScript,Ajax,python,html...。

当您使用参数//从服务提供者那里获取执行上下文时,对我来说就像。

IPluginExecutionContext context = (IPluginExecutionContext)
        serviceProvider.GetService(typeof(IPluginExecutionContext));

    // The InputParameters collection contains all the data passed in the message request.
    if (context.InputParameters.Contains("Target") &&
        context.InputParameters["Target"] is Entity)
    {
        // Obtain the target entity from the input parameters.
        Entity entity = (Entity)context.InputParameters["Target"]; 


     ///Everything looks perfect up to that point but the service providers all have time 
     exceptions or if, they just don't like you pulling off of them if you don't have super   
     clean code. It will throw a fit and knock you off every time within probably a little over 
     a minute. When you are trying to pull the context params off you need to let it know what 
     you are doing with a so before this line of code you are going to need to put in a time 
     exception argument which allocates you time.
                                                                                                          ///I don't know what exactly your target is but it is a domain correct?
     If so you just need to throw an exception at it that will allow you                   
          to register and stay there all damn day if you please. 

    ///when it throws this "System.TimeoutException" it then proceeds to give you a miniscule 
  amount of time to respond because it is a script so it can execute however fast the ping is. 
     Right before you request anything use this exception    

                   //<serviceProvider.TimeoutException="Target"></client> 

       ///if it wants to keep being stubborn than continue to clean up your lines and use the 
             /></system argument whenever it throws a fit about time. reminds me a lot of old 
            school html and python. 


       /// If you are actually going one on one with the server you can throw a

                                                                                                                //<serviceProvider or 
           <domain.GetService.TimeoutException="reqast_info">*</client> 

        ///That should allow it to continue without losing any packets or throwing 
        any "time" exception


/// Ivv6协议确实运作良好。还要在域tcp和udp和sock 4上打开端口
            和5个,然后是消耗最大的端口
            80和25端口...好吧,让我们说这是最宽容的端口,也是最容易的
            有。

        ///I hope I wasn't to late , but if I was than I am happy you got that "HelloWorld.cs" 
        Registered. Anyways man hope all is well. Sorry If I am not a huge help because I have,
        probably sounds and looks just like JavaScript.


///当我读取处理程序异常时,我注意到有一部分在谈论“布尔”
这之所以意义重大,是因为它实际上可以每次将所有传入数据限制为严重的破坏性失败。就像完整的防火墙一样,没有例外。

“字符串操作,布尔型单向,ProxyOperationRuntime操作,Object [] ins,Object [] outs”
布尔值用作数据包过滤器。而且它没有设置进出流量。因此,它可以推送大量数据包,但接收到的数据足以完成任务。我记得代理服务器……学校里真正的代理服务器称为mcproserver端口8080,具有隧道传输功能,而且非常激进。”而且,代理服务器还可以减缓它们带来的更多流量。

在该域上进行一些调查工作,并获取其ipv6地址,并通过终端进行一些网络挑战,以便您可以确切地了解另一端的限制,例如,它将清除日志并动态删除代理他们旋转了几百个;每两个小时,如果您不通过客户端通过它进行隧道传输,那将在2秒内将您踢开。他们的服务器本身可能每7天重置一次。这很可能是A + AAAA类,很荒谬。该布尔值还限制了代理服务器可以下行链接复杂数据包的带宽。

首先,您必须拥有一个安全的注册帐户,否则它就永远不会进入任何地方,其次,该域:'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc'甚至根本不作为域存在,因此这可能是您的全部问题,因为它无法建立连接两个小时。不可能。您的台词非常简单。比我强。我无法通过ping或nslookup进入该域的任何部分

因此,在我看来,您首先必须通过我假设的客户端建立安全连接,或者如果您知道端口并且您具有授权,则可以在服务器上运行一些测试,这样您就不能继续浪费时间仅仅为了找出它无法与其建立http连接。

您的插件与此无关。您没有与域建立正确的连接,因此可能会丢失90%的数据包,或者只是将您从一开始就关闭了,但是如果您使用终端启动网络共享或以提升的特权发送和建立隧道,则会等待两个小时登录,而不使用Webrowser或客户端。然后一次,如果您可以与域建立连接,并且不丢弃数据包,并且如果存在,则说明您是黄金。

但是您要么需要在一端打开一些端口,然后打开nat并设置防火墙例外,要么就在那端。最可能是前者。您仍然可以尝试添加我为您准备的行,这些行确实会分配更多时间。但是现在我已经深入了。完成所有操作后,插件将其精加工,然后向上同步,然后向下滚动到最底端,它会抛出0并关闭您。我确定自己浪费了时间,因为我刚刚意识到这是3个月前问到的。希望这次您的能力出类拔萃。

P.s.在我忘记之前,超时可能是一个缓冲区溢出,这是一个很小的缓冲区溢出,它会在您尝试注册时将您踢开。但是我保证,无论您将目标拖到哪里,它都会执行并跳闸,这是一个天文数字。如果是类似python的内容,则可以略微更改我键入的行以使其成为“ div”扩展名,这只是一种进入我的个人经历的简单方法:

 <div class="row-fluid">
    </div>
    <div class="row-fluid">
    <div class="span6">
    <label>
    <input type="text" name=name of the domain that you are using."
        <span class="inline_error_message error_"></span>
            </div>
        <div class="span6">
        <input type="text" name="" value= />
        <span class="inline_error_message error_">_</span>
        </div>
                    <div class="row-fluid">

          ///These are java script row-fluid 


///我怀疑这会有所帮助

关于javascript - 未处理的异常:System.TimeoutException:请求 channel 在00:01:59.4579323之后等待答复时超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19587321/

相关文章:

javascript - 强制 heroku 使用特定版本的 Node.js

javascript - React js 简单获取 json 并列出内容 "TypeError: this.state.items.map is not a function"

javascript - 可以在 nodeJS 中创建 3D 多人游戏服务器

wordpress - 如何创建基本的 WordPress 管理指针?

javascript - Node js 中内部文本的结果

java - 在 eclipse 中运行插件应用程序

grails - 自定义Grails插件依赖性

c# - 是否有可能以及如何从 SQL Server 中的本地报告服务针对在线动态 CRM 数据源运行 SSRS 报告?

c# - 从 CRM 沙盒插件调用 WCF(使用生成的客户端)抛出 System.Security.SecurityException

dynamics-crm - 是否可以在线检索 Dynamics CRM 中的架构更改信息?