Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Apache AXIS2 sending large DIME attachments -


i working on webservice send large pdf files server client using dime. using apache axis2 implementation webservice support. have been service work issue arises when attempt send attachments larger 1mb exception. guess have chunksize attachment before sending have no idea can control , thinking maybe another. below code client uploading files

public class pdfdriver {  /**  * @param args  * @throws ioexception  */ public static void main(string[] args) throws ioexception {     // todo auto-generated method stub     testaddgroup();  }  public static void testaddgroup() throws ioexception {      try     {         pdfmail_servicelocator locator = new pdfmail_servicelocator();              locator.setpdfmailsoapendpointaddress("http://localhost:80/services/pdfmailsoap");          pdfmail_porttype stub = locator.getpdfmailsoap();          pdfmailsoapstub server = null;         server = (pdfmailsoapstub) stub;          //test uploading pdf         server._setproperty(call.attachment_encapsulation_format,   call.attachment_encapsulation_format_mtom);          filedatasource ds = new filedatasource("/test.zip");         datahandler dh = new datahandler(ds);          server.addattachment(dh);            system.out.println(server.gettimeout());         calendar cal = calendar.getinstance();         long x = cal.gettimeinmillis();         system.out.println("server: start receive@ "+  "\n" +   server.sendpdf("test.zip") + "\nserver: finished receive ");        }     catch (serviceexception e)     {         // todo auto-generated catch block         e.printstacktrace();     }      } }  

and code use process attachments on server side

public java.lang.string sendpdf(java.lang.string pdftosend) throws java.rmi.remoteexception {     string result = "";     attachmentpart[] attachments = null;     try     {         attachments = getattachments();     }     catch (exception e1)     {         result = "null attachments getattachments exception";         e1.printstacktrace();     }     if (attachments != null)     {         (int = 0; < attachments.length; i++)         {             attachmentpart attachment = attachments[i];             try             {                 file file = new file(pdftosend);                 inputstream in = attachment.getdatahandler().getinputstream();                 outputstream out = new fileoutputstream(file);                 byte[] buffer = new byte[8192];                 int len;                  while ((len = in.read(buffer)) > 0)                     out.write(buffer, 0, len);                  out.close();                 in.close();                  result += "file saved on server\nfile size : " + (file.length() / 1048576) + "mb \nsend type : " + this.receivedtype;              }             catch (ioexception e)             {                 result += "exception io";                 e.printstacktrace();             }             catch (soapexception e)             {                 result += "soap exception";                 e.printstacktrace();             }         }     }     return result; }  private attachmentpart[] getattachments() throws exception {     messagecontext msgcontext = messagecontext.getcurrentcontext();     message message = msgcontext.getrequestmessage();     attachments attachmentsimpl = message.getattachmentsimpl();     if (null == attachmentsimpl)     {         return new attachmentpart[0];     }     int attachmenstcount = attachmentsimpl.getattachmentcount();     this.receivedtype = attachmentsimpl.getsendtype();     attachmentpart attachments[] = new attachmentpart[attachmenstcount];      iterator<attachmentpart> iter = attachmentsimpl.getattachments().iterator();     int count = 0;     while (iter.hasnext())     {         attachmentpart part = iter.next();         attachments[count++] = part;     }     return attachments;  } 

if knows issue causing axisfault files larger 1mb appreciate it. thanks.

axis2 not support dime, see previous question: java client calling wse 2.0 dime attachment


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -