客户端身份验证方案(Soap Service Error)

时间:2019-03-16 05:41:16

标签: c# web-services soap

我想连接到肥皂服务,如您在此处看到的那样:

    mymodel input = new mymodel ();
        input.chassiNo = "1";
        input.endDate = "1";
        input.issueDate = "1";
        input.motorNo = "1";
        input.nationalId = "1";
        input.plateNo = "1";
        input.simfaType = "1";
        input.simfaUniqueCode = "1";
        input.startDate = "1";
        input.vid = "1";
        input.vin = "1";
        responseModel output = new responseModel();
        ServiceReference1.SimfaWSClient b = new SimfaWSClient();
        output = b.send(input, "****", "***");
        Console.WriteLine(output.code);
        Console.ReadLine();

使用此应用程序配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
    <system.serviceModel>
        <bindings>

            <basicHttpBinding>
                <binding name="SimfaWSPortBinding" />
            </basicHttpBinding>

        </bindings>
        <client>
            <endpoint address="http://*****/WS" binding="basicHttpBinding"
                bindingConfiguration="SimfaWSPortBinding" contract="ServiceReference1.SimfaWS" 
                name="SimfaWSPort" />
        </client>
    </system.serviceModel>
</configuration>

但是我得到这个错误:

  

使用客户端身份验证方案禁止HTTP请求   '匿名'。远程服务器返回错误:(403)禁止

谢谢

0 个答案:

没有答案