SugarCRM soap apis giving read time out

We have one customer who is on SugarCRM on premise 8.0.2 version. When we are trying to access SugarCRM instance of this customer via SOAP apis, we are getting read timeout exception. I have looked through the SugarCRM release notes and found that there was one issue related to SOAP apsi which was fixed in 8.0.1 and 8.1.0.

  • 80813 : The SOAP API and is not available for use, rendering applications which use SOAP unable to connect to Sugar. 

Can someone please confirm if the fix is available in 8.0.2 or the issue was introduced again in 8.0.2?

  • That issue is fixed in 8.0.2.

    Can you reach {site_url}/service/v4/soap.php? That should display some built-in docs that should verify that SOAP API is functioning properly.

    There may be some customizations that affect login experience for this customer.

    Of course, you can find tips and code examples for working with SOAP API in the Sugar Developer Guide.

    http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_8.0/Integration/Web_Services/Legacy_API/… 

    http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_8.0/Cookbook/Web_Services/Legacy_API/SOA… 

    App Ecosystem @ SugarCRM

  • Hi Matt,

    Thanks for the reply.

    I am trying to hit login soap api via postman to the customer SugarCRM on premise (8.0.2) instance. 

    URL: {site_url}/soap.php

    Method:POST

    Headers: 

    Content-Type - text/xml; charset=UTF-8
    Host - {hostname}
    SOAPAction - "urn:login"
    request body:
    xml request for login soap api.
    This request is failing with read time out.
    When I remove SOAPAction header from the request. I am able to get response from customer SugarCRM instance.
    Sending SOAPAction with empty value is also giving me read timeout.
    I tried on other SugarCRM cloud instance of 8.2.0. The soap api request is working fine with both SOAPAction header and without SOAPAction header.
    Do you have any idea, what can be the issue here for getting read time out when we are passing SOAPAction header.
    Thanks in advance for the help.
  • I'm not sure why this would fail. It seems like the login action is timing out for some reason. You can check PHP error log and the sugarcrm.log file to see if there's anything in those that points to a problem.

    Also, you can see if you can reproduce this problem with a stock (brand new) instance of Sugar 8.0.2. If it works in a stock version of Sugar but not in the customer's instance then you know it has something to do with the customer's environment (for example, maybe a customization is getting in the way.)

    App Ecosystem @ SugarCRM

  • Hi Matt,

    Thanks for your reply. 

    The customer had confirmed that they had some network configuration to block SOAPAction Header. They have fixed the configuration to allow SOAPAction header.

    Now, we are facing a new issue with customer SugarCRM SOAP login api.

    When we are passing the following header, the customer Sugarcrm server is unable to read the body of the SOAP login api and giving "error in msg parsing: xml was empty, didn't parse!"

    Transfer-Encoding            chunked

    When we remove this header in the request, the Soap login api request is successful.

    Can you please let me know, if there is any setting in Sugarcrm around the Transfer-Encoding header.

    Thanks in advance for the help.

  • The SOAP library we use doesn't support chunked transfer encoding. I'm surprised that simply eliminating that header works because the content is transmitted differently if you are using chunked encoding.

    Chunked transfer encoding - Wikipedia 

    I think you're having issues with your SOAP client or a proxy or firewall mangling the SOAP requests that are being sent. I suspect the root cause of issue is outside of Sugar and it's best to understand and address root cause of issue.

    If absolutely needed, you could configure Apache to unset this header which would keep Sugar from seeing it.

    mod_headers - Apache HTTP Server Version 2.4 

    App Ecosystem @ SugarCRM

  • Hi Matt,

    We were able to reproduce the issue with Transfer-Encoding on our on prem instance as well.  We have our SugarCRM instance on AWS, AWS internally ignores Transfer-Encoding header because of which we were not able to reproduce the issue earlier. After changing our AWS ELB configuration to use TCP protocol, we were able to reproduce the issue.

    We have fixed our code to stop sending Transfer-Encoding header, 

    (SugarsoapStubStub)stub)._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, false);

    Thanks Matt for all the help to resolve the issue.