我需要能夠操縱一個XML像這樣一個模式:操作XML的XDocument XmlDocument的C#
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<SOAP-ENVELOPE:Envelope xmlns:SOAP-ENVELOPE='http://schemas.xmlsoap.org/soap/envelope/'>
<SOAP-ENVELOPE:Header>
<Authorization>
<FromURI/>
<User/>
<Password/>
<TimeStamp/>
</Authorization>
<Notification>
<NotificationURL/>
<NotificationExpiration/>
<NotificationID/>
<MustNotify/>
</Notification>
</SOAP-ENVELOPE:Header>
<SOAP-ENVELOPE:Body SOAP-ENVELOPE:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
</SOAP-ENVELOPE:Body>
我需要添加數據FromURI,用戶,密碼,NotificiationURL,MustNotify等,並在身體內我門坎需要動態地添加:
<SOAPSDK4:APIOperation xmlns:SOAPSDK4="http://www.someserver.com/message/">
</SOAPSDK4:APIOperation>
要最終構建所需要的Web服務,但可以使用XD輕鬆完成APIOperation內構造用於創建一棵樹。
我一直在尋找關於如何操縱信封內的數據一週的信息的麻煩,在這裏我需要這樣做與樹不同的水平。
正如你所說,使用XDocument的構造非常簡單。你有什麼問題? –
我有麻煩添加數據到標題部分到每個元素。 然後,我需要能夠在APIOperation部分創建任意數量的具有它的結構的項目,我不完全確定如何使用XDocument來完成此操作,這就是爲什麼我現在正在使用XmlDocument一塊一塊地創建。 – Elder
「我有麻煩」一點也不清楚。如果你能提供更多細節,我們可能會幫助你更多。 –