Page 2 of 4

API Express AE009

Posted: Fri Jun 09, 2017 2:04 pm
by Bernie

API Express AE009

Posted: Fri Jun 09, 2017 2:48 pm
by Bernie

In the app tap on "New Report",
then chose one of the categories (this opens the page "Collect"),
then tap the camera symbol and make a picture (this uses the restservice "mobilecamera"),
then tap send (this uses the restservice "restservice_newPOI_post"

In API Express you can go to

reporterAPI == reporter_newPOI==newPOI

and test the service with some dummy data for the body payload.
In the example below the "11111......111" dummy data has a size of 10KB only!

I you increase the dummy data to a certain extent the error is thrown. Image

Image


API Express AE009

Posted: Sat Jun 10, 2017 9:06 am
by Serhii Kulibaba

We've reproduced that issue.
Please provide us with information to understand what is wrong there: what data type does your column "media_url" have? What database do you use there?


API Express AE009

Posted: Sat Jun 10, 2017 10:33 am
by Bernie

The data type of the column "media_url" is CLOB.

The database is a SQL Server database provided by Microsoft Azure.


API Express AE009

Posted: Sat Jun 10, 2017 12:35 pm
by Serhii Kulibaba

Could you create a database connection to your database: https://docs.appery.io/docs/apiexpres...

And send the base64 string there for the parameter media_url, instead of set it manually with a SQL code?


API Express AE009

Posted: Sat Jun 10, 2017 5:28 pm
by Bernie

Yes, the database connection works just fine.
I can store other values into other fields without any delay or problem.

I also can copy a base64 string into that database from a GIS software that I use.
The media_url filed does accept the entry without any problems.

Same thing when working with the SQL Server Management Studio.
I can add entries into the media_url field.


API Express AE009

Posted: Sun Jun 11, 2017 7:54 am
by Serhii Kulibaba

You can generate the insert service with that database connection: https://docs.appery.io/docs/apiexpres...

Please check does it work fine for you?


API Express AE009

Posted: Wed Jun 14, 2017 7:14 pm
by Bernie

Hi Serhii,

I tried to use that before and double checked today. This is just another way to create the service and won't change how the service itself behaves.

I researched a little bit deeper today and figured that this is probably a problem with the SQL identifiers.

SQL Server requires a single (') identifier for varchar(max) data types in order to push through variables longer than 128 characters.

In SQL Server Management Studio it throws the following error:

The identifier that starts with ... is too long. Maximum length is 128

when using

INSERT INTO [dbo].POI

values(abcd...);

The statement goes through and adds a new record when using

INSERT INTO [dbo].POI

values('abcd...');

Now the question is what does API Express do when using the syntax like :media_url?

Is it transforming :media_url to
a) media_url
b) 'media_url'
c) "media_url"

If it is a) or c), the statement is most likely not to work.

Please, can you ask your development guys to answer that one?
What would be a possible work around?

Thanks,
Bernie


API Express AE009

Posted: Fri Jun 16, 2017 11:43 am
by Bernie

It has been almost two weeks now in trying how to figure out a simple task: How do I store a picture in a Azure SQL server database via API Express.

Do I really need to buy support hours for this?


API Express AE009

Posted: Fri Jun 16, 2017 6:15 pm
by Bernie

Serhii,

i need to continue to work on my project.

In order for you to be able to replicate the issue I set up a new project with just one page, the camera device service and the API Express service.

The name of that project bis "Azure" and I shared it with support.

I look forward hearing of you.

Thanks,
Bernie