Question

Use BLOB/CLOB datatype as an input parameter for an action through JSON in REST Integration IFS Cloud


Badge +2

Hi, 

I am having an action which takes LongText as input, inturn I have used CLOB datatype to parse the longtext value in my procedure, but when I send the string via postman it gives error as “ODP_DESERIALIZATION_ERROR”.

Is there a way to parse the longtext values or BLOB values.

 

 

Thanks in advance 


14 replies

Userlevel 7
Badge +30

Hi,

Did you mean to post this in the Document Management forum here on IFS Community?
 

Badge +2

Hi,

I am looking for a solution to the above-mentioned problem.

Userlevel 7
Badge +30

The question is posted in the Document Management forum. Is your problem related to Document Management?

Badge +2

Yes, it is

Userlevel 7
Badge +30

What's the relation to Document Management? Can you show it?

Also, if you want help, you need to provide more details, like showing the complete request (type and body, to begin with, and the URL).

Thanks!
 

Badge +2

Hi, 

→ I have created a action with LongText  as datatype, 

→And later I have passed the longtext value as parameter to one of my procedures, as a CLOB datatype.

→the content got as a input from json will be encrypted, so I will be decrypting and converting to BLOB and storing into a variable of blob datatype.

→the obtained blob value will be sent as parameter to edm_file_storage_api.write_file_data.

 

 

 

Thanks in advance.

Userlevel 7
Badge +30

I cannot say what's wrong. What I can say is that the problem is most probably not in the PL/SQL side. It's more likely that you are posting the data to the REST service in the wrong format/way. How does the REST call look like? Is it a POST or PATCH?

Badge +2

It is POST service.

Userlevel 7
Badge +30

@CHAITRA_MUTTALLI 

How does the REST call look like?

 

Badge +2

Hi,

the json payload looks as below,

{
  "CReport" : {
    "Content" : "’",
    "ContentFormat" : "application/pdf",
    "Number" : "12349",
    "LanguageCode" : "en-US",
    "ReportFormat" : "PDF",
    "ReportType" : "Acrobat"
  }
}

in the content the encrypted longtext/ decrypted BLOB values will be parsed.

Userlevel 7
Badge +30

In your earlier screenshot above, it says "CGetReport" but in what you just pasted above it says "CReport”. Could that be what the ODP complains about?

Userlevel 7
Badge +30

I also miss some bits and pieces. In the procedure, you have four parameters, none of them is that structure I think.

At any rate, what I think is happening is that you don't post the data in the form/format that the ODP expects.

Try stripping things down to their bare minimum by removing parameters or attributes in the structure until it works, then add things back.

Good luck!
 

Badge +2

The structure name is CGetReport, the procedure/action parameter name is CReport

and in my procedure, I have considered only the parameters taking dynamic values, so we can see less number of parameters.

 

Sure let me try by removing each parameters.

 

Thank You.

Userlevel 7
Badge +19

How to send in CLOB/BLOB is described here in the documentation:

https://docs.ifs.com/techdocs/23r2/040_tailoring/300_extensibility/100_odata_provider/1110_large_param_action/#large_parameters_in_actions

Look at the example files in the link in the documentation.

 

Basically you need to:

Create Temporary LOB Storage:

In the Response you get an “OData-EntityId” that you shall use in next call:

Next step is to send the LOB data to the temporary LOB storage URL you got from previous call’s response:

 

Then You can call your projection action like this:

For reference, this is my ProjectionAction and plsql Implementation:

 

action LoadExternalFile {
   initialcheck none;
   parameter CreatedFrom Text;
   parameter FileName Text;
   parameter Message LongText;
}

 

PROCEDURE Load_External_File___ (
   created_from_ IN VARCHAR2,
   file_name_ IN VARCHAR2,
   message_ IN CLOB)
IS
BEGIN
    C_Ext_File_Server_Util_API.Load_External_File(created_from_, file_name_, message_);
END Load_External_File___;

 

Reply