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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Ax 2009 - webservice connection timeout

(0) ShareShare
ReportReport
Posted on by 20

Hi guys,


I have problem regarding to connecting to the JIRA webservice from Dynamics AX 2009 over HTTPS connection. When creating a new webservice reference, the creation freezes and finally i'm getting timeout error. After some code analysis, i've found out, that System.Net.WebResponse is the one, which is getting timeout.. When I tried to use the same classes from Visual Studio in C#, it worked smoothly. Can it be problem with SSL certificate? My server uses certificate, which was generated by ourselves, but is not verified by any of Certification Authorities.

I've tried resolving server alias via DNS, pinging host and opening sockets on 443 and 80 ports and it all worked from AX, so I think it is not a problem with network. Furthermore, I've tried to connect to webservice of annother JIRA instance, with certificate signed by GeoTrust, Inc. and it worked.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Dawid Kaczmarek Profile Picture
    20 on at

    Hi again,

    I've found the solution by myself. I turned out to be a problem with  secured connection protocol.

    Here's my code:

    static server public void webRequestWithSSL(str _uriStr)
    {
        System.Net.WebRequest           webRequest;
        System.Net.WebResponse          webResponse;
    
        CLRObject                       clro;
        System.Exception                ex;
        str                             castStr, castStr2;
        int                             castInt;
        ;
    
        try
        {
    
            new InteropPermission(InteropKind::ClrInterop).assert();
    
            System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Ssl3);
            webRequest = System.Net.WebRequest::Create(_uriStr);
    
    
            webRequest.set_Method("GET");
            webRequest.set_UseDefaultCredentials(true);
            webRequest.set_Timeout(10000);
            webRequest.set_Proxy( new System.Net.WebProxy());
    
    
            // this will throw an webexception if cannot be reached.
    
            webResponse = webRequest.GetResponse();
    
            info("WebResponse Connection OK");
            webResponse.Close();
    
            CodeAccessPermission::revertAssert();
    
        }
        catch(Exception::CLRError)
        {
            ex = ClrInterop::getLastException();
            if (ex != null)
            {
                error(ex.ToString());
                ex = ex.get_InnerException();
                if (ex != null)
                {
                    error(ex.ToString());
                }
            }
        }
        catch
        {
            error("Unknown Error");
        }
    }
    

    All I needed to do is to set security protocol type to SSL3, because TLS is not working properly. I've found this solution here:

    http://mhusseini.wordpress.com/2012/05/22/net_client_with_https_certificate_authetication_fails_with_timeout/

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans