2011-04-27 33 views

回答

0

今天我在試圖理解如何添加一些附件到SOAP消息時發現你的問題。在我的要求中,我有示例SOAP,其中<inc:Include href="cid:SOMEXML" xmlns:inc="http://www.w3.org/2004/08/xop/include"/>和我必須實現可以使用這些請求的服務。我在WSE方面沒有經驗,所以對我來說XopDocument在那裏的用途很有意思。
我使用WCF配置解決了我的問題。我設置messageEncoding="Mtom"

<basicHttpBinding> 
    <binding messageEncoding="Mtom" /> 
    </basicHttpBinding> 

和我DataContract有byte[]財產。

[DataContract] 
public class RootObject 
{ 
    [DataMember] 
    public byte[] SOMEXML { get; set; } 
} 

在SOAP請求,它看起來像

<xop:Include href="cid:http%3A%2F%2Ftempuri.org%2F1%2F634654497430144369" xmlns:xop="http://www.w3.org/2004/08/xop/include"/> 

一般來說它是什麼,我想找到的。