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