我是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)
如果你能解决这个问题,请帮助我。
答案 0 :(得分:1)
这将有助于任何人在努力解决这个问题:查看此网站:azure preconfiguured它已准备好进行编译并且只需单击一下即可使用。我的第二个猜测是正确的,你没有所有适当的端口和防火墙关闭并购买证书和域......所以只需检查出来并编译它真的很简单。我不喜欢crm2011,但我现在比我更了解它。我不知道我可以通过iframe做ajax和javascript以及几乎任何东西。干杯希望这会让事情变得更容易。
很好,所以你对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
/// Ipv6协议工作得非常好。还打开域tcp和udp以及sock 4上的端口 然后是最高消耗量的端口 港口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.
///当我读取处理程序异常时,我注意到一部分是在讨论“布尔” 这可能很重要,因为它可以真正地限制任何传入的数据,直至每次都严重失败。就像一个完整的防火墙,除了没有例外。
“String action,Boolean oneway,ProxyOperationRuntime operation,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。在我忘记之前,Timeout可能是一个缓冲区溢出,一个非常小的缓冲区溢出,在你尝试注册时会把你踢掉。但是我保证只有一个天文学的机会,它会执行并绊倒任何你拉动目标的东西。如果它像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
///我怀疑那些会有所帮助
答案 1 :(得分:0)