views:

454

answers:

2

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.)

A: 

Sorted the problem.

How? I took JRE 1.6 update 12 off and stuck update 7 (which is the version we reccomend to those who use our website) on my machine.

Why update 12 stopped working I don't know. Why update 7 is stable I don't know. [sigh]

It's things like this that make me glad I work mostly with a 'long time between releases' framework like .net.

A: 

Hi, I have a similar issuea in my application, I'm sending big PDF as base64 data to my applet and it seems to work only for files with 3.5MB max file size, the other files that have more than 10MB seems to be ignored or truncated... I tried to do what you did downgrading my JRE to 1.6_07 but it still didn't work... do you have another aproach... in your case your application is working ok for this solution?

Luiz H Grossl