小编use*_*862的帖子

WCF提供不安全或错误安全的错误

我正在尝试使用远程svc Web服务.我创建了代理类svcutil.exe,之后我将该类添加到我的控制台应用程序中,但它产生了一个错误:

从另一方收到了不安全的错误或错误的安全故障.有关故障代码和详细信息,请参阅内部故障异常.

System.ServiceModel.FaultException:验证消息的安全性时发生错误

我没有创建WCF端,它是一个远程svc.请帮忙.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="EloquaDataTransferService" 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="Mtom" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="TransportWithMessageCredential">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://secure.eloqua.com/API/1.2/DataTransferService.svc"
                binding="basicHttpBinding" bindingConfiguration="EloquaDataTransferService"
                contract="DataTransferService" name="EloquaDataTransferService" />
        </client>
    </system.serviceModel>
</configuration>
Run Code Online (Sandbox Code Playgroud)

这是我的app.config档案.我consoleApp.cs使用obj.ServiceCredentials.UserName.UserName="xxxxxx"和提供我的文件中的用户名和密码.Password="xxxXx"

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.serviceModel>
      <bindings>
         <basicHttpBinding>
            <binding name="EloquaDataTransferService" …
Run Code Online (Sandbox Code Playgroud)

c# wcf

68
推荐指数
4
解决办法
13万
查看次数

标签 统计

c# ×1

wcf ×1