共用方式為


搭配 SharePoint 使用 Oracle-Business Suite 配接器的考慮

本主題包含您在搭配 Microsoft Office SharePoint Server 使用 Microsoft BizTalk Adapter for Oracle E-Business Suite 時可能會遇到的問題相關資訊,以及解決方法。 問題分為兩類:

  • 一般問題

  • 與自訂網頁元件相關的問題

一般問題

本節包含沒有解決方案的問題。

問題 1:不會顯示 WCF 服務傳回的簡單類型資料

說明:Microsoft Office SharePoint Server 預期 WCF 服務所傳回的資料只屬於 DataSet 或 Collection 類型。 如果 WCF 服務所傳回的資料是簡單類型,Microsoft Office SharePoint Server 就不會顯示資料。

解決方式:沒有解決方法。 這是 Microsoft Office SharePoint Server 的已知限制。

問題 2:如果 WCF 服務傳回的資料為 Null,就會顯示錯誤訊息

說明:如果 WCF 服務傳回的資料是 Null 值,Microsoft Office SharePoint Server 會顯示錯誤訊息。 例如,假設您使用的是 Finder 方法實例的商務資料清單網頁元件,並根據搜尋運算式在 Oracle E-Business Suite 中搜尋客戶。 您指定的搜尋運算式會擷取 Null 值。 在此情況下,Microsoft Office SharePoint Server 會顯示錯誤訊息。

解決方式:沒有解決方法。 這是 Microsoft Office SharePoint Server 的已知限制。

問題 3:不會顯示 WCF 服務所傳回之簡單類型的陣列

說明:如果 WCF 服務傳回的資料是簡單類型的陣列,Microsoft Office SharePoint Server 就不會顯示資料。 此外,當您在 Business 資料目錄 定義編輯器中執行傳回簡單類型的陣列的方法實例時,會顯示下列錯誤訊息:「後端系統配接器傳回的結構與對應的中繼資料不相容 (MethodInstance、Parameter 或 TypeDescriptor) 」。

解決方式:沒有解決方法。 這是 Microsoft Office SharePoint Server 和商務資料目錄定義編輯器的已知限制。

問題 4:無法匯入包含具有 300 個以上的複雜類型參數的應用程式定義檔

說明:Microsoft Office SharePoint Server 無法匯入在 WCF 服務所傳回複雜類型參數中超過 300 個欄位的應用程式定義檔案,如果您嘗試這麼做,則會顯示錯誤訊息。 這是因為 Microsoft Office SharePoint Server 無法顯示複雜類型參數超過 300 個欄位的限制。

解決方案:使用商務資料目錄定義編輯器,將複雜類型參數的欄位數目限制為小於或等於 300。 視您的需求而定,您可以在商務資料目錄定義編輯器中刪除複雜類型參數的欄位,而不需要顯示在 Microsoft Office SharePoint Server 中。 或者,您也可以使用所有欄位從 Business 資料目錄 定義編輯器匯出應用程式定義檔,然後在記事本或任何 XML 撰寫應用程式中修改應用程式定義檔案,以刪除不需要的欄位,以便將欄位數目限制為 300。

與自訂網頁元件相關的問題

本節包含需要自訂網頁元件以解決問題的問題。 如需使用自訂網頁元件來解決使用 Oracle E-Business 配接器和 Microsoft Office SharePoint Server 時可能發生的問題的詳細資訊,請參閱 如何搭配 Oracle E-Business Suite 使用自訂網頁元件

問題 1:根據多個值在 Microsoft Office SharePoint Server 中顯示單一記錄的限制

說明:如果您想要根據多個值在 Microsoft Office SharePoint Server 中顯示單一記錄, (輸入參數從 Oracle E-Business Suite) ,您無法在教學課程中,使用三個 Web 元件 (商務資料清單、商務資料項目和商務資料相關清單) 指定的步驟 3:建立 SharePoint 應用程式以從 Oracle E-Business Suite 擷取資料 : 在 SharePoint 網站上呈現 Oracle E-Business Suite 的資料

解決方法:您必須使用自訂網頁元件來執行此動作。 如需使用自訂網頁元件的詳細資訊,請參閱 如何搭配 Oracle E-Business Suite 使用自訂網頁元件。 在本主題的「步驟 1:建立自訂網頁元件」中,您可以在步驟 5 中使用下列程式碼範例。 下列程式碼範例會採用 BankCountry 和 BankKey 作為輸入參數,然後在 Microsoft Office SharePoint Server 中將其顯示為單一記錄。

namespace CustomWebPart  
{  
    public class CustomWebPart : WebPart  
    {  
        private string displayText = "Hello World!";  
  
        [WebBrowsable(true), Personalizable(true)]  
        public string DisplayText  
        {  
            get { return displayText; }  
            set { displayText = value; }  
        }  
        protected override void Render(System.Web.UI.HtmlTextWriter writer)  
        {  
            string BankCountry = "US";  
            string BankKey = "134329042";  
  
/***Step 1: Get the required entity and method.***/  
  
            LobSystem newSystem = ApplicationRegistry.GetLobSystems()["BAPI_BANK_GETDETAIL"]; // Name specified in application definition file  
            LobSystemInstance newSystemInstance = newSystem.GetLobSystemInstances()["BAPI_BANK_GETDETAIL_Instance"]; // Name specified in application definition file  
            Entity CategoryEntity = newSystem.GetEntities()["Entity"]; // Name specified in application definition file  
            Method newMethod = CategoryEntity.GetMethods()["BAPI_BANK_GETDETAIL"]; // Name specified in application definition file  
            MethodInstance methodInstance = newMethod.GetMethodInstances()["MethodInstance"]; // Name specified in application definition file  
  
/***Step 2: Get the list of input parameters.***/  
  
            Object[] args = methodInstance.GetMethod().CreateDefaultParameterInstances(methodInstance); //Get the default values of the input parameters.  
            Object[] ArgsInput = new Object[args.Length];  
  
/***Step 3: Assign them required values.***/  
  
            Type t = null;  
            char[] myString = BankCountry.ToCharArray();  
            String s = new String(myString);  
            t = s.GetType();  
            ArgsInput[0] = Activator.CreateInstance(t, myString);  
  
            myString = BankKey.ToCharArray();  
            s = new String(myString);  
            t = s.GetType();  
            ArgsInput[1] = Activator.CreateInstance(t, myString);  
  
/***Step 4: Execute the particular method instance using the required value.***/  
  
            IEntityInstance IE = (IEntityInstance)CategoryEntity.Execute(methodInstance, newSystemInstance, ref ArgsInput); //Method instance of type Specific Finder is being used here.  
  
/***Step 5: Display the output on the custom Web Part in Microsoft Office SharePoint Server.***/  
  
            writer.Write("<table>");  
            writer.Write("<tr>");  
            foreach (Field f in CategoryEntity.GetFinderView().Fields)  
            {  
                writer.Write("<td>");  
                writer.Write(IE[f]);  
                writer.Write("</td>");  
            }  
            writer.Write("</tr>");  
            writer.Write("</table>");  
        }  
    }  
  

注意

應用程式定義檔必須包含 特定的 Finder 方法實例。 特定 Finder方法會根據識別碼尋找特定記錄。 For information about creating a Specific Finder method instance, see “Requirement 2: Retrieve Details for a Specific Customer from the List of Customers” in Step 2: Create an application definition file for the Oracle E-Business Suite artifacts in Tutorial: Present data from Oracle E-Business Suite on a SharePoint Site.

問題 2:無法指定陣列元素的值

說明:如果 WCF 服務的輸入參數是陣列,您無法使用使用 Business 資料目錄 定義編輯器所建立的應用程式定義檔中所定義的篩選,指定陣列元素的值。 這表示您無法使用 Microsoft Office SharePoint Server 中的商務資料清單或商務資料項目網頁元件來指定這些輸入參數的值, (陣列) 至 WCF 服務的專案。 這是因為陣列在應用程式定義檔中定義的方式。

解決方案:使用自訂網頁元件將值指派給陣列元素。 如需使用自訂網頁元件的詳細資訊,請參閱 如何搭配 Oracle E-Business Suite 使用自訂網頁元件。 例如,您可以使用「問題 1:在 Microsoft Office SharePoint Server 中根據多個值顯示單一記錄的限制」中的步驟 3 中的下列程式碼範例,將值指派給陣列元素。

/***Assign required values to parameters of type array.***/   
/***Assumption is that the ith parameter of Method is of type Array and all the simple type elements in the array are of string type.***/  
  
            Type t = asm.GetType(args[i].GetType().ToString()); // Get type of the parameter  
            Type TElement = t.GetElementType(); // Getting type of element of array  
            int index = 5; //Size of Array  
            Array ElementArray = Array.CreateInstance(TElement, index); //Creating an array of length: index  
  
            for (int ind = 0; ind < index; ind++)  
            {  
                //Creating an instance of an element of array  
                object ElementType = Activator.CreateInstance(TElement);  
                FieldInfo[] FI = ElementType.GetType().GetFields();  
                for (int f = 0; f \< FI.Length; f++)  
                {  
                    ElementType.GetType().GetFields()[f].SetValue(ElementType, (Object)"ElementValue");  
                }  
                ElementArray.SetValue(ElementType, ind);  
            }  
  
            ArgsInput[i] = (object)ElementArray; // As shown in sample, ArgsInput is fed as input while executing Method Instance  
  

問題 3:將 Null 值指定為複雜類型參數的限制

說明:如果您未為 Microsoft Office SharePoint Server 中的網頁元件中的複雜類型參數指定任何值,則 Null 應該以複雜類型參數的值傳遞至 WCF 服務。 不過,會針對複雜類型參數傳遞非 Null 值,並針對其子項目傳遞 Null, (簡單類型) 。 這會導致預期的訊息架構與傳遞至 WCF 服務的訊息架構不符。 因此,Oracle E-Business 配接器可能會顯示錯誤訊息。

注意

若要在 Microsoft Office SharePoint Server 中的網頁元件未傳遞任何值時找出複雜類型參數的預設值,請使用「問題 1:限制在 Microsoft Office SharePoint Server 中根據多個值顯示單一記錄」中所述的程式碼範例中的步驟 2。

解決方案:使用自訂網頁元件將 Null 值指派給複雜類型參數。 如需使用自訂網頁元件的詳細資訊,請參閱 如何搭配 Oracle E-Business Suite 使用自訂網頁元件

另請參閱

搭配 SharePoint 使用 Oracle E-Business Suite 配接器