引用.exe文件中的Web服务

时间:2017-11-23 04:14:01

标签: asp.net

我有下一个问题: 我有一个Web服务的引用,我的app.config没问题,在我的asp.net中,可视化基本代码工作正常,但是执行.exe文件我收到消息"找不到引用的默认端点元素服务模型中的合同......"

这是我app.config的摘录:

      <endpoint address="http://ADDRESS/AutenticaService.svc"
            binding="basicHttpBinding" bindingConfiguration="AutenticaEndpoint"
            contract="AutenticaService.AutenticaServiceContract" name="AutenticaEndpoint"/>

任何线索?...提前感谢

1 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
  </configSections>
  <connectionStrings>
    <add name="SISEPrueba.My.MySettings.ChRiesgos_ProdConnectionString"
      connectionString="Data Source=CBRTPWPAPL201;Initial Catalog=CHUBB_SEG_REPORTES;User ID=user_rpt;password=xxxx"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
      <behaviors>
        <endpointBehaviors>
          <behavior name="myBehavior">
            <callbackDebug includeExceptionDetailInFaults="true" />
          </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
          <behavior>
            <serviceMetadata httpGetEnabled="true" />
          </behavior>
        </serviceBehaviors>
      </behaviors>      
        <bindings>
            <basicHttpBinding>
                <binding name="AutenticaEndpoint" >
                  <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                     realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                  </security>
                </binding>
            </basicHttpBinding>
        </bindings>
      <client>
            <endpoint address="http://ADDRESS/ServicioSeguridad/AutenticaService.svc"
                binding="basicHttpBinding" bindingConfiguration="AutenticaEndpoint"
                contract="AutenticaService.AutenticaServiceContract" name="AutenticaEndpoint"/>
        </client>
    </system.serviceModel>
</configuration>