Softlayerのガイドラインに記載されているように、wsdlを使用してAPIメソッドをインポートしたC#アプリケーションがあります。 Container_Product_Order_Virtual_Guest_Upgrade構造体をProduct_Orderサービスに渡して、仮想ゲストを編集しています。Product_Order verifyOrder APIがguest_disksを追加するときに失敗する
guest_disksの商品価格IDを追加する場合を除いて、すべての機能が有効です。約6-7秒後に次の例外がスローされます。 "リクエストが中止されました:接続が予期せず閉じられました。 これは、verifyOrderメソッドとplaceOrderメソッドの両方で発生します。
ゲストディスクの値が有効であることを確認するために、Virtual_Guest :: getUpgradeItemPricesをチェックしました(VMの無効なitempriceIdsを渡すと、上記のような一般的な例外ではなく特定のエラー応答が返されます) 。
私はguest_disksを除くすべてのものをアップグレードできる理由を私に知らせるドキュメントの詳細は見つかりません。
EDIT:要求されたとして 剥奪コード:ここで
SoftLayer_Virtual_Guest[] _VMtoEditList = new SoftLayer_Virtual_Guest[1] { -- Vm instance details are retrieved from SL according to the passed VM ID; };
List<SoftLayer_Product_Item_Price> _itemPriceList = new List<SoftLayer_Product_Item_Price>();
foreach (-- collection of properties to be upgraded)
{
SoftLayer_Product_Item_Category _category = new SoftLayer_Product_Item_Category();
_category.categoryCode = -- retrieved from the collection on which I iterate (eg "guest_disk0", "ram", etc.);
SoftLayer_Product_Item_Price _itemPrice = new SoftLayer_Product_Item_Price();
_itemPrice.id = -- the item priceID for the current item;
_itemPrice.idSpecified = true;
_itemPrice.categories = new SoftLayer_Product_Item_Category[1] { _category };
_itemPriceList.Add(_itemPrice);
}
SoftLayer_Product_Item_Price[] _itemPricesArray = _itemPriceList.ToArray();
SoftLayer_Container_Product_Order_Property _property1 = new SoftLayer_Container_Product_Order_Property();
_property1.name = "NOTE_GENERAL";
_property1.value = -- order's description;
SoftLayer_Container_Product_Order_Property _property2 = new SoftLayer_Container_Product_Order_Property();
_property2.name = "MAINTENANCE_WINDOW";
_property2.value = "now";
// Build SoftLayer_Container_Product_Order_Property
SoftLayer_Container_Product_Order_Property[] properties = new SoftLayer_Container_Product_Order_Property[2] { _property1, _property2 };
-- create container
SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade _upgradeContainer = new SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade();
_upgradeContainer.virtualGuests = _VMtoEditList;
_upgradeContainer.prices = _itemPricesArray;
_upgradeContainer.properties = properties;
_upgradeContainer.packageId = 46;
_upgradeContainer.packageIdSpecified = true;
SoftLayer_Product_OrderService service = new SoftLayer_Product_OrderService();
-- authentication structure is created here
SoftLayer_Container_Product_Order _verifiedOrder = service.verifyOrder(_upgradeContainer);
service.placeOrder(_verifiedOrder, false);
を助けている場合、あなたのコードを含めてもらえ教えてください? – Toxantron