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里的,希望大家多多指教。

posted @ 2013-05-17 13:25  LaiShiLu  阅读(503)  评论(1编辑  收藏  举报