文件从ClientBase上载到WCF服务<;T>;

文件从ClientBase上载到WCF服务<;T>;,wcf,wcf-client,Wcf,Wcf Client,我目前正在开发一个解决方案,将文件上传和下载到WCF服务。客户端是从ClientBase继承的类。我已经阅读了StackOverflow和其他网站的流媒体和链接,但我似乎不明白为什么我仍然收到一条消息,消息大小太小。到目前为止,我已经用小文件测试了这个解决方案,它可以正常工作 该服务托管在IIS 7.5中 以下是客户端应用程序中的App.config <system.web> <httpRuntime maxRequestLength="67108864" />

我目前正在开发一个解决方案,将文件上传和下载到WCF服务。客户端是从ClientBase继承的类。我已经阅读了StackOverflow和其他网站的流媒体和链接,但我似乎不明白为什么我仍然收到一条消息,消息大小太小。到目前为止,我已经用小文件测试了这个解决方案,它可以正常工作

该服务托管在IIS 7.5中

以下是客户端应用程序中的App.config

<system.web>
    <httpRuntime maxRequestLength="67108864" />
</system.web>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding messageEncoding="Mtom" transferMode="Streamed" name="LargeFileStreamingHttpBinding"
                     maxBufferSize="65536"
                     maxReceivedMessageSize="2147483647">
                <readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/>
            </binding>

        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost/UpdateService.svc"
                        binding="basicHttpBinding"
                        contract="IUpdateService"
                        name="updateServiceEndpoint"/>

    </client>
</system.serviceModel>

以下是服务器中的相关部分

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

    <services>
        <service name="UpdateService" behaviorConfiguration="UpdateServiceBehavior">
                <endpoint binding="basicHttpBinding" bindingName="LargeFileStreamingWebHttpBinding" contract="IUpdateService"></endpoint>
                <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
        </service>
    </services>

    <behaviors>
        <serviceBehaviors>
                <behavior name="UpdateServiceBehavior" >
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                </behavior>
        </serviceBehaviors>
    </behaviors>

    <bindings>
        <basicHttpBinding>
                <binding messageEncoding="Mtom" transferMode="Streamed" name="LargeFileStreamingWebHttpBinding" 
                                 maxBufferSize="65536" 
                                 maxReceivedMessageSize="2147483647"
                                 />
        </basicHttpBinding>
    </bindings>
</system.serviceModel>

此外,我在服务器和客户端配置中都添加了以下内容:

<system.web>
    <httpRuntime maxRequestLength="2147483647" />
</system.web>

这就是我实例化客户机的方式

public class UpdateClient : ClientBase<IUpdateService>, IUpdateService
{
    public UpdateClient() : base("updateServiceEndpoint") {}
}
public类UpdateClient:ClientBase,IUpdateService
{
public UpdateClient():base(“updateServiceEndpoint”){}
}
你知道我哪里会出错吗?感谢您的帮助


-谢谢

找到了答案-一个非常简单的错误,客户端/端点条目缺少bindingConfiguration属性

服务类名只是“UpdateService”,还是属于某个命名空间?如果是后者,,您需要在
上有完全限定的名称,它才能获取配置。我省略了服务合同名称空间,因为brevityVoted关闭时过于本地化,因为不会有其他人会犯此特定错误,他们将无法通过搜索此问题找到答案。您的问题标题描述了您的想法服务不确定您的问题是什么或问题的性质。建议你更准确地反映你的问题。事实上我同意。我最初认为这个实现的问题是技术性的,但后来发现这是我的一个简单错误。我应该自己关闭/删除这个问题。