public String addImage(String sku,DataHandler dataHandler){ System.out.println("trying"); try{ String filepath = "c:/wrox-axis/"+sku+"-image.jpg"; FileOutputStream fout = new FileOutputStream(new File(filepath)); BufferedInputStream in = new BufferedInputStream(dataHandler.getInputStream()); while(in.available()!=0){ fo ut.write(in.read()); } }catch(Exception e){ return e.toString(); } return "Image: "+sku+" has been added successfully!!"; }
}
I did a test by stripping out the attachment being sent by the client and just let it send the string, then in the webservice I stripped out the lines for the attachment and just returned the string and it worked ok, so it has been deployed correctly.
I have the Java Activation framework both in tomcat commons and my webapps lib dir.
I'm pretty sure the error is being thrown here, public String addImage(String sku,DataHandler dataHandler){
I f need to supply more information let me know,
any help would be greatly appreciated, thank you, JP.