Consume Web Serivice SOAP with Authentication http in Visual Studio 2015

0

I am trying to consume a soap web service from visual studio 2015, the service has authentication link which adds the reference in this way:

Add > Reference Service and provide the credentials at the time you request the reference service.

Now I try to consume the service and show it in a GridView the whole list but I do not know how to do it.

is in ASP.NET.

I attach the web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="Interfaz_lista_de_clientes_Binding1">
          <security mode="Transport">
            <transport clientCredentialType="Basic" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="direccion de servicio /Interfaz_lista_de_clientes"
        binding="basicHttpBinding" bindingConfiguration="Interfaz_lista_de_clientes_Binding1"
        contract="ServiceReferences1.Interfaz_lista_de_clientes_Port"
        name="Interfaz_lista_de_clientes_Port" />
    </client>
  </system.serviceModel>
</configuration>

Now this is my form in which I try to list the data:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WSDL_Cliente
{
    public partial class Listaclientes : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceReferences1.Interfaz_lista_de_clientes data = new ServiceReferences1.Interfaz_lista_de_clientes();
            GridView1.DataSource = data.City;
            GridView1.DataBind();

        }
    }
}

this would be the methods and structure of the project ::

    
asked by RCA 02.10.2018 в 23:01
source

0 answers