{"id":46228,"date":"2017-05-25T11:00:51","date_gmt":"2017-05-25T08:00:51","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=46228"},"modified":"2017-05-26T11:54:48","modified_gmt":"2017-05-26T08:54:48","slug":"jax-ws-attachment-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/","title":{"rendered":"Jax-Ws Attachment Example"},"content":{"rendered":"<p>In this example, we will show you how to exchange files with a SOAP web service using attachments.<\/p>\n<h2>1. Introduction<\/h2>\n<p>You may need to send or receive binary data, such as an image file or a PDF file, in a SOAP message. If the binary data is large, it would be inefficient to send it as part of a typical SOAP message. An alternative in such cases, is to transfer the binary data as an attachment to the message. Before we begin with our example, we&#8217;ll discuss a few standards.<\/p>\n<h3>1.1 Message Transmission Optimization Mechanism<\/h3>\n<p>Message Transmission Optimization Mechanism (MTOM) is a web service standard for optimizing the transfer of binary data in a SOAP message. The standard specifies the message format for packaging base64Binary data (such as an image file or PDF file).<\/p>\n<h3>1.2 XML-binary Optimized Packaging<\/h3>\n<p>XML-binary Optimized Packaging (XOP) is another standard used for packaging the SOAP message and attachment. XOP processing removes the binary data from the SOAP message and packages it as an attachment, placing a reference to the attachment in the message. The XML document and attachments together form the XOP package.<\/p>\n<h3>1.3 Multipurpose Internet Mail Extensions<\/h3>\n<p>Multipurpose Internet Mail Extensions (MIME) is yet another standard. The MIME standard supports multipart messages that have text content and non-text attachments. File attachments are categorized by MIME content types like image\/jpeg or application\/pdf. Attachments in a XOP package are MIME attachments.<\/p>\n<p>Let&#8217;s continue to our example.<\/p>\n<h3>1.4 Tools Used in this Example<\/h3>\n<ul>\n<li>Eclipse Oxygen<\/li>\n<li>Maven 3.2.1<\/li>\n<li>Tomcat 8.5.4<\/li>\n<li>SoapUI 5.3.0<\/li>\n<\/ul>\n<p>For Maven support within Eclipse, <a href=\"https:\/\/www.eclipse.org\/m2e\/documentation\/m2e-extension-development.html\">install M2Eclipse<\/a>. Please visit the M2Eclipse website for more information.<\/p>\n<p>To setup a Tomcat server for use in Eclipse, see <a href=\"https:\/\/www.javacodegeeks.com\/2013\/03\/tomcat-in-eclipse-6-popular-how-to-questions.html\"> Tomcat in Eclipse: 6 popular how to questions. <\/a><\/p>\n<h2>2. JAX-WS Attachment Example<\/h2>\n<p>In this example, we&#8217;ll develop a simple web service to upload and download files using MTOM. We will be attaching an image file to the SOAP message, but the attachment can be any type of binary file. This exercise uses &#8220;Java-first&#8221; or &#8220;bottom-up&#8221; web services development.<\/p>\n<h3>2.1 Create the Web Service Provider<\/h3>\n<h4>2.1.1 Create the Web Service Project<\/h4>\n<p>Let&#8217;s begin by creating a simple Maven Project. Select the Create a simple project (skip archetype selection) check box and click &#8220;Next&#8221;. Enter a Group Id and Artifact Id, select war for Packaging and click &#8220;Finish&#8221;.<\/p>\n<p><figure id=\"attachment_46267\" aria-describedby=\"caption-attachment-46267\" style=\"width: 612px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/maven-attach-project-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46267\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/maven-attach-project-wm.jpg\" alt=\"\" width=\"612\" height=\"542\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/maven-attach-project-wm.jpg 612w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/maven-attach-project-wm-300x266.jpg 300w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/a><figcaption id=\"caption-attachment-46267\" class=\"wp-caption-text\">Maven Project Configuration<\/figcaption><\/figure><\/p>\n<p>At this point, you will see the following error: <em> web.xml is missing and&lt;failOnMissingWebXml&gt; is set to true <\/em>, since we elected to package the application as a war file. To fix this, right-click on the project and select <em>Java EE Tools -&gt; Generate Deployment Descriptor Stub<\/em>.<\/p>\n<p>Open the pom.xml and add the following Maven plugins just above the closing <code>&lt;\/project&gt;<\/code> tag:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;build&gt;\r\n  &lt;pluginManagement&gt;\r\n    &lt;plugins&gt;\r\n      &lt;plugin&gt;\r\n      &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.6.1&lt;\/version&gt;\r\n      &lt;configuration&gt;\r\n        &lt;source&gt;1.8&lt;\/source&gt;\r\n        &lt;target&gt;1.8&lt;\/target&gt;\r\n      &lt;\/configuration&gt;\r\n    &lt;\/plugin&gt;\r\n    &lt;plugin&gt;\r\n      &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;maven-war-plugin&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.0.0&lt;\/version&gt;\r\n      &lt;configuration&gt;\r\n        &lt;warSourceDirectory&gt;src\/main\/webapp&lt;\/warSourceDirectory&gt;\r\n        &lt;webXml&gt;src\/main\/webapp\/WEB-INF\/web.xml&lt;\/webXml&gt;\r\n        &lt;warName&gt;JaxWsAttach&lt;\/warName&gt;\r\n      &lt;\/configuration&gt;\r\n      &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n  &lt;\/pluginManagement&gt;\r\n&lt;\/build&gt;\r\n<\/pre>\n<p>Also, add the following dependencies below the closing <code>&lt;\/build&gt;<\/code> tag:<\/p>\n<pre class=\"brush:xml\">&lt;dependencies&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;org.apache.cxf&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;\/artifactId&gt;\r\n    &lt;version&gt;3.1.11&lt;\/version&gt;\r\n  &lt;\/dependency&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;org.apache.cxf&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;cxf-rt-transports-http&lt;\/artifactId&gt;\r\n    &lt;version&gt;3.1.11&lt;\/version&gt;\r\n  &lt;\/dependency&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-core&lt;\/artifactId&gt;\r\n    &lt;version&gt;4.3.8.RELEASE&lt;\/version&gt;\r\n  &lt;\/dependency&gt;\r\n  &lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-web&lt;\/artifactId&gt;\r\n   &lt;version&gt;4.3.8.RELEASE&lt;\/version&gt;\r\n  &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;\r\n<\/pre>\n<p>Save the changes and select: <em>Maven-&gt;Update Project <\/em> from the project context menu.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h4>2.1.2 Create the Service Endpoint Interface (SEI)<\/h4>\n<p>We&#8217;ll create a Java interface that defines two methods, one for uploading a file and one for downloading a file.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>FileManager.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import javax.activation.DataHandler;\r\nimport javax.jws.WebService;\r\n\r\n@WebService\r\npublic interface FileManager {\r\n\r\n\tvoid uploadFile(@WebParam(name = \"file\") DataHandler file);\r\n\r\n\tDataHandler downloadFile();\r\n}\r\n<\/pre>\n<p>We use the <code>@WebParam<\/code> annotation to specify the name of the parameter as it will appear in the WSDL.<\/p>\n<p>We use the <code>javax.activation.DataHandler<\/code> type in our methods. The DataHandler interface provides a consistent way to access input and output streams from a data source, regardless of what format the data source uses.<\/p>\n<h4>2.1.3 Implement the Service Interface<\/h4>\n<p>Next, we&#8217;ll implement the SEI created in the previous step. We set a <code>Path<\/code> class variable that we&#8217;ll use as both the uploaded and downloaded file location.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>FileManagerImpl.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import java.io.File;\r\nimport java.io.FileOutputStream;\r\nimport java.io.IOException;\r\nimport java.io.InputStream;\r\nimport java.io.OutputStream;\r\nimport java.nio.file.Path;\r\nimport java.nio.file.Paths;\r\n\r\nimport javax.activation.DataHandler;\r\nimport javax.activation.DataSource;\r\nimport javax.activation.FileDataSource;\r\nimport javax.jws.WebMethod;\r\nimport javax.jws.WebService;\r\nimport javax.xml.bind.annotation.XmlMimeType;\r\n\r\n@WebService(endpointInterface = \"com.javacodegeeks.examples.jaxws.service.FileManager\",\r\n\tserviceName = \"FileManager \")\r\npublic class FileManagerImpl implements FileManager {\r\n\r\n\tprivate Path path = Paths.get(\"\/Users\/gilbertlopez\/uploaded\/test.jpg\");\r\n\r\n\t@Override\r\n\t@WebMethod\r\n\tpublic void uploadFile(DataHandler file) {\r\n\r\n\t\ttry (InputStream input = file.getInputStream();\r\n\t\t\t\tOutputStream output = new FileOutputStream(\r\n\t\t\t\t\t\tnew File(path.toString()));) {\r\n\r\n\t\t\tbyte[] b = new byte[100000];\r\n\t\t\tint bytesRead = 0;\r\n\t\t\twhile ((bytesRead = input.read(b)) != -1) {\r\n\t\t\t\toutput.write(b, 0, bytesRead);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t\/\/ TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t@Override\r\n\t@WebMethod\r\n\tpublic  @XmlMimeType(\"application\/octet-stream\")\r\n\tDataHandler downloadFile() {\r\n\r\n\t\tDataSource dataSource = new FileDataSource(\r\n\t\t\t\tnew File(path.toString()));\r\n\t\treturn new DataHandler(dataSource);\r\n\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>Uploading a File<\/strong>: We create an <code>InputStream<\/code> from <code>file.getInputStream()<\/code> and an <code>OutputStream<\/code> with the <code>FileOutputStream(File file)<\/code> constructor. We then read the input stream into a byte array and write the array to the file specified by <code>Path<\/code>.<\/p>\n<p>We are using a Java 7 try-with-resources statement that will close the streams at the end of the try block automatically.<\/p>\n<p><strong>Downloading a File<\/strong>: We annotate the return type of the <code>DataHandler downloadFile()<\/code> method with <code>@XmlMimeType(application\/octet-stream)<\/code>. The MIME type <em>application\/octet-stream<\/em> can be used for different file types, such as an image file or PDF file. When using this annotation, MTOM will optimize the serialization of the underlying binary data. Otherwise, MTOM will just serialize it as a byte array (<code>byte[]<\/code>), which is less efficient.<\/p>\n<p>We then declare a <code>javax.activation.DataSource<\/code> variable, assigning it a <code>FileDataSource<\/code> whose data source is the file specified by the Path class variable. Finally, we return our <code>DataHandler<\/code> with our data source.<\/p>\n<h4>2.1.4 Create the Spring Configuration File<\/h4>\n<p>Create the cxf-servlet.xml file in the webapp\/WEB-INF directory to set up our service endpoint.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>cxf-servlet.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:jaxws=\"http:\/\/cxf.apache.org\/jaxws\"\r\nxmlns:cxf=\"http:\/\/cxf.apache.org\/core\"\r\nxmlns:soap=\"http:\/\/cxf.apache.org\/bindings\/soap\"\r\nxsi:schemaLocation=\"http:\/\/cxf.apache.org\/core http:\/\/cxf.apache.org\/schemas\/core.xsd http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd http:\/\/cxf.apache.org\/bindings\/soap http:\/\/cxf.apache.org\/schemas\/configuration\/soap.xsd http:\/\/cxf.apache.org\/jaxws http:\/\/cxf.apache.org\/schemas\/jaxws.xsd\"&gt;\r\n\r\n  &lt;jaxws:server id=\"fileManager\" serviceClass=\"com.javacodegeeks.examples.jaxws.service.FileManager\" address=\"\/fileManager\"&gt;\r\n    &lt;jaxws:serviceBean&gt;\r\n      &lt;bean class=\"com.javacodegeeks.examples.jaxws.service.FileManagerImpl\" \/&gt;\r\n    &lt;\/jaxws:serviceBean&gt;\r\n    &lt;jaxws:properties&gt;\r\n      &lt;entry key=\"mtom-enabled\" value=\"true\" \/&gt;\r\n    &lt;\/jaxws:properties&gt;\r\n&lt;\/jaxws:server&gt;\r\n\r\n&lt;\/beans&gt;\r\n<\/pre>\n<p>We&#8217;ll set the <code>\"mtom-enabled\"<\/code> property to <code>\"true\"<\/code> to enable binary transfer optimization.<\/p>\n<h4>2.1.5 Configure the CXF servlet in web.xml<\/h4>\n<p>The last step is to configure the <code>CXFServlet<\/code> in web.xml. We&#8217;ll map the servlet to handle all requests coming through <em>\/services\/*<\/em>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>web.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;web-app xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\" xsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd\" version=\"2.5\"&gt;\r\n  &lt;display-name&gt;JaxWsAttachmentExample\r\n&lt;\/display-name&gt;\r\n &lt;servlet&gt;\r\n   &lt;servlet-name&gt;cxfservlet&lt;\/servlet-name&gt;\r\n   &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;\/servlet-class&gt;\r\n   &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n &lt;\/servlet&gt;\r\n &lt;servlet-mapping&gt;\r\n   &lt;servlet-name&gt;cxfservlet&lt;\/servlet-name&gt;\r\n   &lt;url-pattern&gt;\/services\/*&lt;\/url-pattern&gt;\r\n &lt;\/servlet-mapping&gt;\r\n&lt;\/web-app&gt;\r\n\r\n<\/pre>\n<h4>2.1.6 Start the FileManager Service<\/h4>\n<p>Run <em>maven clean<\/em> to clear the target directory and <em>maven install<\/em> to create the war file. (Right-click the project and select <em> Run as <\/em> and you will see these options in the context menu.) The generated war file can be deployed to a Tomcat server by copying it to the webapps directory and starting the server.<\/p>\n<p>Let&#8217;s test our web service from within Eclipse. Right-click the project and select <em>Run As -&gt; Run on Server<\/em>. Select the Tomcat server and add our project to configure and click &#8220;Finish&#8221;. When the application starts, we will see a 404 error in the browser, since we do not have a welcome page specified in web.xml. Enter <em>\/services\/<\/em> at the end of the URL and hit Enter. You will see a link to the WSDL file on the &#8220;Available SOAP services&#8221; page.<\/p>\n<p><figure id=\"attachment_46289\" aria-describedby=\"caption-attachment-46289\" style=\"width: 646px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/file-manager-service-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46289\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/file-manager-service-wm.jpg\" alt=\"\" width=\"646\" height=\"301\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/file-manager-service-wm.jpg 646w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/file-manager-service-wm-300x140.jpg 300w\" sizes=\"(max-width: 646px) 100vw, 646px\" \/><\/a><figcaption id=\"caption-attachment-46289\" class=\"wp-caption-text\">FileManager Service<\/figcaption><\/figure><\/p>\n<p>Click the link to see the WSDL file that was generated by the web services runtime.<\/p>\n<p><strong>Note:<\/strong> If you are using Eclipse s internal browser, you may see a blank page. Copy the URL from the address bar and open the link in an external browser.<\/p>\n<h3>2.2 Testing the Web Service with SoapUI<\/h3>\n<p>We&#8217;ll test our web service with SoapUI.<\/p>\n<p>Start SoapUI and create a new SOAP project by clicking the SOAP button on the top bar.<\/p>\n<p><figure id=\"attachment_46280\" aria-describedby=\"caption-attachment-46280\" style=\"width: 663px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/soapui-project-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46280\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/soapui-project-wm.jpg\" alt=\"Create a SOAP Project\" width=\"663\" height=\"371\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/soapui-project-wm.jpg 663w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/soapui-project-wm-300x168.jpg 300w\" sizes=\"(max-width: 663px) 100vw, 663px\" \/><\/a><figcaption id=\"caption-attachment-46280\" class=\"wp-caption-text\">Create a SOAP Project<\/figcaption><\/figure><\/p>\n<p>Enter a name for your project and paste the WSDL URL link of the web service in the <em>Initial WSDL<\/em> text box, for example: http:\/\/localhost:8080\/JaxWsAttach\/services\/fileManager?wsdl. Make sure Create Requests is selected and click &#8220;OK&#8221;.<\/p>\n<p><figure id=\"attachment_46283\" aria-describedby=\"caption-attachment-46283\" style=\"width: 643px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/SOAP2-WM.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46283\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/SOAP2-WM.jpg\" alt=\"New SOAP Project Configuration\" width=\"643\" height=\"395\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/SOAP2-WM.jpg 643w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/SOAP2-WM-300x184.jpg 300w\" sizes=\"(max-width: 643px) 100vw, 643px\" \/><\/a><figcaption id=\"caption-attachment-46283\" class=\"wp-caption-text\">New SOAP Project Configuration<\/figcaption><\/figure><\/p>\n<h4>2.2.1 Test Uploading a File<\/h4>\n<p>Expand FileManagerServiceSOAPBinding and uploadFile in the Navigator and double-click Request 1.<\/p>\n<p><figure id=\"attachment_46284\" aria-describedby=\"caption-attachment-46284\" style=\"width: 772px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/request1-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46284\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/request1-wm.jpg\" alt=\"\" width=\"772\" height=\"503\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/request1-wm.jpg 772w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/request1-wm-300x195.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/request1-wm-768x500.jpg 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/a><figcaption id=\"caption-attachment-46284\" class=\"wp-caption-text\">Upload Request<\/figcaption><\/figure><\/p>\n<p>Notice that the <code>&lt;file&gt;<\/code> element in the request has a unique ID. We&#8217;ll bind the attachment to this ID. (Remember, MIME specifies that the binary data in the SOAP message will be sent as a multipart attachment.)<\/p>\n<p>Click Attachments at the bottom of the request pane and click the + button in the upper-left hand corner.<\/p>\n<p><figure id=\"attachment_46285\" aria-describedby=\"caption-attachment-46285\" style=\"width: 776px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/add-attachment-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46285\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/add-attachment-wm.jpg\" alt=\"\" width=\"776\" height=\"366\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/add-attachment-wm.jpg 776w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/add-attachment-wm-300x141.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/add-attachment-wm-768x362.jpg 768w\" sizes=\"(max-width: 776px) 100vw, 776px\" \/><\/a><figcaption id=\"caption-attachment-46285\" class=\"wp-caption-text\">Add Attachment<\/figcaption><\/figure><\/p>\n<p>Browse to the location of your file and click &#8220;Open&#8221;. Click &#8220;No&#8221; when prompted to cache attachment in request .<\/p>\n<p>Select the unique ID from the list under the Part column.<\/p>\n<p><figure id=\"attachment_46286\" aria-describedby=\"caption-attachment-46286\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/new-part-no-wm.jpg\"><img decoding=\"async\" class=\"wp-image-46286 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/new-part-no-wm.jpg\" alt=\"\" width=\"700\" height=\"293\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/new-part-no-wm.jpg 700w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/new-part-no-wm-300x126.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><figcaption id=\"caption-attachment-46286\" class=\"wp-caption-text\">Select the Part ID<\/figcaption><\/figure><\/p>\n<p>Click the green submit arrow on the upper-left corner of the Request window. You should see a successful response.<\/p>\n<p><figure id=\"attachment_46287\" aria-describedby=\"caption-attachment-46287\" style=\"width: 859px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/response-wm.jpg\"><img decoding=\"async\" class=\"size-full wp-image-46287\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/response-wm.jpg\" alt=\"\" width=\"859\" height=\"493\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/response-wm.jpg 859w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/response-wm-300x172.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/response-wm-768x441.jpg 768w\" sizes=\"(max-width: 859px) 100vw, 859px\" \/><\/a><figcaption id=\"caption-attachment-46287\" class=\"wp-caption-text\">Response from the Upload Operation<\/figcaption><\/figure><\/p>\n<p>You can verify that the file was transferred by checking the file system.<\/p>\n<h4>2.2.2 Test Downloading a File<\/h4>\n<p>Expand FileManagerServiceSOAPBinding and downloadFile in the Navigator and double-click Request 1. Click the green submit arrow on the upper-left corner of the request window. You should see a successful response.<\/p>\n<p>You will notice that the response SOAP message has a <code>&lt;xop:Include&gt;<\/code> tag. The ID value contained inside this tag is a reference to the attached file. Click Attachments at the bottom of the response page and double-click the file attachment in the list. The image will display in your favorite image viewer.<\/p>\n<h2>3. Conclusion<\/h2>\n<p>In this example, we have shown you how to send and receive binary data, such as an image file or a PDF file, as an attachment to the SOAP message when using &#8220;Java-first&#8221; web services development.<\/p>\n<h2>4. Download the Source Code<\/h2>\n<p>This was a JAX-WS Attachment Example.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here:<\/p>\n<ol>\n<li><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/JaxWsAttachmentExample.zip\"><strong>JaxWsAttachmentExample<\/strong><\/a><\/li>\n<li><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/05\/JAX-WS-FileManager-soapui-project.xml_.zip\"><strong>JaxWsAttachmentSoapUIProject<\/strong><\/a><\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary data, such as an image file or a PDF file, in a SOAP message. If the binary data is large, it would be inefficient to send it &hellip;<\/p>\n","protected":false},"author":121,"featured_media":1240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[461],"tags":[840,481,198,1264,1263,254],"class_list":["post-46228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jws","tag-apache-cxf","tag-apache-tomcat","tag-enterprise-java-2","tag-jax-ws","tag-jws","tag-web-services-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jax-Ws Attachment Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jax-Ws Attachment Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-25T08:00:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-26T08:54:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gilbert Lopez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gillopez_dev\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gilbert Lopez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\"},\"author\":{\"name\":\"Gilbert Lopez\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce\"},\"headline\":\"Jax-Ws Attachment Example\",\"datePublished\":\"2017-05-25T08:00:51+00:00\",\"dateModified\":\"2017-05-26T08:54:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\"},\"wordCount\":1409,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"keywords\":[\"apache cxf\",\"Apache Tomcat\",\"enterprise java\",\"JAX-WS\",\"Jws\",\"web services\"],\"articleSection\":[\"jws\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\",\"name\":\"Jax-Ws Attachment Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"datePublished\":\"2017-05-25T08:00:51+00:00\",\"dateModified\":\"2017-05-26T08:54:48+00:00\",\"description\":\"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"jws\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jws\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Jax-Ws Attachment Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce\",\"name\":\"Gilbert Lopez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg\",\"caption\":\"Gilbert Lopez\"},\"description\":\"Gilbert Lopez is an application developer and systems integration developer with experience building business solutions for large and medium-sized companies. He has worked on many Java EE projects. His roles have included lead developer, systems analyst, business analyst and consultant. Gilbert graduated from California State University in Los Angeles with a Bachelor of Science degree in Business.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\",\"https:\/\/www.linkedin.com\/in\/gilbertlopezdeveloper\",\"https:\/\/x.com\/gillopez_dev\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/gilbert-lopez\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jax-Ws Attachment Example - Java Code Geeks","description":"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/","og_locale":"en_US","og_type":"article","og_title":"Jax-Ws Attachment Example - Java Code Geeks","og_description":"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-05-25T08:00:51+00:00","article_modified_time":"2017-05-26T08:54:48+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Gilbert Lopez","twitter_card":"summary_large_image","twitter_creator":"@gillopez_dev","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Gilbert Lopez","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/"},"author":{"name":"Gilbert Lopez","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce"},"headline":"Jax-Ws Attachment Example","datePublished":"2017-05-25T08:00:51+00:00","dateModified":"2017-05-26T08:54:48+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/"},"wordCount":1409,"commentCount":7,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","keywords":["apache cxf","Apache Tomcat","enterprise java","JAX-WS","Jws","web services"],"articleSection":["jws"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/","name":"Jax-Ws Attachment Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","datePublished":"2017-05-25T08:00:51+00:00","dateModified":"2017-05-26T08:54:48+00:00","description":"In this example, we will show you how to exchange files with a SOAP web service using attachments. 1. Introduction You may need to send or receive binary","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-attachment-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"jws","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jws\/"},{"@type":"ListItem","position":5,"name":"Jax-Ws Attachment Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6169578062b8f6f6a1f79c82aafdb9ce","name":"Gilbert Lopez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/04\/Gilbert-Lopez_avatar_1492457226-96x96.jpg","caption":"Gilbert Lopez"},"description":"Gilbert Lopez is an application developer and systems integration developer with experience building business solutions for large and medium-sized companies. He has worked on many Java EE projects. His roles have included lead developer, systems analyst, business analyst and consultant. Gilbert graduated from California State University in Los Angeles with a Bachelor of Science degree in Business.","sameAs":["https:\/\/www.javacodegeeks.com","https:\/\/www.linkedin.com\/in\/gilbertlopezdeveloper","https:\/\/x.com\/gillopez_dev"],"url":"https:\/\/examples.javacodegeeks.com\/author\/gilbert-lopez\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/46228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/121"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=46228"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/46228\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1240"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=46228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=46228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=46228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}