【问题标题】:Silverlight - WCF errorSilverlight - WCF 错误
【发布时间】:2013-10-02 13:34:13
【问题描述】:

我通过silver light应用程序消费WCF服务时出现问题,今天突然出现问题,同一段代码在1个月前运行成功, 我遇到了以下异常:

{System.ServiceModel.ProtocolException: The content type multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:22bb2c0b-5a1b-498d-9539-a19fa401d509+id=6";start-info="text/xml" of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 626 bytes of the response were: '
--uuid:22bb2c0b-5a1b-498d-9539-a19fa401d509+id=6
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><LargeImageResponse xmlns="http://tempuri.org/"><LargeImageResult xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:int>1</a:int><a:int>2</a:int><a:int>3</a:int><a:int>4</a:int></LargeImageResult></LargeImageResponse></s:Body></s:Envelope>
--uuid:22bb2c0b-5a1b-498d-9539-a19fa401d509+id=6--
'.
   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
   at AbdenTestSilverlight.FileIndexingService.FileIndexingServiceClient.FileIndexingServiceClientChannel.EndLargeImage(IAsyncResult result)
   at AbdenTestSilverlight.FileIndexingService.FileIndexingServiceClient.AbdenTestSilverlight.FileIndexingService.IFileIndexingService.EndLargeImage(IAsyncResult result)
   at AbdenTestSilverlight.FileIndexingService.FileIndexingServiceClient.OnEndLargeImage(IAsyncResult result)
   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}

【问题讨论】:

    标签: wcf silverlight protocolexception


    【解决方案1】:

    Content-Type: application/xop+xml; 建议将 wcf 服务配置为在 Silverlight 不支持的服务器上使用 MTOM 编码。

    除非最近端点发生更改导致此错误,否则我不确定这如何能早些工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-27
      • 1970-01-01
      • 1970-01-01
      • 2011-08-27
      • 1970-01-01
      • 2011-11-15
      • 2014-01-02
      相关资源
      最近更新 更多