0
私のプロジェクトの1つにServiceReferenceを追加しました。このサービスが.netで作成されているかどうかは不明です。操作の1つを実行すると、この要素はヌル値でいっぱいです。私はフィドラーでチェックして、データの応答が正しく入力されています。なぜあなたはこれが起こっているのか考えていますか?自動生成されたSoapクライアントがレスポンスを解析していない
SoapResponse構造:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<searchOrderResponse xmlns="http://xml.comcast.com/nationalaccountsportal/services">
<searchOrderReturn>
<ns1:searchResult xsi:type="ns1:OrderDetails" xmlns:ns1="http://xml.comcast.com/nationalaccountsportal/types"> <!-- The data -->
<ns2:searchResult xsi:type="ns2:OrderDetails" xmlns:ns2="http://xml.comcast.com/nationalaccountsportal/types">
自動生成クラス定義:WSDLで
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="searchOrderResponse", WrapperNamespace="http://xml.comcast.com/nationalaccountsportal/services", IsWrapped=true)]
internal partial class searchOrderResponse {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://xml.comcast.com/nationalaccountsportal/services", Order=0)]
[System.Xml.Serialization.XmlElementAttribute("searchOrderReturn")]
public OrderDetails[] searchOrderReturn;
public searchOrderResponse() {
}
public searchOrderResponse(OrderDetails[] searchOrderReturn) {
this.searchOrderReturn = searchOrderReturn;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1590.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://xml.comcast.com/nationalaccountsportal/types")]
public partial class OrderDetails : object, System.ComponentModel.INotifyPropertyChanged {
searchOrderResponse定義:
<element name="searchOrderResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="searchOrderReturn" type="tns1:OrderDetails"/>
</sequence>
</complexType>
</element>
ありがとう!
が空の奇妙な実装のような音役に立てば幸い、行方不明になっただけで一つのクラスでしたリスト、つまりバグのあるサービスです。コレクション全体のNULL値が機能します。 WSDLを見ずに言うのは難しいです。 – Namphibian
こんにちは@Nphphibian、私はwsdlのsearchOrderResponse定義を追加しました。他のすべての定義は、OrderDetailsの配列を直接公開するものを除き、私には標準的なものです。別の配列型応答を持たないため、このサービス内の他の操作との比較を行います –