zendtech / IbmiToolkit

PHP frontend to XMLSERVICE for IBM i development.
BSD 3-Clause "New" or "Revised" License
46 stars 34 forks source link

Sending ~2Mb data with CharParam #198

Closed jonkerw85 closed 9 months ago

jonkerw85 commented 9 months ago

We are encountering a problem and are not sure how to locate the source of the problem and eventually fix it.

We want to send a base64 encoded image through the XMLToolkit: TS::AddParameterChar('both', 2000000, 'JsonInput', 'PRMIN', $this->input->toJson())

The response we get is: ODBC error code: 22001 msg: [IBM][System i Access ODBC Driver]Column 3: CWB0111 - Input data is too big to fit into field

We are using PDO_ODBC with the IBM I access ODBC driver.

@alanseiden 1) Is it possible to send this amount of data trough the toolkit. 2) Do you have a suggestion to find the source of this error message? I have looked together with the IBM i developer (I'm a web developer) and he also does not know what is causing the error.

alanseiden commented 9 months ago

@jonkerw85 Try adding this line before you call the program using your toolkit connection object (not sure if will work with TS:: or not but you can try): $conn->setOptions(array('plugSize'=>'10M'));

NattyNarwhal commented 9 months ago

FWIW, CWB prefix indicates it's coming from the ODBC driver.

alanseiden commented 9 months ago

FWIW, CWB prefix indicates it's coming from the ODBC driver.

Right. Setting the plug size tells the toolkit which ODBC stored procedure to use.

jonkerw85 commented 9 months ago

@alanseiden & @NattyNarwhal I gave it a quick test, and setting the plugSize to 10M solved the problem. Thanks for the quick response!

The TS:: is the IBM i Toolkit facade for laraval by cooperl22 (https://github.com/cooperl22/laravel-ibmi).

alanseiden commented 9 months ago

@jonkerw85 Excellent. You can probably go down to 5M (reduce network traffic a little) and it will still work. Valid plugSize values: