我正在开发一个连接到旧Java Axis服务的应用程序。我已经添加了对它们给我的WSDL的引用,它会自动生成类,并且我正在使用提供的方法和类。
该请求工作正常,Fiddler向我展示了响应是来自另一端的,但方法运行后,我的对象始终为null。我知道反序列化存在问题,但我不知道在哪里。
这是WSDL参考自动生成的代码:
namespace ListaMsgsDisponiveisProxy {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://xmlns.oracle.com/ASTrafegoWS/ListaMsgDisponiveis/listaMsgDisponiveisProces" +
"s", ConfigurationName="ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess")]
public interface listaMsgDisponiveisProcess {
// CODEGEN: Gerando contrato de mensagem porque a operação process não é RPC nem documento codificado.
[System.ServiceModel.OperationContractAttribute(Action="process", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
ListaMsgsDisponiveisProxy.processResponse process(ListaMsgsDisponiveisProxy.processRequest request);
[System.ServiceModel.OperationContractAttribute(Action="process", ReplyAction="*")]
System.Threading.Tasks.Task<ListaMsgsDisponiveisProxy.processResponse> processAsync(ListaMsgsDisponiveisProxy.processRequest request);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://xmlns.oracle.com/ASTrafegoWS/ListaMsgDisponiveis/listaMsgDisponiveisProces" +
"s")]
public partial class process : object, System.ComponentModel.INotifyPropertyChanged {
private string inputField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Order=0)]
public string input {
get {
return this.inputField;
}
set {
this.inputField = value;
this.RaisePropertyChanged("input");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[DataContract(Name = "MsgDisponivel")]
public partial class ListaMsgDisponiveisMsgDisponivel : object, System.ComponentModel.INotifyPropertyChanged {
private long trkIdInField;
private string tipoDocumentoField;
private string nmeEmpresaOrigemField;
private string dtaHoraDispField;
private long totalBytesField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public long trkIdIn {
get {
return this.trkIdInField;
}
set {
this.trkIdInField = value;
this.RaisePropertyChanged("trkIdIn");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=1)]
public string tipoDocumento {
get {
return this.tipoDocumentoField;
}
set {
this.tipoDocumentoField = value;
this.RaisePropertyChanged("tipoDocumento");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public string nmeEmpresaOrigem {
get {
return this.nmeEmpresaOrigemField;
}
set {
this.nmeEmpresaOrigemField = value;
this.RaisePropertyChanged("nmeEmpresaOrigem");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=3)]
public string dtaHoraDisp {
get {
return this.dtaHoraDispField;
}
set {
this.dtaHoraDispField = value;
this.RaisePropertyChanged("dtaHoraDisp");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=4)]
public long totalBytes {
get {
return this.totalBytesField;
}
set {
this.totalBytesField = value;
this.RaisePropertyChanged("totalBytes");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class processRequest {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://xmlns.oracle.com/ASTrafegoWS/ListaMsgDisponiveis/listaMsgDisponiveisProces" +
"s", Order=0)]
public ListaMsgsDisponiveisProxy.process process;
public processRequest() {
}
public processRequest(ListaMsgsDisponiveisProxy.process process) {
this.process = process;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class processResponse {
[System.Xml.Serialization.XmlArrayItemAttribute("MsgDisponivel", IsNullable=false)]
public ListaMsgsDisponiveisProxy.ListaMsgDisponiveisMsgDisponivel[] ListaMsgDisponiveis;
public processResponse() {
}
public processResponse(ListaMsgsDisponiveisProxy.ListaMsgDisponiveisMsgDisponivel[] ListaMsgDisponiveis) {
this.ListaMsgDisponiveis = ListaMsgDisponiveis;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface listaMsgDisponiveisProcessChannel : ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class listaMsgDisponiveisProcessClient : System.ServiceModel.ClientBase<ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess>, ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess {
public listaMsgDisponiveisProcessClient() {
}
public listaMsgDisponiveisProcessClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public listaMsgDisponiveisProcessClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public listaMsgDisponiveisProcessClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public listaMsgDisponiveisProcessClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
ListaMsgsDisponiveisProxy.processResponse ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess.process(ListaMsgsDisponiveisProxy.processRequest request) {
return base.Channel.process(request);
}
public ListaMsgsDisponiveisProxy.ListaMsgDisponiveisMsgDisponivel[] process(ListaMsgsDisponiveisProxy.process process1) {
ListaMsgsDisponiveisProxy.processRequest inValue = new ListaMsgsDisponiveisProxy.processRequest();
inValue.process = process1;
ListaMsgsDisponiveisProxy.processResponse retVal = ((ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess)(this)).process(inValue);
return retVal.ListaMsgDisponiveis;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
System.Threading.Tasks.Task<ListaMsgsDisponiveisProxy.processResponse> ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess.processAsync(ListaMsgsDisponiveisProxy.processRequest request) {
return base.Channel.processAsync(request);
}
public System.Threading.Tasks.Task<ListaMsgsDisponiveisProxy.processResponse> processAsync(ListaMsgsDisponiveisProxy.process process) {
ListaMsgsDisponiveisProxy.processRequest inValue = new ListaMsgsDisponiveisProxy.processRequest();
inValue.process = process;
return ((ListaMsgsDisponiveisProxy.listaMsgDisponiveisProcess)(this)).processAsync(inValue);
}
}
}
这是来自服务的响应xml
HTTP/1.1 200 OK
Date: Wed, 19 Sep 2018 18:15:36 GMT
Server: Oracle-Application-Server-11g/11.1.1.4.0 Oracle-HTTP-Server
X-Powered-By: Servlet/2.5 JSP/2.1
Content-Length: 47497
Keep-Alive: timeout=15, max=500
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<wsa:MessageID>urn:01C83A90BC3811E8BFD64D5102C1CDE5</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo><wsa:FaultTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:FaultTo></env:Header><env:Body
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><ListaMsgDisponiveis>
<MsgDisponivel><trkIdIn>201808163803642</trkIdIn>
<tipoDocumento>EXTRATO</tipoDocumento><nmeEmpresaOrigem>BANCO BRADESCO S.A.
</nmeEmpresaOrigem><dtaHoraDisp>2018-08-16T07:06:35.000-03:00</dtaHoraDisp>
<totalBytes>1452</totalBytes></MsgDisponivel><MsgDisponivel>
<trkIdIn>201808184399149</trkIdIn><tipoDocumento>CONTA CORRENTE -
EXTRATO</tipoDocumento><nmeEmpresaOrigem>BANCO BRADESCO S.A.
</nmeEmpresaOrigem><dtaHoraDisp>2018-08-18T06:51:06.000-03:00</dtaHoraDisp>
<totalBytes>968</totalBytes></MsgDisponivel></ListaMsgDisponiveis>
</env:Body></soapenv:Envelope>
我不能要求开发人员进行任何更改,因为它们根本没有帮助。我需要在WCF应用程序上执行此操作。有谁知道可能导致此错误的原因?
谢谢!