zoukankan      html  css  js  c++  java
  • asp.net 连php soap 出了一个怪问题

    这几天,在写一下asp.net 连php soap   的系统,出了一个很怪的问题,至少对于第一次连soap来是相当怪

    请求的时候,时不时的抛出

    System.ServiceModel.CommunicationException: 服务器提交了协议冲突. Section=ResponseStatusLine ---> System.Net.WebException: 服务器提交了协议冲突. Section=ResponseStatusLine

    在 System.Net.HttpWebRequest.GetResponse()
       在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       --- 内部异常堆栈跟踪的结尾 ---

    偶尔有的时候不会。在网上看到别人说,在webconfig里添加:

    <system.net>
    <settings>
    <httpWebRequest useUnsafeHeaderParsing="true" />
    </settings>
    </system.net>

    就不会了,但我加进去,问题依然存在,所以今天拿出来请教大家,这到底是什么问题,已经让我困惑了几天了,下面是我连soap web.config里的配置

      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="serverBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:01:00" sendTimeout="00:01:00" allowCookies="false"
              bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536000" maxBufferPoolSize="524288000" maxReceivedMessageSize="65536000"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="false">
              <readerQuotas maxDepth="32" maxStringContentLength="81920000"
                maxArrayLength="163840000" maxBytesPerRead="40960000" maxNameTableCharCount="163840000" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="string" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://192.168.1.200/php/soapServer.php" binding="basicHttpBinding"
            bindingConfiguration="serverBinding" contract="BasketService.serverPortType"
            name="serverPort" />
        </client>
      </system.serviceModel>

    这是配置web.config里的,希望大家多多指教。

  • 相关阅读:
    2019浙江理工校赛有感
    问题 G: 跳马棋
    问题 H: 象棋对局胜负
    问题 C: 远离原点
    问题 B: 合并车厢
    Hibernate 异常汇总
    设计模式
    1.2.1.2.1.12.34.3.1.34.1.2
    数据结构和算法之 查找
    数据结构和算法之排序算法
  • 原文地址:https://www.cnblogs.com/jwhal/p/3083495.html
Copyright © 2011-2022 走看看