The workspace runs successfully when called directly from server or from the generated html, however I can't get server to recognise the SourceDataSet parameter and file upload in my Java code.
The code which builds the request is;
**********************
fmeconn.setRequestProperty( "Content-Type", "multipart/form-data; boundary="+boundary);
PrintWriter put_wr = new PrintWriter(new OutputStreamWriter(fmeconn.getOutputStream(),charset));
put_wr.append("--" + boundary).append(CRLF);
put_wr.append("Content-Disposition: form-data; name=\\"OPT_FileUpload\\"; filename=\\"" + file.getName() + "\\"").append(CRLF);
put_wr.append("Content-Type: application/octet-stream").append(CRLF);
put_wr.append(CRLF).flush();
FileInputStream fileInputStream = new FileInputStream(file);
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, maxBufferSize);
buffer = new byte[bufferSize];
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
while (bytesRead > 0) {
dos.write(buffer, 0, bufferSize);
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, maxBufferSize);
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
}
dos.writeBytes(CRLF);
put_wr.append("--" + boundary).append(CRLF);
put_wr.append("Content-Disposition: form-data; name=\\"DestDataset_TEXTLINE\\" ").append(CRLF);
put_wr.append(CRLF);
put_wr.append("WKT.txt").append(CRLF).flush();
put_wr.append("--" + boundary).append(CRLF);
put_wr.append("Content-Disposition: form-data; name=\\"SourceDataset_ESRIJSON\\" ").append(CRLF);
put_wr.append(CRLF);
put_wr.append(f.getName()).append(CRLF).flush();
**************************************************************
Can someone point me in the right direction?