{"id":152,"date":"2008-10-23T16:50:53","date_gmt":"2008-10-23T20:50:53","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=152"},"modified":"2009-01-24T12:20:38","modified_gmt":"2009-01-24T17:20:38","slug":"jax-ws-ri-mtom","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=152","title":{"rendered":"JAX-WS RI MTOM"},"content":{"rendered":"<p><strong>What does MTOM\/XOP do:<\/strong><br \/>\nBinary data is encoded and transmitted as an attachment which is still referable and reacheable from within the message as part of the XML infoset.<\/p>\n<p><strong>Enable client side MTOM feature:<\/strong><\/p>\n<pre lang=\"java\">MtomSample port = new MtomService().getMtomPort(new MTOMFeature());<\/pre>\n<p><strong>Enable server side MTOM:<\/strong><br \/>\n<em>Annotate server implementation class<\/em><\/p>\n<pre lang=\"java\">\r\nimport javax.xml.ws.soap.MTOM;\r\n\r\n@MTOM\r\n@WebService (endpointInterface = \"mtom.server.MtomSample\")\r\n\r\npublic class MtomSampleImpl implements MtomSample {\r\n...\r\n<\/pre>\n<p><em>Annotate the data element with xmime:expectedContentTypes<\/em><\/p>\n<pre lang=\"xml\">\r\n<wsdl:types>\r\n  <schema\r\n    xmlns=\"http:\/\/www.w3.org\/2001\/XMLSchema\"\r\n    targetNamespace=\"http:\/\/example.org\/mtom\/data\"\r\n    xmlns:xmime=\"http:\/\/www.w3.org\/2005\/05\/xmlmime\"\r\n    elementFormDefault=\"qualified\">\r\n\r\n    <!-- annotating the 'data' element below with \r\n         xmime:expectedContentTypes will\r\n         result in to this paramter mapped to java.awt.Image\r\n     -->\r\n    <element name=\"photo\" type=\"base64Binary\" \r\n      xmime:expectedContentTypes=\"image\/jpeg\"\/>\r\n    <element name=\"data\" type=\"base64Binary\" \r\n      xmime:expectedContentTypes=\"application\/octet-stream\"\/>\r\n    <element name=\"uploadResponse\" type=\"string\"\/>\r\n    <element name=\"size\" type=\"int\"\/>\r\n  <\/schema>\r\n\r\n<\/wsdl:types>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What does MTOM\/XOP do: Binary data is encoded and transmitted as an attachment which is still referable and reacheable from within the message as part of the XML infoset. Enable client side MTOM feature: MtomSample port = new MtomService().getMtomPort(new MTOMFeature()); &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=152\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","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":[41,22],"tags":[],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-jax-ws","category-soa"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-2s","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/152","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=152"}],"version-history":[{"count":1,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}