我寫在.NET,在一個SOAP信封,將採取該消息,並響應與使用相同架構的SOAP消息接收XML對象的服務的具體架構。例如:獲取SOAP消息:在.NET
請求:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns="http://schemas.mystuff.org/myschema">
<Message>
<Header>...</Header>
<MessageContent>...</MessageContent>
</Message>
</s:Body>
</s:Envelope>
響應:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns="http://schemas.mystuff.org/myschema">
<Message>
<Header>...</Header>
<MessageContent>...</MessageContent>
</Message>
</s:Body>
</s:Envelope>
另外,我想最終沒有與對象的層次,但XML的只是字符串。
當我使用WCF ServiceContracts這樣做,則WCF定義包裝了一層額外爲其生成WSDL服務,例如:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<SendMessageResponse xmlns="http://tempuri.org/">
<SendMessageResult xmlns:a="http://schemas.datacontract.org/2004/07/CxMessageReceiverRole" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Message>
...
</a:Message>
</SendMessageResult>
</SendMessageResponse>
</s:Body>
</s:Envelope>
什麼是對我來說,接收和發送SOAP消息的最佳方式在.NET中,我在控制消息的樣子而不是WCF?如果這不是最好的方式,它不一定是WCF。另外,我不想實現一個完整的類結構來表示我的XML模式,而只是將字符串接收到SOAP主體。
爲什麼你需要控制的郵件是什麼樣子?誰會看他們? – 2011-01-06 21:48:38