XML RPCをJsonにマッピングする方法はありますか?XML RPCをJSONにマッピング
これは私のエンドポイントでの応答です。
https://download.automation.odin.com/pa/6.0/doc/portal/6.0/ba/index.htm?fileName=75131.htm
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>Result</name>
<value>
<array>
<data>
<value>
<array>
<data>
<!-- OrderID -->
<value>
<i4>16</i4>
</value>
<!-- Order Number -->
<value>
<string>SO000008</string>
</value>
<!-- Vendor Account ID-->
<value>
<i4>1</i4>
</value>
<!-- Customer Account ID-->
<value>
<i4>1000002</i4>
</value>
<!-- Order Status ID-->
<value>
<string>WP</string>
</value>
<!-- Order Type ID-->
<value>
<string>SO</string>
</value>
<!-- Order Creation Time-->
<value>
<i4>1245328433</i4>
</value>
<!-- Order Creation Date-->
<value>
<i4>1245268800</i4>
</value>
<!-- Order Total -->
<value>
<double>85.000000</double>
</value>
<!-- Order Tax Total -->
<value>
<double>0.000000</double>
</value>
<!-- Discount Total -->
<value>
<double>0.000000</double>
</value>
<!-- Order MerchTotal -->
<value>
<double>85.000000</double>
</value>
<!-- Order Description -->
<value>
<string>
Subscription for Plan 3 (Linux Basic) for 1 Year(s).
</string>
</value>
<!-- Order Expiration Date-->
<value>
<i4>1245528000</i4>
</value>
<!-- Promo Code-->
<value>
<string/>
</value>
<!-- Sales Branch ID-->
<value>
<string>2</string>
</value>
<!-- Sales Person ID-->
<value>
<string>1</string>
</value>
<!-- CurrencyID-->
<value>
<string>USD</string>
</value>
<!-- CompletedDate-->
<value>
<i4>1453805121</i4>
</value>
</data>
</array>
</value>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
</params>
しかし、彼らはグループ値マッパーに配列
ように私はWSO2のESBに新しいですし、私はいずれかを見つけることができませんでしたそれに関するドキュメンテーション。
このサービスのXML RPCは、純粋な配列インデックスです。たとえば、OrderID
が['Result'][0][0]
(メンバー、配列、配列)の場合です。
json要素とのバインドに配列インデックスを使用することは可能ですか?
マッパーを使用できない場合はどうすればいいですか?
== UPDATE ==
.dmcファイル
var arrayIndex = 0;
map_S_methodResponse_S_root = function(){
var outputroot={};
var COMPARE_61_0 = '';
var COMPARE_62_0 = '';
var COMPARE_63_0 = '';
var COMPARE_64_0 = '';
var COMPARE_65_0 = '';
var COMPARE_66_0 = '';
var COMPARE_67_0 = '';
var COMPARE_68_0 = '';
var COMPARE_69_0 = '';
var COMPARE_70_0 = '';
var COMPARE_71_0 = '';
var COMPARE_72_0 = '';
var COMPARE_73_0 = '';
var COMPARE_74_0 = '';
var COMPARE_75_0 = '';
var COMPARE_76_0 = '';
var COMPARE_77_0 = '';
var COMPARE_78_0 = '';
var COMPARE_79_0 = '';
var IF_ELSE_23_0 = '';
var IF_ELSE_25_0 = '';
var IF_ELSE_27_0 = '';
var IF_ELSE_29_0 = '';
var IF_ELSE_31_0 = '';
var IF_ELSE_33_0 = '';
var IF_ELSE_35_0 = '';
var IF_ELSE_37_0 = '';
var IF_ELSE_39_0 = '';
var IF_ELSE_41_0 = '';
var IF_ELSE_43_0 = '';
var IF_ELSE_45_0 = '';
var IF_ELSE_47_0 = '';
var IF_ELSE_49_0 = '';
var IF_ELSE_51_0 = '';
var IF_ELSE_53_0 = '';
var IF_ELSE_55_0 = '';
var IF_ELSE_57_0 = '';
var IF_ELSE_59_0 = '';
var count_i_value = 0;
COMPARE_61_0 = (arrayIndex === 0);
COMPARE_62_0 = (arrayIndex === 1);
COMPARE_63_0 = (arrayIndex === 2);
COMPARE_64_0 = (arrayIndex === 3);
COMPARE_65_0 = (arrayIndex === 4);
COMPARE_66_0 = (arrayIndex === 5);
COMPARE_67_0 = (arrayIndex === 6);
COMPARE_68_0 = (arrayIndex === 7);
COMPARE_69_0 = (arrayIndex === 8);
COMPARE_70_0 = (arrayIndex === 9);
COMPARE_71_0 = (arrayIndex === 10);
COMPARE_72_0 = (arrayIndex === 11);
COMPARE_73_0 = (arrayIndex === 12);
COMPARE_74_0 = (arrayIndex === 13);
COMPARE_75_0 = (arrayIndex === 14);
COMPARE_76_0 = (arrayIndex === 15);
COMPARE_77_0 = (arrayIndex === 16);
COMPARE_78_0 = (arrayIndex === 17);
COMPARE_79_0 = (arrayIndex === 18);
outputroot = {};
outputroot.Result = {};
for(i_value in inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value){
IF_ELSE_23_0 = (COMPARE_69_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].double):(IF_ELSE_23_0);
IF_ELSE_25_0 = (COMPARE_70_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].double):(IF_ELSE_25_0);
IF_ELSE_27_0 = (COMPARE_71_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].double):(IF_ELSE_27_0);
IF_ELSE_29_0 = (COMPARE_72_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].double):(IF_ELSE_29_0);
IF_ELSE_31_0 = (COMPARE_62_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_31_0);
IF_ELSE_33_0 = (COMPARE_65_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_33_0);
IF_ELSE_35_0 = (COMPARE_66_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_35_0);
IF_ELSE_37_0 = (COMPARE_73_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_37_0);
IF_ELSE_39_0 = (COMPARE_75_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_39_0);
IF_ELSE_41_0 = (COMPARE_76_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_41_0);
IF_ELSE_43_0 = (COMPARE_77_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_43_0);
IF_ELSE_45_0 = (COMPARE_78_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].string):(IF_ELSE_45_0);
IF_ELSE_47_0 = (COMPARE_61_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_47_0);
IF_ELSE_49_0 = (COMPARE_63_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_49_0);
IF_ELSE_51_0 = (COMPARE_64_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_51_0);
IF_ELSE_53_0 = (COMPARE_67_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_53_0);
IF_ELSE_55_0 = (COMPARE_68_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_55_0);
IF_ELSE_57_0 = (COMPARE_74_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_57_0);
IF_ELSE_59_0 = (COMPARE_79_0)?(inputmethodResponse.params.param.value.struct.member.value.array.data.value.array.data.value[i_value].i4):(IF_ELSE_59_0);
outputroot.Result.OrderID = IF_ELSE_47_0;
outputroot.Result.OrderNumber = IF_ELSE_31_0;
outputroot.Result.VendorAccountID = IF_ELSE_49_0;
outputroot.Result.AccountID = IF_ELSE_51_0;
outputroot.Result.OrderStatusID = IF_ELSE_33_0;
outputroot.Result.OrderTypeID = IF_ELSE_35_0;
outputroot.Result.CreationTime = IF_ELSE_53_0;
outputroot.Result.CreationDate = IF_ELSE_55_0;
outputroot.Result.CompletedDate = IF_ELSE_59_0;
outputroot.Result.ExpirationDate = IF_ELSE_57_0;
outputroot.Result.CurrencyID = IF_ELSE_45_0;
outputroot.Result.OrderTotal = IF_ELSE_23_0;
outputroot.Result.TaxTotal = IF_ELSE_25_0;
outputroot.Result.DiscountTotal = IF_ELSE_27_0;
outputroot.Result.MerchTotal = IF_ELSE_29_0;
outputroot.Result.Description = IF_ELSE_37_0;
outputroot.Result.PromoCode = IF_ELSE_39_0;
outputroot.Result.SalesBranchID = IF_ELSE_41_0;
outputroot.Result.SalesPersonID = IF_ELSE_43_0;
count_i_value++;
}
return outputroot;
};
arrayIndex = function(val){ arrayIndex++;};
私が変更した後、それは(COMPARE_61_0)、例えば、働いていましたか? for(count_i_value == 0)?内部のために。
それはかなりうまく働いたが、最初の呼び出しの後に、それは空のオブジェクトを返します。 –
マッピング設定ファイル(.dmc)を共有できます – Palle
質問を生成されたdmcファイルで更新します –