API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

API connection problem PHP

0

Hi there,

We are experiencing problems with the API. Sometimes the API works well for some time and sometimes it just stops working without making any change.

At the moment we are developing an automated invoice generation module, that allow us to generate monthly invoices from our platform and integrate them with e-conomic. However we have been experiencing problems with the API, I am adding all the different errors that I have been having and also the PHP code that we are using to establish the connection with the API. The errors seem to be more like communication errors rather than anything else, as sometimes the API does not respond to the requests or rejects connection.

 

Account details used:

 

[access_credentials]

agreement_number = xxxx

user_name = xxxx

password = xxxxxx

 

[wsdl]

wsdl_endpoint = https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL

 

PHP Code to connect to the API:

 

$client = new SoapClient($settings['wsdl_endpoint'],

                                                                      array('trace' => 1,

                                                                            'exceptions' => 1,

                                                                            'cache_wsdl' => WSDL_CACHE_NONE,

                                                                            'keep_alive' => 0,

                                                                            'connection_timeout' => 10

                           ));          

                                 

                           $client->Connect(array(

                                  'agreementNumber' => $settings['agreement_number'],

                                  'userName'        => $settings['user_name'],

                                  'password'        =>  $settings['password']

                           ));

 

Responses from the API:

 

Exception "Exception" with message "Error when adding product to invoice! Economic.Api.Exceptions.AuthenticationException(E02250):

User is not authenticated. (id=98c6c6fd-f794-4f79-9d53-7b93377f5c44)" in /media/sf_www/MCMP-LV/application/modules/invoicing/controllers/InvoiceController.php:225

 

Exception "SoapFault" with message "Could not connect to host"

 

Exception "Exception" with message "Error when adding product to invoice! Economic.Api.Exceptions.AuthenticationException(E02250):

User is not authenticated. (id=a5a8cb52-bdef-41bc-bc7f-f46fb5c0f4c2)" in /media/sf_www/MCMP-LV/application/modules/invoicing/controllers/InvoiceController.php:225

 

Exception "SoapFault"

Could not connect to host

 

Exception "Exception" with message "Error when adding product to invoice! Economic.Api.Exceptions.AuthenticationException(E02250):

User is not authenticated. (id=98c6c6fd-f794-4f79-9d53-7b93377f5c44)" in /media/sf_www/MCMP-LV/application/modules/invoicing/controllers/InvoiceController.php:225

 

Exception "SoapFault" with message "Could not connect to host"

 

Exception "Exception" with message "Error when adding product to invoice! Economic.Api.Exceptions.AuthenticationException(E02250):

User is not authenticated. (id=a5a8cb52-bdef-41bc-bc7f-f46fb5c0f4c2)" in /media/sf_www/MCMP-LV/application/modules/invoicing/controllers/InvoiceController.php:225

 

Exception "SoapFault"

Could not connect to host

 

Warning: SoapClient::SoapClient(): SSL: Connection reset by peer in /media/sf_www/MCMP-LV/application/modules/invoicing/mappers/EconomicWSAbstract.php on line 26 Call Stack: 0.0049 654712 1.

 

 

Hope it all helps,

Looking forwards to hear from you,

 

Thanks,

Daniel

created Jun 20, 2013 by dagock
0% Accept Rate
Q 1 A 0 C 0

1 Answer

0
Looks to me like the connection times out, and then you try to use it.
answered Jun 21, 2013 by andreasb
Visma e-conomic A/S
...