Oracle データベース上で OData サービスを実行しています。次のようにクエリできます。
http://localhost:4930/Oracle.svc/XXKE_L2E_ADDRESSES_V%28%29?
$filter=PARTY_ID eq 10925&$select=*
その後、すべてが正常に機能します。
次の場合も、すべて正常に動作します (どのフィールドにも null 値が含まれていません)。
http://localhost:4930/Oracle.svc/XXKE_L2E_ADDRESSES_V%28%29?
$filter=PARTY_ID eq 10925&
$select=ADDRESS_ID,PARTY_ID,CITY,ADDRESS1,PARTY_NAME
ただし、次は失敗します (ADDRESS2 は null を含むフィールドです)。
http://localhost:4930/Oracle.svc/XXKE_L2E_ADDRESSES_V%28%29?
$filter=PARTY_ID eq 10925&
$select=ADDRESS_ID,PARTY_ID,CITY,ADDRESS1,PARTY_NAME,ADDRESS2
私が得る応答は次のとおりです。
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="pl-PL">An error occurred while processing this request.</message>
<innererror>
<message>Value cannot be null.
Parameter name: value</message>
<type>System.ArgumentNullException</type>
<stacktrace> at System.Data.Services.WebUtil.CheckArgumentNull[T](T value, String parameterName)
at System.Data.Services.Internal.ProjectedWrapper.set_PropertyNameList(String value)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Data.Services.Internal.ProjectedWrapper.EnumeratorWrapper.MoveNext()
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService)
at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)
at System.Data.Services.DataService`1.HandleRequest()</stacktrace>
</innererror>
</error>
エラーが発生するのはなぜですか? ヌルの問題は何ですか?を指定すると問題なく取得できます$select=*
。この問題を克服するにはどうすればよいですか?
編集:
ここで説明されているのとまったく同じ問題に直面していることがわかった: https://forums.oracle.com/forums/thread.jspa?threadID=2362250。フィールドを削除したので、8 つしかないので、すべてを選択できます。9 つのフィールドがある場合、一度に選択できるフィールドは 6 つだけです。10 個のフィールドがある場合、一度に選択できるフィールドは 3 つだけです。
誰かが解決策を持っていれば、私はそれを感謝します。