Hello,
We are trying out some interface options which we expected to be available in REST integrations/JSON (since similar options available in IFS Connect/XML) but could not make them work. Can someone help me to find out best way to handle these implementations?
- Sending and receiving binary files as fields in a JSON Input/Output.
In IFS Connect we could model document with several fields together with fields of type Binary. When XML is transferred, framework automatically convert binary value to base64binary text and for input convert back from base64binary text.
We have more options in modeling in REST, but none of them allow us to transfer some data together with binary objects at same time using one endpoint.
Example models I try out:
action GetDocfile {
initialcheck none;
parameter Contract Text;
parameter LotId Text;
parameter File Binary;
}
action GetDocfileByStream {
initialcheck none;
parameter Contract Text;
parameter LotId Text;
parameter File Stream;
}
action GetDocfileByText {
initialcheck none;
parameter Contract Text;
parameter LotId Text;
parameter File LongText;
}
In this last one I try to convert CLOB to BLOB in PLSQL (Utility_SYS.Convert_Base64_Clob_To_Blob(file_)).
None of the options worked without errors for somewhat large files (example: PDF attachments). What is the best way to handle this kind of interface implementation in REST?
There seems to be a workaround that need to access 3 endpoints and use data from each other. But that kind of solution is not easy to implement in external systems.
- In IFS Connect we could create document structures as we need for XML and used them in input and output to interface methods. Only way we seems able to do that in REST implementations is using structures. But this implementation add unnecessary level and data to JSON.
Example:
We need request:
{
"Contract": "It is a Text",
"PartNo": "It is a Text",
"VendorNo": "It is a Text",
"ManufacturerId": "It is a Text",
"ConfigurationId": "It is a Text"
}
with response:
{
"Contract": "It is a Text",
"PartNo": "It is a Text",
"VendorNo": "It is a Text",
"VendorPartNo": "It is a Text",
"VendorPartDescription": "It is a Text",
"ManufacturerNo": "It is a Text",
"ManufacturerPartNo": "It is a Text",
"CommGenDescription": "It is a Text",
"Cost": "It is a Text"
}
Model implemented like following:
action TDMUpdatePart Structure(ReturnStructure) {
initialcheck none;
parameter SuppManuDetails Structure(DatasetStructure);
}
structure ReturnStructure {
attribute Contract Text;
attribute PartNo Text;
attribute VendorNo Text;
attribute VendorPartNo Text;
attribute VendorPartDescription Text;
attribute ManufacturerNo Text;
attribute ManufacturerPartNo Text;
attribute CommGenDescription Text;
attribute Cost Text;
}
structure DatasetStructure {
attribute Contract Text;
attribute PartNo Text;
attribute VendorNo Text;
attribute ManufacturerId Text;
attribute ConfigurationId Text;
}
But in JSON we get extra data than expected. There seems no way to prevent this
JSON we get:
{
"SuppManuDetails": {
"Contract": "It is a Text",
"PartNo": "It is a Text",
"VendorNo": "It is a Text",
"ManufacturerId": "It is a Text",
"ConfigurationId": "It is a Text"
}
}
How can we create a JSON where we have data fields in first level?
- In IFS Connect web service implementation we had option to create data structures very easily for tables/views exist in database using advance query view and also had option to get query methods automatically generated from framework. This reduce lot of development time. I could not find similar option in REST implementation. Is there some way to handle similar implementation in REST?
Best Regards
Sandaruwan Wijenayake