0
我想使用soap请求发送对象列表。我可以传递一个对象到肥皂请求中,就像我会传递一个字符串或一个int?将对象传递给soap请求
public class Customer
{
public string Name {set;get;}
}
string field1 ="Hello";
List<Customer> p = new List<Customer>();
p.Add(new details() { Name ="XXXX" });
p.Add(new details() { Name ="YYYY" });
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Sample xmlns="http://tempuri.org/">
<Stringfield1>field1</Stringfield1>
<ObjectField>p</ObjectField> //Passing the List of CUstomer
</Sample >
</soap12:Body>
</soap12:Envelope>
通常情况下,您有一个代理服务器负责为您提供Soapy详细信息,但是如果您要自己创建XML,则必须知道服务如何预期您的客户列表被格式化。 – Crowcoder