2
我在Windows Store應用程序中編寫了以下程序。Windows Store應用程序中的mtomMessageEncoding
CustomBinding b = new CustomBinding() ;
TextMessageEncodingBindingElement t = new TextMessageEncodingBindingElement();
HttpTransportBindingElement h = new HttpTransportBindingElement();
b.Elements.Add(t);
b.Elements.Add(h);
MyService client = new MyService(b, new EndpointAddress("http://localhost:8080/"));
var request = ...;
var response = client.Service000(request);
在Service000中,請求消息是Utf-8編碼,但響應消息是Mtom編碼,如下所示。
mime-version: 1.0
Content-Type: Multipart/Related;
boundary=4aa7d814-adc1-47a2-8e1c-07585b9892a4;
type=application/xop+xml;
start=」<[email protected]>」;
startinfo=」application/soap+xml」
--4aa7d814-adc1-47a2-8e1c-07585b9892a4
Content-Type: application/xop+xml; type="application/soap+xml"
charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
<soap:Envelope>
....
</soap:Envelope>
--4aa7d814-adc1-47a2-8e1c-07585b9892a4
Content-Type: image/jpeg;
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
Binary Scan Data
--4aa7d814-adc1-47a2-8e1c-07585b9892a4--
我想通過MtomMwssageEncodeingBindingElement處理響應消息。 但WinRT不支持MtomMwssageEncodeingBindingElement。 有沒有辦法處理Mtom的使用信息?
我遇到了同樣的問題,如何創建自定義編碼器,知道如何解析Windows Store應用程序客戶端的MTOM消息? – hushyon