1
我從我在C#創建對象WSDLWSDL:錯誤陣列
<xsd:complexType name="ArrayOfPlentysoapresponsemessage">
<xsd:sequence>
<xsd:element name="item" type="tns:PlentySoapResponseMessage" minOccurs="0" maxOccurs="2" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
生成的代碼是
private PlentySoapResponseMessage[] itemField;
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("PlentySoapResponseMessage", typeof(PlentySoapResponseMessage), IsNullable = false)]
public PlentySoapResponseMessage[] item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
我得到的錯誤從C#是反序列化不工作 的我發現的原因是陣列導致一個問題,因爲當刪除有一個單一的項目,沒有錯誤
這裏的消息
[System.ServiceModel.CommunicationException] = { 「錯誤在反序列化應答消息的主體進行操作\」 GetAuthentificationToken \ 「」}
服務器堆棧跟蹤:
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)