WCF消费问题:SOAP安全协商 [英] WCF Consuming Issue: SOAP Security Negotiation

查看:89
本文介绍了WCF消费问题:SOAP安全协商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是wcf的新手,刚刚完成了我的第一个wcf服务。但是当我尝试在另一个应用程序中使用它时会产生异常



使用'http://dummy-server/OnlineWebService/wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService进行SOAP安全协商。 svc'for target'http://dummy-server/OnlineWebService/wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService.svc'失败。详见内部异常。



wcf是部署在本地PC中,我们没有域只是一个工作组。

下面是wcf的web.config

Hi all, I'm new with wcf, just finished my first wcf service. However when I try to use it in another application an exception is generated

"SOAP security negotiation with 'http://dummy-server/OnlineWebService/wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService.svc' for target 'http://dummy-server/OnlineWebService/wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService.svc' failed. See inner exception for more details."

The wcf is deployed in a local pc, we have no domain just a work group.
Below is the web.config of wcf

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="wcfOnlinePullOutServiceLibrary.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 



allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
  
  <connectionStrings>
    <add name="OnlineShop"  connectionString="Data Source=192.168.15.25;Initial Catalog=PackageDB;User ID=sa;Password=;Integrated Security=False" />
    <add name="HeadOffice"  connectionString="Data Source=server-it;Initial Catalog=BoardwalkDbAcc;User ID=sa;Password=;Integrated Security=False"/>
  </connectionStrings>

  <appSettings>
    <add key ="OnlineShopDataSource" value ="192.168.15.25"/>
    <add key ="OnlineShopCatalog" value ="PackageDb"/>
    <add key ="OnlineShopUserId" value ="sa"/>
    <add key ="OnlineShopPassword" value =""/>
  </appSettings>
    
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/wcfOnlinePullOutServiceLibrary/OnlinePullOutBranchPaymentService/"   />
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- Unless fully qualified, address is relative to base address supplied above -->
        <endpoint address=""  binding="wsHttpBinding" contract="wcfOnlinePullOutServiceLibrary.IOnlinePullOutBranchPayment">
          <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.

          <identity>
            <dns value="localhost"/>
          </identity>
          -->
        </endpoint>
        <!-- Metadata Endpoints -->
        <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
        <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

< br $> b $ b





这是使用wcf的应用程序的app.config





Here is the app.config of the application consuming the wcf

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IOnlinePullOutBranchPayment" closeTimeout="00:01:00"

                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"

                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"

                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"

                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"

                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"

                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>

      <client>
            <endpoint address="http://dummy-server/OnlineWebService/wcfOnlinePullOutServiceLibrary.OnlinePullOutBranchPaymentService.svc"

                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IOnlinePullOutBranchPayment"

                contract="ServiceReference1.IOnlinePullOutBranchPayment" name="WSHttpBinding_IOnlinePullOutBranchPayment">
              <!--
                <identity>
                  <servicePrincipalName value=""/>
                </identity>
              -->
            </endpoint>
        </client>


      
    </system.serviceModel>
</configuration>







Thanks in advance




Thanks in advance

推荐答案

Check these threads

WCF WSHttpBinding SOAP Security Negotiation Failed[^]

WCF The Security Support Provider Interface (SSPI) negotiation failed[^]
Check these threads
WCF WSHttpBinding SOAP Security Negotiation Failed[^]
WCF The Security Support Provider Interface (SSPI) negotiation failed[^]


这篇关于WCF消费问题:SOAP安全协商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆