Service Virtualization

Expand all | Collapse all

Unable to send POST REST API Call -Notification: DNS Failure

Jump to Best Answer
  • 1.  Unable to send POST REST API Call -Notification: DNS Failure

    Posted 02-13-2020 05:47 PM
    I am working on a project which needs me to do REST based call (JSON Response). My test case acts as a driver hence have created a scheduler where initial authentication generates a token and then this is used for the next POST call. My Authentication call is working without any issues and getting a token generated, however the API call is failed saying "503 - Service Unavailable".

    However, when I hit the same API with the newly generated token via PostMan, its working and giving 200 Success response.

    I am able to ping the server too [ping slot3.org009.t-dev.corp.telstra.com] and getting a success response from command line prompt.

    I have also given the proxy setup at the step level(in the Companions section of the step) but it is still failing.

    Below is the error in the 'Test Events':
    <p>
    The host name resolution (DNS lookup) for this host name
    (&nbsp;slot2.org009.t-dev.corp.telstra.com&nbsp;) has failed. The Internet address may be misspelled or obsolete,
    the host (&nbsp;slot2.org009.t-dev.corp.telstra.com&nbsp;) may be temporarily unavailable,
    or the DNS server may be unresponsive.
    </p>





    ------------------------------
    Regards,
    Kaushik M D
    Test Architect
    Telstra
    +61 421132637
    ------------------------------


  • 2.  RE: Unable to send POST REST API Call -Notification: DNS Failure

    Posted 02-13-2020 06:00 PM
    If you are using Server name, you can try using IPaddress and see if it works.

    If not, here are few things, I would try.
    . Instead of Ping try the Telnet to the Server/IPaddress on Port and see you are able to connect or not.
    . In Workstation assuming you are setting the valid Token in your test case, enable HTTPS/Debug in the Help menu.
    . Run the Test case in ITR, so companion will be executed (don't execute the step, as companion will not be applied).

    Check the SSL Debug, if it throws any handshake failures on TLS version, then you can try setting https.protocols=TLSv1.2,TLSv1.1,TLSv1 in Workstation local.properties. Restart Workstation and re test the issue.



  • 3.  RE: Unable to send POST REST API Call -Notification: DNS Failure

    Posted 02-13-2020 06:40 PM
    Thanks for the swift response.

    I have already done the below:

    . In Workstation assuming you are setting the valid Token in your test case, enable HTTPS/Debug in the Help menu.
    . Run the Test case in ITR, so companion will be executed (don't execute the step, as companion will not be applied).
    Check the SSL Debug, if it throws any handshake failures on TLS version, then you can try setting https.protocols=TLSv1.2,TLSv1.1,TLSv1 in Workstation local.properties. Restart Workstation and re test the issue.

    I have added -Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1,SSLv3 in all the vmoptions files (vse, simulator, workstation etc)

    In our project we dont use local.properties and its _local.properties. Do you recommend we use local.properties?
    Also, will try out the telnet option that you have recommended.

    In PostMan, when I checked the proxy setting, it is set to default System setup:






    ------------------------------
    Regards,
    Kaushik M D
    Test Architect
    Telstra
    +61 421132637
    ------------------------------



  • 4.  RE: Unable to send POST REST API Call -Notification: DNS Failure
    Best Answer

    Posted 02-14-2020 02:30 AM

    Hi,

     

    Check the docs, _local.properties is just an example properties file, it is not read/used by any of the DevTest components.

     

    Instead, copy _local.properties to local.properties and add customizations there. Then restart any needed component.

     

    Cheers,

    Danny

     

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.