我对C#非常陌生,我添加了一个服务参考。所以我在这里要做的是在一个方法中传递三个值,两个参数是字符串,我知道它的值。但是第三个参数写为:
public FM2CRM.CRMTicketService.TicketCRMCreateOrUpdateRequest[] TicketCRMRequest {
get {
return this.TicketCRMRequestField;
}
set {
if ((object.ReferenceEquals(this.TicketCRMRequestField, value) != true)) {
this.TicketCRMRequestField = value;
this.RaisePropertyChanged("TicketCRMRequest");
}
}
}
在这里,我无法理解它接受什么样的数据。以及如何在此参数中传递值。
在ticketCRMCreateorUpdateRequest类中:
public partial class TicketCRMCreateOrUpdateRequest : FM2CRM.CRMTicketService.TicketBase {
[System.Runtime.Serialization.OptionalFieldAttribute()]
private FM2CRM.CRMTicketService.FileRequest[] AllegatiField;
[System.Runtime.Serialization.DataMemberAttribute()]
public FM2CRM.CRMTicketService.FileRequest[] Allegati {
get {
return this.AllegatiField;
}
set {
if ((object.ReferenceEquals(this.AllegatiField, value) != true)) {
this.AllegatiField = value;
this.RaisePropertyChanged("Allegati");
}
}
}
任何机构都可以帮助您传递TicketCRMRequest
中的值吗?提前致谢。
更新:
这是我完整的课程:
public void UpdateCRMTickets() {
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
CRMTicketServiceClient ticketClient = new CRMTicketServiceClient();
GetTicketCRMRequest CRMticketRequest = new GetTicketCRMRequest();
CRMticketRequest.Sorgente = "FM";
CRMticketRequest.TicketIDCRM = "CRM000000340 ";
GetTicketCRMResponse ticketResponse = ticketClient.GetTicketCRM(CRMticketRequest);
TicketCRMCreateOrUpdateRequest ticketCRMRequest = new TicketCRMCreateOrUpdateRequest();
CreateOrUpdateTicketCRMRequest updateticketRequests = new CreateOrUpdateTicketCRMRequest();
ticketCRMRequest.Allegati = FM2CRM.CRMTicketService.File[0];
updateticketRequests.Sorgente = "FM";
updateticketRequests.TicketCRMRequest = TicketCRMCreateOrUpdateRequest(ticketResponse);
updateticketRequests.DateTime = DateTime.Now;
CreateOrUpdateTicketCRMResponse updateticketResponse = ticketClient.CreateOrUpdateTicketCRM(updateticketRequests);
}