0

操作後の魔女にプラグインがあり、Web サービスを介して共有ポイントにフォルダーを作成する必要があります。これを行うには、プラグインが Web サービスを呼び出して FechXML を実行し、エンティティから情報を取得しますが、問題はエンティティがまだ存在しないことです。それは私にNullを与えます。

プラグインがデータを FechXml に送信/保存して動作させるにはどうすればよいですか?

プラグインコード:

try
    {
        Entity entity;
        if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
        {
            entity = (Entity)context.InputParameters["Target"];
            if (entity.LogicalName != "fcg_processos")
            {

                throw new InvalidPluginExecutionException("Ocorreu um erro no PlugIn Create Folder.");
            }
        }
        else
        {

            throw new InvalidPluginExecutionException("Ocorreu um erro no PlugIn Create Folder.");
        }

        processosid = (Guid)((Entity)context.InputParameters["Target"])["fcg_processosid"];
        string processoid2 = processosid.ToString();


        PluginSharepointProcessos.ServiceReference.PrxActivityResult result = log.CreateFolderSP("Processo", processoid2);

        string resultado = result.xmlContent;

        if (result.retCode > 0)
        {
            throw new InvalidPluginExecutionException("Ocorreu um erro na criação do Folder do Processo.");

        }

ウェブサービスコード:

 {          
            //WEBSERVICE TO CALL XML FROM ENTITY
            PrxActivityResult Processo = ProcessoFetch2("", "", guid);
            string stxml;
            stxml = Processo.XmlContent;
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(stxml);
            XmlNodeList nodeList = xmlDoc.SelectNodes("resultset/result");
            List<string[]> lista = new List<string[]>();
            string[] strs = new string[7];
            if (nodeList.Count != 0)//verificar o numero de registos
            {

                foreach (XmlNode xmlnode in nodeList)
                {
                    if (xmlnode.SelectSingleNode("//fcg_numero") != null)
                        strs[2] = xmlnode.SelectSingleNode("//fcg_numero").InnerText;
                    else
                        strs[2] = "";

                    if (xmlnode.SelectSingleNode("//Concurso.fcg_numero") != null)
                        strs[3] = xmlnode.SelectSingleNode("//Concurso.fcg_numero").InnerText;
                    else
                        strs[3] = "";
                }

            }

        IwsspClient FmwSharepoint = new IwsspClient();
        PrxActivityResult folderresult = new PrxActivityResult();

        List<ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave> arrayfields = new List<ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave>();

        ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave nprocesso = new ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave();
        nprocesso.Key = "FCG_Numero_Processo";
        nprocesso.value = strs[2];
        arrayfields.Add(nprocesso);

        ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave npconcurso = new ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave();
        npconcurso.Key = "FCG_Numero_Concurso";
        npconcurso.value = strs[3];
        arrayfields.Add(npconcurso);

        ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave npguid = new ws.fcg.sipp.svc.ServiceReferenceSharePoint.PareChave();
        npguid.Key = "FCG_Guid_CRM";
        npguid.value = guid;
        arrayfields.Add(npguid);

        folderresult = FmwSharepoint.CreateFolder("http://localhost/folder", "Processos", strs[2], arrayfields.ToArray());

        res = folderresult;
        }
4

2 に答える 2