【问题标题】:WCF service for Sl3Sl3 的 WCF 服务
【发布时间】:2009-10-10 23:18:42
【问题描述】:

我编写了一个上传和下载 XML 文件的简单服务。我想在 Silverlight 3 项目中实现它,但这样做时会收到以下警告:

**警告 1 自定义工具警告:地址“http://tony-pc/xmlLoadService/Service.svc”的端点“BasicHttpBinding_IxmlLoad”与 Silverlight 3 不兼容。正在跳过...
**

**警告 2 自定义工具警告:未找到与 Silverlight 3 兼容的端点。除非通过构造函数提供端点信息,否则生成的客户端类将不可用。
**

虽然我的 web.config 文件中有以下端点配置:

      <bindings>
     <basicHttpBinding>
    <binding name="basicHTTP" 
             receiveTimeout="00:10:00" 
             sendTimeout="00:10:00" 
             closeTimeout="00:10:00" 
             openTimeout="00:03:00" 
             messageEncoding="Mtom" 
             maxBufferSize="100000" 
             maxReceivedMessageSize="100000" 
             transferMode="StreamedResponse">
    </binding>
 </basicHttpBinding>
    </bindings>
    <services>
<service behaviorConfiguration="mexBehavior" name="LoadXMLService.XMLOperations">
    <endpoint address="" 
              binding="basicHttpBinding" 
              bindingConfiguration="basicHTTP" 
              contract="LoadXMLService.IxmlLoad" />
        </service>
    </services>

我的服务托管在 IIS 7.0 中。

谁能帮我看看有什么问题?

托尼

【问题讨论】:

    标签: wcf silverlight-3.0


    【解决方案1】:

    我不是 Silverlight 方面的专家,但我很确定这两个配置条目之一是罪魁祸首:

    messageEncoding="Mtom" 
    

    尝试:messageEncoding="Text"。

    transferMode="StreamedResponse"
    

    尝试:transferMode="Buffered"。

    您能否尝试使用其他值,看看这是否是麻烦制造者?

    马克

    【讨论】:

    • 很酷,但没有这些,我还能通过该服务上传和下载文件吗?
    • 当然 - 直到您的绑定中定义的 MaxReceivedMessageSize 参数。
    猜你喜欢
    • 1970-01-01
    • 2011-04-22
    • 2011-03-02
    • 1970-01-01
    • 2011-04-27
    • 1970-01-01
    • 2011-02-18
    • 1970-01-01
    • 2012-01-14
    相关资源
    最近更新 更多