简体   繁体   English

使用basichttpBinding和流的transfermode的WCF中出现错误请求

[英]error Bad Request in WCF using basichttpBinding with transfermode of streamed

Im Having a problem consuming my WCF service, first i tried to consume my wcf without adding service reference, and i use channelfactory to consume it when i use basichttpbinding and transfermode of buffered it works fine but when i use streamed as transfermode it give error Bad Request 我在使用WCF服务时遇到问题,首先我尝试使用wcf而不添加服务引用,并且当我使用basichttpbinding和缓冲的transfermode时,我使用channelfactory来使用它,效果很好,但是当我使用流式传输作为transfermode时,它给出错误错误请求

Here's where i call my service please take a look thanks in advance 我在这里打电话给我的服务,请提前看看谢谢

public static BasicHttpBinding basicHttpBinding()
    {
        BasicHttpBinding BasicHttpBinding_IService1 = new BasicHttpBinding();
        BasicHttpBinding_IService1.CloseTimeout = TimeSpan.Parse("00:01:00");
        BasicHttpBinding_IService1.OpenTimeout = TimeSpan.Parse("00:01:00");
        BasicHttpBinding_IService1.ReceiveTimeout = TimeSpan.Parse("00:10:00");
        BasicHttpBinding_IService1.SendTimeout = TimeSpan.Parse("00:01:00");
        BasicHttpBinding_IService1.AllowCookies = false;
        BasicHttpBinding_IService1.BypassProxyOnLocal = false;
        BasicHttpBinding_IService1.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
        BasicHttpBinding_IService1.MaxBufferSize = 2147483646;
        BasicHttpBinding_IService1.MaxBufferPoolSize = 524288;
        BasicHttpBinding_IService1.MaxReceivedMessageSize = 2147483646;
        BasicHttpBinding_IService1.MessageEncoding = WSMessageEncoding.Text;
        BasicHttpBinding_IService1.UseDefaultWebProxy = true;
        BasicHttpBinding_IService1.TextEncoding = UTF8Encoding.UTF8;
        BasicHttpBinding_IService1.TransferMode = TransferMode.Streamed;


        return BasicHttpBinding_IService1;
    }

    public static EndpointAddress endPointAddress()
    {
        EndpointAddress endpointAddress = new   EndpointAddress("http://localhost:5409/IService.svc");

        return endpointAddress;
    }


private void button1_Click(object sender, EventArgs e)

    {
        ChannelFactory<IService> myChannelFactory = null;
        myChannelFactory = new ChannelFactory<IService>(basicHttpBinding(), endPointAddress());
        IService client =  myChannelFactory.CreateChannel();
        MessageBox.Show(client.GetData(1));
    }

The TransferMode of Streamed is not supported by the ASP.NET development server. ASP.NET开发服务器不支持StreamedTransferMode

Use IIS or Self-Host the WCF Service to get around it. 使用IIS或自托管WCF服务即可解决该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WCF HttpTransport:流式传输与缓冲的TransferMode - WCF HttpTransport: streamed vs buffered TransferMode 如何将自定义对象序列化为流(WCF HttpBinding-TransferMode =流式) - How to seralize custom objects into stream (WCF HttpBinding - TransferMode = Streamed) TransferMode = Streamed时发生TimeoutException - TimeoutException when TransferMode=Streamed NetTcpBinding()与TransferMode.Streamed - NetTcpBinding() with TransferMode.Streamed 从wcf绑定transferMode从“Buffered”更改为“Streamed”是否被认为是客户端的重大变化? - Is changing from wcf binding transferMode from “Buffered” to “Streamed” considered a breaking change for the client? WCF:通过netTcpBinding通过TransferMode = Streamed将文件传输到服务器时,对客户端的响应延迟 - WCF: response to client delayed when transferring file to server with TransferMode=Streamed over netTcpBinding 具有TransferMode = Streamed的WCF REST客户端-记录整个(“原始”)http请求/响应 - WCF REST client with TransferMode=Streamed - logging entire (“raw”) http requests/responses 使用BasicHttpBinding进行身份验证的WCF服务 - WCF service with authentication using BasicHttpBinding 使用请求侦听器对 BasicHttpBinding 进行身份验证 - Authentication for BasicHttpBinding using Request Hearder Windows Phone错误处理:具有BasicHttpBinding和TransportWithMessageCredential的WCF - Windows Phone Error Handling: WCF with BasicHttpBinding and TransportWithMessageCredential
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM