{"id":955,"date":"2009-06-03T11:44:55","date_gmt":"2009-06-03T16:44:55","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=955"},"modified":"2009-06-03T11:44:55","modified_gmt":"2009-06-03T16:44:55","slug":"handle-web-services-large-attachments","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=955","title":{"rendered":"Handle Web Services Large Attachments"},"content":{"rendered":"<span id=\"Axis2\"><h1>Axis2<\/h1><\/span>\n<span id=\"Upload_Files\"><h2>Upload Files<\/h2><\/span>\n<p>On the server side, edit axis2\\WEB-INF\\conf\\axis2.xml<\/p>\n<pre lang=\"xml\">\r\n<!-- enable one only -->\r\n<parameter name=\"enableMTOM\">false<\/parameter>\r\n<parameter name=\"enableSwA\">true<\/parameter>\r\n\r\n<!--Uncomment if you want to enable file caching for attachments -->\r\n<parameter name=\"cacheAttachments\">true<\/parameter>\r\n<parameter name=\"attachmentDIR\">c:\/temp\/axis2<\/parameter>\r\n<!-- file size LARGER than sizeThreshold value will be CACHED -->\r\n<parameter name=\"sizeThreshold\">4000<\/parameter>\r\n<\/pre>\n<span id=\"Download_Files\"><h2>Download Files<\/h2><\/span>\n<p>On the client side,<\/p>\n<pre lang=\"java\">\r\nOptions options = new Options();\r\noptions.setTo(targetEPR);\r\n\r\n\/\/ Do NOT enable both MTOM and SWA if so MTOM takes precedence\r\n\/\/options.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);\r\noptions.setProperty(Constants.Configuration.ENABLE_SWA,\r\n    Constants.VALUE_TRUE);\r\n\r\noptions.setProperty(Constants.Configuration.CACHE_ATTACHMENTS, Constants.VALUE_TRUE);\r\noptions.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR,\"C:\\\\temp\\\\axis2\");\r\noptions.setProperty(Constants.Configuration.FILE_SIZE_THRESHOLD, \"4000\");\r\n\/\/ Increase the time out when sending large attachments\r\noptions.setTimeOutInMilliSeconds(1000000);\r\n\r\noptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Axis2 Upload Files On the server side, edit axis2\\WEB-INF\\conf\\axis2.xml false true true c:\/temp\/axis2 4000 Download Files On the client side, Options options = new Options(); options.setTo(targetEPR); \/\/ Do NOT enable both MTOM and SWA if so MTOM takes precedence \/\/options.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE); &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=955\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22],"tags":[],"class_list":["post-955","post","type-post","status-publish","format-standard","hentry","category-soa"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-fp","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=955"}],"version-history":[{"count":4,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions"}],"predecessor-version":[{"id":959,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions\/959"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}