.NET客户端通过服务引用错误访问服务

时间:2012-09-28 10:28:09

标签: .net wcf

我试图通过我的.Net客户端应用程序中的服务引用来访问服务。 当我访问服务方法时,我得到以下错误:

  

访问服务方法时发现异常

     

System.Xml.XmlException被捕获了Message = End元素'Body'来自   命名空间'http://schemas.xmlsoap.org/soap/envelope/'预期。发现   来自命名空间

的元素'ns:updateStatusAsReadResponse'

我的app.config看起来像这样:

<bindings>
  <basicHttpBinding>
      <binding name="documentproxySoap11Binding" closeTimeout="00:01:00"
             openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
             allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
             maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
             messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
             useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
            realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>

  </basicHttpBinding>
  <customBinding>
         <binding name="documentproxySoap12Binding">
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
          messageVersion="Soap12" writeEncoding="utf-8">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      </textMessageEncoding>
      <security authenticationMode="MutualCertificate" >
      </security>
      <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
          maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
          realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
          useDefaultWebProxy="true" />
    </binding>
  </customeBinding>
  <client>
        <endpoint address="http://xxx.documentproxyHttpSoap11Endpoint/"
             binding="basicHttpBinding" bindingConfiguration="documentproxySoap11Binding"
             contract="documentProxy.documentproxyPortType" name="documentproxyHttpSoap11Endpoint" />

  </client>

0 个答案:

没有答案