私は追跡しようとしている非常に奇妙なバグを持っています。私のコードでは、基本的なWebサービスを呼び出しています。複雑なタイプの特定のパラメータが表示されているという問題は、静的に設定しても、単に設定されていないという問題があります。
コードをデバッグするときに、オブジェクトのプロパティが正しく設定されていることを確認しました。この問題は、SOAPリクエストを生成するときにのみ発生します。私はネットでビルトインされたWebサービスプロキシを使用してSOAPリクエストを生成しています(Visual StudioでWebサービスリファレンスを追加してください)
これに関する助けがあれば大歓迎です。
複合型OrderTransactionで設定されていない要素は次のとおりです。 トレーサード 注文日 updateTime
ここに私が見ているものの例があります:
私はオブジェクトを静的に作成する
orderArray[0] = new OrderTransaction();
次に、このオブジェクトにパラメータを設定します
orderArray[0].tracerId = 47;
私がWebサービスを呼び出すと、このパラメータは複合型から完全に欠落しています。
私の複合型xsdの例を次に示します
ここに私の現在のテストコードがあります:
ZBatch_PublisherService.ItemTransaction[] itemArray = new ItemTransaction[1];
ZBatch_PublisherService.OrderTransaction[] orderArray = new OrderTransaction[1];
itemArray[0] = new ItemTransaction();
itemArray[0].classId = 1153;
itemArray[0].fulfillmentCenterId = 123;
itemArray[0].fulfillmentType = "TEST";
itemArray[0].lineItemId = 597;
itemArray[0].migratedFlag = 0;
itemArray[0].taxAmount = Convert.ToDecimal("7.00");
itemArray[0].sku = "110853852";
itemArray[0].quantity = 1;
itemArray[0].taxService = "CSS";
itemArray[0].totalShippingAmount = Convert.ToDecimal("5.99");
itemArray[0].tracerId = 47;
itemArray[0].trackingNo = "abc2134";
itemArray[0].unitAmount = Convert.ToDecimal("79.99");
itemArray[0].updateTime = Convert.ToDateTime("2011-10-27T17:47:30");
orderArray[0] = new OrderTransaction();
orderArray[0].tracerId = 47;
orderArray[0].customerId = 15;
orderArray[0].cardType = "VISA";
orderArray[0].ccEncryptedFlag = 3;
orderArray[0].chainShortcode = "ABC";
orderArray[0].creditCardNumber = "1234566788";
orderArray[0].customerName = "John Doe";
orderArray[0].expirationMonth = "APR";
orderArray[0].expirationYear = "2014";
orderArray[0].orderDate = Convert.ToDateTime("2011-10-27T17:47:30");
orderArray[0].orderId = 343;
orderArray[0].provinceCode = "AB";
orderArray[0].totalItemTransactions = 1;
orderArray[0].updateTime = Convert.ToDateTime("2011-10-27T17:47:30");
ZBatch_PublisherService.ZBatchPublisherServiceService ws = new ZBatchPublisherServiceService();
ws.saveBatch(orderArray, itemArray);