簡體   English   中英

Biztalk自定義函子非邏輯錯誤映射

[英]Biztalk custom functoid unlogical error in mapping

我開始為biztalk構建一些自定義日期函數。

我部署了自定義functoid類,並將其添加到biztalk映射器的自定義functoid列表中。

我的映射是這樣的: https : //kurdy.de/owncloud/index.php/s/Law7vCB9lfLkg8J

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var ScriptNS0" version="1.0" xmlns:ns0="http://testdeleteme1.Output" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0">
  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
  <xsl:template match="/">
    <xsl:apply-templates select="/ns0:Datum" />
  </xsl:template>
  <xsl:template match="/ns0:Datum">
    <ns0:Datum>
      <xsl:for-each select="Testfalle">
        <Testfalle>
          <xsl:variable name="var:v1" select="ScriptNS0:DatetimeToCustomDatetime(string(Datum/text()) , string(Format/text()))" />
          <Datum>
            <xsl:value-of select="$var:v1" />
          </Datum>
          <xsl:if test="Format">
            <Format>
              <xsl:value-of select="Format/text()" />
            </Format>
          </xsl:if>
        </Testfalle>
      </xsl:for-each>
    </ns0:Datum>
  </xsl:template>
</xsl:stylesheet>

我的functoid需要2個參數,第一個是ac#datetime作為字符串,第二個是預期的目標格式格式為字符串。

例如param1 =“ 2015-09-15T20:15:13.000”,param2 =“ yyyyMMdd” functoid本身的功能在通用控制台應用程序中起作用。 它給我一個“ 20150915”。

但是在biztalk映射中,我遇到2個錯誤。 如果我調試地圖:

“捕獲到錯誤3異常:值不在預期范圍內。”

如果我測試地圖:

“錯誤3 XSL轉換錯誤:無法將輸出實例寫入> [fileLocation]。值不能為null。參數名稱:extension”

我的functoid的代碼是:

    public string DatetimeToCustomDatetime(string date, string dateFormat)
    {
         DateTime dt;
         string retVal;
         ResourceManager resmgr = new ResourceManager("Custom.Biztalk.Datefunctoid" + ".DatetimeResources",  Assembly.GetExecutingAssembly());
         CultureInfo provider = CultureInfo.InvariantCulture;

         dateFormat =  dateFormat.Trim();
         dt = Convert.ToDateTime(date);

         try
         {
             retVal = dt.ToString(dateFormat);
         }
         catch (Exception myEx)
         {
             throw new  Exception(string.Format(resmgr.GetString("IDS_PERIMETERFUNCTOID_EXCEPTION"))  + date + " " + dateFormat + "\n" + myEx.Message);
         }
         return retVal;
     }

你能幫助我嗎? 我真的不知道問題可能在哪里...

我已經建立了一個自定義functoid可以工作。 它將customdatetime轉換為ac#datetime並可以工作,除了名稱和functoid id外,它的構建幾乎相同。

解決:SetExternalFunctionName(GetType()。Assembly.FullName,“ BIS.Custom.Functoid.DatetimeToAnyDatetime”,“ DatetimeToCustomDatetime”);

我從BaseFunctoid繼承函數中為此設置了錯誤的名稱空間。

解決:SetExternalFunctionName(GetType()。Assembly.FullName,“ BIS.Custom.Functoid.DatetimeToAnyDatetime”,“ DatetimeToCustomDatetime”);

我從BaseFunctoid繼承函數中為此設置了錯誤的名稱空間。

主要帖子中的更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM