Magento APIを使用するために、C#でVisual Studio2012RCを介してSOAPを使用しています。これを行うには、SOAPWSDLファイルを指すサービス参照を追加しました。
現在、SalesOrderEntityの配送先住所を取得するのに問題があります。これらのエンティティを取得する方法は次のとおりです。
var f = new filters();
f.filter = new associativeEntity[] {
new associativeEntity {
key ="status",
value ="processing"
}
};
var entities = mservice.salesOrderList(mlogin, f);
これはうまく機能しますが、それらを繰り返して情報の一部を表示すると、何か奇妙なことに遭遇します。
foreach (var entity in entities)
{
//the following line crashes for some strange reason.
//the error is SoapHeaderException: Address not exists.
var info = mservice.customerAddressInfo(mlogin, int.Parse(entity.shipping_address_id));
Debug.WriteLine(info.firstname);
}
配送先住所はではなく0
、実際に適切な番号に設定されています(もちろん、常に番号を表しますが、奇妙な理由で文字列になっています)。
私はここで何が間違っているのですか?