Error using Http to connect to Visma.Net API

We made a simple Integration between Visma.Net and SuperOffice Online using Http class i CRM-script. It worked fine for several months, but now (since july) we get the error:

HTTPConnection::endRequest(): Failure when receiving data from the peer

The "same" call works fine from Postman and C#, but not from CRM-script. 

When I check the responseHeaders I get this :

getResponseHeaders: {"content-language":"en","content-length":"3166","content-type":"text/html","date":"Thu, 05 Sep 2019 06","http/1.1 503 service unavailable":"","mime-version":"1.0","server":"squid/3.4.8","vary":"Accept-Language","x-squid-error":"ERR_CONNECT_FAIL 110"}

Have any idea what is wrong? I'm also going to check with Visma if they have change the API lately.

-Frode

RE: Error using Http to connect to Visma.Net API

Hej Frode!

May this has something to do with your issues?


https://community.superoffice.com/en/developer/forum/rooms/topic/superoffice-product-api-group/customer-service/wish-gethttpheaders-in-crmscript/

best regards

Anders

Von: Anders Larsson 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Hi Frode,

Do you have the possibility of testing this from an OnSite-installation (but still using CRMScript)? That way you can check whether it is CRMScript or the environment (or the endpoint) that fails.

Sverre

Von: Sverre Hjelm 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Sverre, it worked OnPrem. I tested in both SuperOffice 8.4 Build Release84_C-2018.11.05-03 and SuperOffice 8.5 Build Release85_C-2019.07.01-01

Have there been any changes in Online this summer?

Von: Frode Follerås 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Also, enable debugging of the HTTP class before making the call

http.setDebugMode(true);

And check the result after making the call.

http.getDebug()
Von: Frode Lillerud 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

When I compare the debuginfo I see there are different IP-adress even when the endpoint has the same URL. (https://integration.visma.net/API/security/api/v2/token) 

Isn't Online environment hosted by Visma? Could that have anything to do with it? DNS issues?

From Online you get "HTTP/1.1 503 Service Unavailable" and "X-Squid-Error: ERR_CONNECT_FAIL 110"

Info from OnPrem:

== Info
Trying 91.123.56.208...

== Info
TCP_NODELAY set

== Info
Connected to integration.visma.net (91.123.56.208) port 443 (#0)

......

Info from Online

== Info
Trying 10.53.10.141...

== Info
TCP_NODELAY set

== Info
Connected to 10.53.10.141 (10.53.10.141) port 3128 (#0)

== Info
Establish HTTP proxy tunnel to integration.visma.net:443

=> Send header
CONNECT integration.visma.net:443 HTTP/1.1
Host: integration.visma.net:443
Proxy-Connection: Keep-Alive


<= Recv header
HTTP/1.1 503 Service Unavailable

<= Recv header
Server: squid/3.4.8

<= Recv header
Mime-Version: 1.0

<= Recv header
Date: Thu, 05 Sep 2019 09:02:29 GMT

<= Recv header
Content-Type: text/html

<= Recv header
Content-Length: 3166

<= Recv header
X-Squid-Error: ERR_CONNECT_FAIL 110

<= Recv header
Vary: Accept-Language

<= Recv header
Content-Language: en

<= Recv header


== Info
Received HTTP code 503 from proxy after CONNECT

== Info
Closing connection 0

 

Von: Frode Follerås 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

I think you are onto something. My guess is that this is some kind of routing trouble on the proxy that all outbound CRMScripts calls passes through.

Von: Stian Andre Olsen 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Who do I address this problem to?

Von: Frode Follerås 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Online Operations team has been made aware of this post.

Von: Stian Andre Olsen 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Thank you!

Von: Frode Follerås 5. Sep 2019

RE: Error using Http to connect to Visma.Net API

Note also that Online has had network problems the last couple of days, causing a lot of 503 errors, so there is a good chance your problems are related, and will solve itself once network issues have been fixed.

Von: Frode Lillerud 5. Sep 2019