2016-05-06 12 views
1

クライアント側でリクエストを作成するにはWebサービスを実装する必要があります。複数のEsc要素は、他の要素と同じレベルにある必要があります。リストを使用すると、Escの下にある要素のリストが作成されます。どんな助けもありがとうございます。WCF - 同じ名前のリクエストで複数の要素を作成する方法

XML request

答えて

1

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Xml; 
using System.Xml.Linq; 

namespace ConsoleApplication1 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      XNamespace ns = "abc"; 
      XElement request = new XElement(ns + "Request", new object[] { 
       new XElement(ns + "Cont"), 
       new XElement(ns + "Lea"), 
       new XElement(ns + "Deal"), 
       new XElement(ns + "Esc"), 
       new XElement(ns + "Esc"), 
       new XElement(ns + "Esc"), 
       new XElement(ns + "Esc"), 
       new XElement(ns + "Esc"), 
       new XElement(ns + "Part"), 
       new XElement(ns + "Veh") 
      }); 
     } 
    } 
} 
これを試してみてください
関連する問題