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

User is not authenticated. (id=1366125519)

0
Hei,

Jeg har laget denne koden:

ServiceReference1.EconomicWebServiceSoapClient ses;
ses = new ServiceReference1.EconomicWebServiceSoapClient();


           try
            {
                //connect
                string connectMessage = ses.Connect(xxxx, xx, xxx);


                ServiceReference1.DebtorHandle deb = null;

                try
                {
                    ServiceReference1.DebtorHandle[] d = ses.Debtor_FindByEmail(gs@sensio.no);

                    if (d != null  d.Length  0)
                    {
                        deb = d[0];
                    }
                }

                catch (Exception ex)
                {
                    deb = null;
                }
         
                if (deb == null)
                {

                    MessageBox.Show(Did not find gs@sensio.no);
                    int nDebNum = ses.Debtor_GetNextAvailableNumber();
                    
                    ServiceReference1.DebtorGroupHandle grp = ses.DebtorGroup_FindByNumber(1);
                    deb = ses.Debtor_Create(nDebNum.ToString(), grp, xxxxxxxxxxx, ServiceReference1.VatZone.HomeCountry);
                    ses.Debtor_SetEmail(deb, xxxxxxxxxxxxxxx);
                    ses.Debtor_SetAddress(deb, xxxxxxxxxxxxxxxxx);
                    ses.Debtor_SetPostalCode(deb, xxxxxxx);
                    ses.Debtor_SetCity(deb, xxxx);
                    ses.Debtor_SetTelephoneAndFaxNumber(deb, xxxxx);
                }

                

                if (deb != null)
                {
                    ServiceReference1.CurrentInvoiceHandle i = ses.CurrentInvoice_Create(deb);
                    ses.CurrentInvoice_SetHeading(i, Test);
                    ServiceReference1.ProductHandle p = ses.Product_FindByNumber(101);
                    ServiceReference1.CurrentInvoiceLineHandle l = ses.CurrentInvoiceLine_Create(i);
                    ses.CurrentInvoiceLine_SetProduct(l, p);
                    ses.CurrentInvoiceLine_SetDescription(l, ses.Product_GetName(p));
                    ses.CurrentInvoiceLine_SetQuantity(l, 1.0m);
                    ses.CurrentInvoiceLine_SetUnitNetPrice(l, ses.Product_GetSalesPrice(p));
                    ses.CurrentInvoice_Book(i);

                    byte[] pdf = ses.CurrentInvoice_GetPdf(i);
                }
                
               
            }
            catch (Exception ex)
            {
                //TextBox4.Text += ex.Message;
            }
            finally
            {
                //always disconnect after we are finished.
                ses.Disconnect();
            }



 men får bare en exception:

Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. (id=1366125519)

Når jeg kjører:
ServiceReference1.DebtorHandle[] d = ses.Debtor_FindByEmail(gs@sensio.no);

Hvorfor??
created Jan 28, 2013 by gsveen
0% Accept Rate
Q 1 A 1 C 0

1 Answer

0
You need to allow cookies as described here: http://e-conomic.github.com/eco-api-sdk-ref-docs/

Section: Connecting directly to SOAP (not through SDK)
answered Jan 31, 2013 by nkn
Visma e-conomic A/S
...