web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Calling SOAP web service over HTTPS with certificate authentication - "... no endpoint listening at ..." error

(0) ShareShare
ReportReport
Posted on by 925

Hi,

I will be extremely grateful for any hint what I am doing wrong consuming web service, which I am describing below.

I am calling external web service using SOAP protocol, which was delivered with the *.wsdl file. There is authentication through HTTPS and I received X.509 public key certificate from a provider. I thought that everything I should do I did right and I tried to use it from Microsoft Dynamics AX2012 R3, but after all, I cannot connect to the web service as I get the error message:

<em>System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at example.com/.../Service that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ***.</em>

So I created a separate class in Microsoft Visual Studio and tried to call this web service from Microsoft Visual Studio level, but I got the same error. 

What I already did:

1. Provider asked me to change web service endpoint, so before adding a service reference, I changed it in the *.wsdl file.
2. I added service reference in Microsoft Visual Studio.
3. After that, my app.config was generated like below, endpoint looks ok.
4. I created a new class to load provided certificate and test out the connection, code below.
After debugging this code, certificate seems to be found and loaded, but after invoking service.putData() method, I am receiving timeout and error that there is no endpoint.

==> Service / app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
    <bindings>
        <customBinding>
            <binding name="DistributorServiceBinding">
                <textMessageEncoding messageVersion="Soap12" />
                <httpsTransport />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint address="example.com/.../DistributorsService"
            binding="customBinding" bindingConfiguration="DistributorServiceBinding"
            contract="Service.DistributorServiceType" name="DistributorServicePort" />
    </client>
</system.serviceModel>

==> Service / ConsoleApp.cs

class ConsoleApp
{
    static void Main(string[] args)
    {
        try
        {
            DistributorServiceTypeClient client = new DistributorServiceTypeClient();

            // Loading and assigning certificated stored for my user. It seems to be found and set as I am debugging. 
            client.ClientCredentials.ClientCertificate.Certificate = ConsoleApp.setCertificate();

            client.Open();

            DataRequest request = new DataRequest();

            // Some code to set DataRequest.

            DataResponse response = new DataResponse();

            // Sending data. 
            response = client.PutData(request);

            // ERROR is caught that no endpoint is listening. 

            client.Close();

            Console.WriteLine("Result : {0}", response.get_Result());
       Console.WriteLine("Message : {0}", response.get_Message());
            Console.ReadKey();                
        }
        catch (Exception e)
        {
           ...
        }         
    }
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    axk Profile Picture
    925 on at
    RE: Calling SOAP web service over HTTPS with certificate authentication - "... no endpoint listening at ..." error

    Hello,

    Just in case anybody is working on this, I managed to set a batch job, which is calling this web service over https using client certificate and described it here: [link deleted].

    I hope it will help somebody!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans