This question may look familliar but I've discovered some rather more pertinent information and tried some other things (which are detailed below) so to avoid confusion I've created another question.
Here's the JavaScript (on an aspx page):
function CallApplet(clientRef, system, branch, category, pdfXML)
{
AppletReturnValue = document.DocApplet.WriteDocument(clientRef, apmBROOMS, branch, category, pdfXML);
//do something with the return value here
}
pdfXML is got from pdfData which is a hidden field on the page containing the XML that contains base64 encoded pdf data which is passed to the java applet. All the other values being passed to the applet's WriteDocument method have within range sensible values.
The XML is like this
<Documents>
<FileName>AFileName</FileName>
<PDF>JVBERiDAzOTY1NzMwIDAwMDAwIG4NCjAwMDM5NjU4NDcgMDAwMDAgbg0KMDAwMzk2NTk2</PDF>
</Documents>
(the content of the PDF element is a lot bigger than displayed above, i've truncated the data for space reasons; the PDF data is about 4Mb)
The signature of the Java method is:
public String WriteDocument(String clientPolicyReference,
int systemType,
int branch,
String category,
String PDFData) throws Exception
What happens is that somehow the xml string data is lost and by the time one gets into the Java the value of the PDFData parameter is null. I've debugged into the JS and the pdfXML param of the js method CallApplet definitely has content.
I've also tried to add a param tag in to the applet tag and set its value before calling the applet and used GetParameter() from inside the applet. This results in a blank string rather than a null.
This problem doesn't occur on every machine. Our QA department don't get this for example but since this is a client-side issue, one of our customers will probably see this.
I'm utterly out of ideas here so any help would be appreciated (with the obvious proviso that sadly I need to get this working rather than re-engineer this and the legacy systems the applet communicates with to avoid using an applet.)