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