Search code examples
pythonc#wcfzeep

SOAP(C# WCF) receive list of integer as argument via Zeep


Here is my python script

request_data = {"request": {"PromoteRequestIds": [1, 2]}}
result = client.service.DeletePromoteRequests(**request_data)

In C# WCF.

public DeletePromoteRequestsResponse DeletePromoteRequests(
    DeletePromoteRequestsRequest request) 
{
    ...
}

The parameter object in WCF is defined as


[DataContract]
public class DeletePromoteRequestsRequest 
{
    
    [DataMember]
    public List<long> PromoteRequestIds { get; set; }
}

However, I don't understand why the PromoteRequestIds only contains one element [1] instead of [1, 2].


Solution

  • Regarding your question, I found a reference that may be useful to you:Convert python array of int to SOAP ArrayofInt.