Calling ASP.net with NTLM or Windows/Negotiate authentication from VB.net client application

So, When adding a Vb.net service in Visual Studio as a service reference some of the auto generation of the App.Config refuses to work, Edit it to match the following below as an example to get it to work.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Dim MySoapClient As New IsPortal.APISoapClient()
Dim MyString = MySoapClient.Jira_CreateTicketTest()
Debug.Write(MyString)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="APISoap">
                  <security mode="Transport">
                    <transport clientCredentialType="Windows" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                  </security>
                </binding>
                <binding name="APISoap1" />
            </basicHttpBinding>
            <customBinding>
                <binding name="APISoap12">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpsTransport />
                </binding>
            </customBinding>
            <wsHttpBinding>
                <binding name="SecureBinding">
                    <security mode="Message">
                        <message clientCredentialType="Windows" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://WebServer/api.asmx" binding="basicHttpBinding"
                bindingConfiguration="APISoap" contract="WebServer.APISoap"
                name="APISoap" />
          <!--
            <endpoint address="https://WebServer/api.asmx" binding="customBinding"
                bindingConfiguration="APISoap12" contract="WebServer.APISoap"
                name="APISoap12" />
                -->
        </client>
    </system.serviceModel>
</configuration>

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *