0
WebサービスにSOAPリクエストを送信できません。注文の詳細を含む注文を作成します。それから私はその注文をウェブサービスに送ります。フィドラーを使用すると、注文が正しく渡されたことがわかりますが、注文の詳細は表示されません。C#トラブルシューティングオブジェクトのシリアル化エラー
orderDetailsを配列の詳細配列から文字列の配列に変更しようとしましたが、要求に正しく表示されました。私も注文の正しい番号を取得します。彼らはただ空です。
どちらのクラスもwsdlから生成されたので、orderDetailが正しくシリアル化されていないように見えません。私はより多くのエラーの詳細を取得する方法を知らない。どんな助けでも大歓迎です。私のWebサービスから生成されたおかげで、私のReference.csから
、:生成されたクラスは、各フィールドの 'を指定' フィールドを持っているよう
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://some.url")]
public partial class order {
private orderDetail[] orderDetailsField;
[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute("orderDetails", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public orderDetail[] orderDetails {
get {
return this.orderDetailsField;
}
set {
this.orderDetailsField = value;
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://some.url")]
public partial class orderDetail {
private int productIDField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int productID {
get {
return this.productIDField;
}
set {
this.productIDField = value;
}
}
}
申し訳ありませんが、さらなる調査の後、この質問はより簡単になる可能性があります。基本的にはorderオブジェクトをシリアライズできますが、orderDetailsオブジェクトをシリアライズすると空のオブジェクトが返されます。彼らは同じように宣言されているようですので、なぜそれが起こるのか、どうやってシリアライゼーションプロセスをデバッグできるのか誰かが知っているのだろうかと思います。 – Tavis
このページのおかげで、シリアル化のデバッグが可能になりました。http://platinumdogs.wordpress.com/2008/02/25/debugging-net-serialization-code/ – Tavis
私は間違っているかもしれませんが、XmlArrayItemAttribute( "orderDetails" 、XmlArrayItemAttribute( "orderDetails"、? –