Greetings,
I have a scenario in my current project where i have my java application and on integration server a flow service (pub.file:bytesToFile). I have to send a file (zip) and store it on the integration server. I’m using HttpURLConnection from my java application for this as follows:
connection = dp.query.getHttpConnection("pub.file:bytesToFile", null);
connection.connect();
try (DataOutputStream dos = new DataOutputStream(connection.getOutputStream())) {
final String params = String.format("fileName=%s&bytes=%s", "Testfile.zip", URLEncoder.encode(new String(file), "UTF-8"));
dos.writeBytes(params);
dos.flush();
}
file is the bytes of the file to be uploaded. So it’s more like a byte file;
I have the content type url-encoded. The response however i get from the IS says that the bytes parameter is not a byte.
Relevant part:
<TR>
<TD valign="top"><B>$error</B></TD>
<TD>[ISS.0086.9250] Parameter [bytes] is not of type: [byte[]]</TD>
</TR>
<TR>
<TD valign="top"><B>$errorType</B></TD>
<TD>com.wm.app.b2b.server.ServiceException</TD>
</TR>
I can’t use any other service which means I have to utilize this current scenario on some way, but if there’s other
built-in service that can upload files to given place that might be an alternative option.
Is there any way to post byte from java to this bytesToFile service?
The purpose of this project:
We don’t have file system access to our ISes as developers. In order to deploy packages we have to copy the package zip files to replicate/inbound folder. Since we don’t have file system access we need a way to copy the zip file to the replicate/inbound folder without self made flow services since that wouldn’t solve anything. For that we need to copy that package to the other IS-es. The project’s short term scope is to use built-in package to upload this (validated) zip file to the IS.
Thanks,
Jozsef