{"id":53911,"date":"2018-01-08T15:00:43","date_gmt":"2018-01-08T13:00:43","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=53911"},"modified":"2019-02-14T11:23:39","modified_gmt":"2019-02-14T09:23:39","slug":"spring-soap-xml-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/","title":{"rendered":"Spring SOAP with XML Example"},"content":{"rendered":"<p>Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among disparate systems. Simple Object Access Protocol (SOAP) was developed by Microsoft as an improvement over the existing technologies like Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA) and Java Remote Method Invocation (RMI) that relied on binary and proprietary formats. A SOAP message chiefly uses the eXtensible Markup Language (XML) for the message format, HyperText Transfer Protocol for the transport protocol and the interface definition in a file using the Web Services Definition Language (WSDL). Other formats and protocols can also be used with SOAP. In summary, SOAP is platform-independent, has built-in error handling and is extensible providing support for security, federation, reliability and other aspects.\n<\/p>\n<div class=\"toc\">\n<h3>Table of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#application\">2. Application<\/a><\/dt>\n<dt><a href=\"#environment\">3. Environment<\/a><\/dt>\n<dt><a href=\"#sourcecode\">4. Source Code<\/a><\/dt>\n<dt><a href=\"#howtorunandtest\">5. How to Run and Test<\/a><\/dt>\n<dt><a href=\"#summary\">6. Summary<\/a><\/dt>\n<dt><a href=\"#usefullinks\">7. Useful Links<\/a><\/dt>\n<dt><a href=\"#download\">8. Download the Source Code<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>In this article, we will show how to implement a SOAP web service with XML request and response in a Spring Boot application. Using Spring framework&#8217;s Dependency Injection and annotation based support in conjunction with the maven plugin <code>jaxb2-maven-plugin,<\/code> the whole process of extracting XML from the SOAP input, mapping to Java objects and returning the SOAP response becomes very easy so that developers can focus on implementing business logic and unit testing the application.<\/p>\n<h2><a name=\"application\"><\/a>2. Application<\/h2>\n<p>The application we will develop is a web service for calculating the surcharge to be applied to an order. An order has the fields id, value, payment_method and a customer. The fields of customer are name (&#8220;first&#8221;, &#8220;last&#8221;) and an address, which in turn has the fields street (&#8220;line&#8221; which can take values 1 and 2), city, postal code and country.<\/p>\n<p>The surcharge is calculated as a percentage. If the customer&#8217;s country is &#8220;US&#8221;, surcharge is 10%, otherwise it is 15%. If payment method is credit card, indicated by CC, the surcharge will be increased by 3%. If the order value is greater than 1000, a discount of 1% will be given. A discount is a negative surcharge and since the calculation is very simple, it is kept in this service. In real world applications, discounting will be a service of its own. Since all surcharges for this application are in percentages, we will not consider the % symbol either in the input or output and will be returned as an int.<\/p>\n<h2><a name=\"environment\"><\/a>3. Environment<\/h2>\n<p>I have used the following technologies for this application:<\/p>\n<ul>\n<li>Java 1.8<\/li>\n<li>Spring Boot 1.5.9<\/li>\n<li>JAXB2 Maven plugin 1.6<\/li>\n<li>Maven 3.3.9<\/li>\n<li>Ubuntu 16.04 LTS<\/li>\n<\/ul>\n<h2><a name=\"sourcecode\"><\/a>4. Source Code<\/h2>\n<p>Typically you would get a sample XML file from your business analyst or client showing all the elements and data used to send as input to the web service. The following snippet shows a sample order in XML format.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>sample1.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;order&gt;\n    &lt;id&gt;S12345&lt;\/id&gt;\n    &lt;value&gt;1250&lt;\/value&gt;\n    &lt;payment_method&gt;CC&lt;\/payment_method&gt;\n    &lt;customer&gt;\n        &lt;name part=\"first\"&gt;Nancy&lt;\/name&gt;\n        &lt;name part=\"last\"&gt;Smith&lt;\/name&gt;\n        &lt;address&gt;\n            &lt;street line=\"1\"&gt;41 Earnest Road&lt;\/street&gt;\n            &lt;street line=\"2\"&gt;Rotamonte Park&lt;\/street&gt;\n            &lt;city&gt;Koregon&lt;\/city&gt;\n            &lt;postalcode&gt;12345&lt;\/postalcode&gt;\n            &lt;country&gt;UK&lt;\/country&gt;\n        &lt;\/address&gt;\n    &lt;\/customer&gt;\n&lt;\/order&gt;\n<\/pre>\n<p>The first step in implementing the SOAP web service is to create an XML schema definition file. We will name it <code>surcharge.xsd<\/code> and it can be either hand written or generated with a plugin. I have used the online tool <a href=\"http:\/\/xmlgrid.net\/xml2xsd.html\">xmlgrid.net\/xml2xsd.html<\/a>. The generated xsd shows a few errors in Eclipse, which had to be corrected. For example, the error for <code>name<\/code> element is:<\/p>\n<pre class=\"brush:bash\">Element 'name' has both a 'type' attribute and a 'anonymous type' child. Only one of these is allowed for an element.<\/pre>\n<p>The generated XML is:<\/p>\n<pre class=\"brush:xml\">&lt;xs:element name=\"name\" maxOccurs=\"unbounded\" type=\"xs:string\"&gt;\n    &lt;xs:complexType&gt;\n        &lt;xs:attribute name=\"part\" type=\"xs:string\"&gt;&lt;\/xs:attribute&gt;\n    &lt;\/xs:complexType&gt;\n&lt;\/xs:element&gt;<\/pre>\n<p>It has to be corrected to<\/p>\n<pre class=\"brush:xml\">&lt;xs:element maxOccurs=\"2\" name=\"name\"&gt;\n&nbsp; &nbsp; &lt;xs:complexType&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:simpleContent&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:extension base=\"xs:string\"&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:attribute name=\"part\" type=\"xs:string\" \/&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/xs:extension&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/xs:simpleContent&gt;\n&nbsp; &nbsp; &lt;\/xs:complexType&gt;\n&lt;\/xs:element&gt;\n<\/pre>\n<p>In general, the xsd file has two patterns to be applied:<br \/>\n1) element &#8211; complexType &#8211; sequence &#8211; element &#8211; complexType &#8211; sequence &#8211; element \/ element<br \/>\n2) element &#8211; complexType &#8211; simpleContent &#8211; extension &#8211; attribute<\/p>\n<p>Your xsd file will be a combination of these two patterns to cater to any nested XML data. The final corrected xsd file including the response element is shown below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>surcharge.xsd<\/em><\/span><\/p>\n<pre class=\"brush:xml; wrap-lines:false\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;xs:schema xmlns:xs=\"http:\/\/www.w3.org\/2001\/XMLSchema\"\ntargetNamespace=\"http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated\"\nxmlns:tns=\"http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated\"\nelementFormDefault=\"qualified\"&gt;\n\n    &lt;xs:element name=\"SurchargeRequest\"&gt;\n        &lt;xs:complexType&gt;\n            &lt;xs:sequence&gt;\n                &lt;xs:element name=\"order\"&gt;\n                    &lt;xs:complexType&gt;\n                        &lt;xs:sequence&gt;\n                            &lt;xs:element name=\"id\" type=\"xs:string\"&gt;&lt;\/xs:element&gt;\n                            &lt;xs:element name=\"value\" type=\"xs:int\"&gt;&lt;\/xs:element&gt;\n                            &lt;xs:element name=\"payment_method\" type=\"xs:string\"&gt;&lt;\/xs:element&gt;\n                            &lt;xs:element name=\"customer\"&gt;\n                                &lt;xs:complexType&gt;\n                                    &lt;xs:sequence&gt;\n                                        &lt;xs:element maxOccurs=\"2\" name=\"name\"&gt;\n                                            &lt;xs:complexType&gt;\n                                                &lt;xs:simpleContent&gt;\n                                                    &lt;xs:extension base=\"xs:string\"&gt;\n                                                        &lt;xs:attribute name=\"part\" type=\"xs:string\" \/&gt;\n                                                    &lt;\/xs:extension&gt;\n                                                &lt;\/xs:simpleContent&gt;\n                                            &lt;\/xs:complexType&gt;\n                                        &lt;\/xs:element&gt;\n                                        &lt;xs:element name=\"address\"&gt;\n                                            &lt;xs:complexType&gt;\n                                                &lt;xs:sequence&gt;\n                                                    &lt;xs:element maxOccurs=\"2\" name=\"street\"&gt;\n                                                        &lt;xs:complexType&gt;\n                                                            &lt;xs:simpleContent&gt;\n                                                                &lt;xs:extension base=\"xs:string\"&gt;\n                                                                    &lt;xs:attribute name=\"line\" type=\"xs:string\" \/&gt;\n                                                                &lt;\/xs:extension&gt;\n                                                            &lt;\/xs:simpleContent&gt;\n                                                        &lt;\/xs:complexType&gt;\n                                                    &lt;\/xs:element&gt;\n                                                    &lt;xs:element name=\"city\" type=\"xs:string\"&gt;&lt;\/xs:element&gt;\n                                                    &lt;xs:element name=\"postalcode\" type=\"xs:int\"&gt;&lt;\/xs:element&gt;\n                                                    &lt;xs:element name=\"country\" type=\"xs:string\"&gt;&lt;\/xs:element&gt;\n                                                &lt;\/xs:sequence&gt;\n                                            &lt;\/xs:complexType&gt;\n                                        &lt;\/xs:element&gt;\n                                    &lt;\/xs:sequence&gt;\n                                &lt;\/xs:complexType&gt;\n                            &lt;\/xs:element&gt;\n                        &lt;\/xs:sequence&gt;\n                    &lt;\/xs:complexType&gt;\n                &lt;\/xs:element&gt;\n            &lt;\/xs:sequence&gt;\n        &lt;\/xs:complexType&gt;\n    &lt;\/xs:element&gt;\n\n    &lt;xs:element name=\"SurchargeResponse\"&gt;\n        &lt;xs:complexType&gt;\n            &lt;xs:sequence&gt;\n                &lt;xs:element name=\"surcharge\" type=\"xs:int\" \/&gt;\n            &lt;\/xs:sequence&gt;\n        &lt;\/xs:complexType&gt;\n    &lt;\/xs:element&gt;\n\n&lt;\/xs:schema&gt;\n<\/pre>\n<p>The target namespace is specified as &#8220;http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated&#8221;. With this, a package called <code>org.javacodegeeks.webservices.soap.surcharge.generated<\/code> will be created during compile time and the classes generated from the xsd file will be placed there.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Since this is a maven-based project, all the project-level settings and dependencies are given in pom.xml file.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml; wrap-lines:false\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\nxsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n\n    &lt;groupId&gt;org.javacodegeeks.webservices.soap&lt;\/groupId&gt;\n    &lt;artifactId&gt;surcharge&lt;\/artifactId&gt;\n    &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\n\n    &lt;name&gt;surcharge&lt;\/name&gt;\n    &lt;description&gt;Demo project for Spring Boot&lt;\/description&gt;\n\n    &lt;parent&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\n        &lt;version&gt;1.5.9.RELEASE&lt;\/version&gt;\n        &lt;relativePath \/&gt; &lt;!-- lookup parent from repository --&gt;\n    &lt;\/parent&gt;\n\n    &lt;properties&gt;\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\n        &lt;project.reporting.outputEncoding&gt;UTF-8&lt;\/project.reporting.outputEncoding&gt;\n        &lt;java.version&gt;1.8&lt;\/java.version&gt;\n    &lt;\/properties&gt;\n\n    &lt;dependencies&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n            &lt;artifactId&gt;spring-boot-starter-web-services&lt;\/artifactId&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;wsdl4j&lt;\/groupId&gt;\n            &lt;artifactId&gt;wsdl4j&lt;\/artifactId&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n            &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\n            &lt;scope&gt;test&lt;\/scope&gt;\n         &lt;\/dependency&gt;\n    &lt;\/dependencies&gt;\n\n    &lt;build&gt;\n        &lt;plugins&gt;\n            &lt;plugin&gt;\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n                    &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\n             &lt;\/plugin&gt;\n             &lt;plugin&gt;\n                 &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\n                 &lt;artifactId&gt;jaxb2-maven-plugin&lt;\/artifactId&gt;\n                 &lt;version&gt;1.6&lt;\/version&gt;\n                 &lt;executions&gt;\n                     &lt;execution&gt;\n                         &lt;id&gt;xjc&lt;\/id&gt;\n                         &lt;goals&gt;\n                             &lt;goal&gt;xjc&lt;\/goal&gt;\n                         &lt;\/goals&gt;\n                     &lt;\/execution&gt;\n                 &lt;\/executions&gt;\n                 &lt;configuration&gt;\n                     &lt;clearOutputDir&gt;false&lt;\/clearOutputDir&gt;\n                     &lt;schemaDirectory&gt;${project.basedir}\/src\/main\/resources&lt;\/schemaDirectory&gt;\n                     &lt;outputDirectory&gt;${project.basedir}\/src\/main\/java&lt;\/outputDirectory&gt;\n                 &lt;\/configuration&gt;\n             &lt;\/plugin&gt;\n         &lt;\/plugins&gt;\n    &lt;\/build&gt;\n&lt;\/project&gt;\n<\/pre>\n<p>The configuration for <code>jaxb2-maven-plugin<\/code> specifies that the output directory should not cleared when the classes are generated, the schema file is located in <code>src\/main\/resources<\/code> directory and that the output directory where the package should be created is <code>src\/main\/java<\/code>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>SurchargeApplication.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.javacodegeeks.webservices.soap.surcharge;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class SurchargeApplication {\n\n\tpublic static void main(String[] args) {\n\t\tSpringApplication.run(SurchargeApplication.class, args);\n\t\t\n\t\tSystem.out.println(\"SurchargeApplication now running....\");\n\t}\n}\n<\/pre>\n<p>This is the main class of the application that runs on the default Tomcat container of Spring Boot at port 8080.[ulp id=&#8217;7POIYxRf1FUtPpmL&#8217;]<\/p>\n<p><span style=\"text-decoration: underline;\"><em>SoapConfig.java<\/em><\/span><\/p>\n<pre class=\"brush:java; wrap-lines:false\">package org.javacodegeeks.webservices.soap.surcharge.config;\n\nimport org.springframework.boot.web.servlet.ServletRegistrationBean;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.core.io.ClassPathResource;\nimport org.springframework.ws.config.annotation.EnableWs;\nimport org.springframework.ws.transport.http.MessageDispatcherServlet;\nimport org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;\nimport org.springframework.xml.xsd.SimpleXsdSchema;\nimport org.springframework.xml.xsd.XsdSchema;\n\n@EnableWs\n@Configuration\npublic class SoapConfig {\n\t@Bean\n\tpublic XsdSchema surchargeSchema() {\n\t\treturn new SimpleXsdSchema(new ClassPathResource(\"surcharge.xsd\"));\n\t}\n\t\n\t@Bean(name = \"surcharge\")\n\tpublic DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema surchargeSchema) {\n\t\tDefaultWsdl11Definition definition = new DefaultWsdl11Definition();\n\t\tdefinition.setPortTypeName(\"SurchargePort\");\n\t\tdefinition.setTargetNamespace(\"http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated\");\n\t\tdefinition.setLocationUri(\"\/ws\");\n\t\tdefinition.setSchema(surchargeSchema);\n\t\treturn definition;\n\t}\n\t\n\t@Bean\n\tpublic ServletRegistrationBean messageDispatcherServlet(ApplicationContext context) {\n\t\tMessageDispatcherServlet messageDispatcherServlet = new MessageDispatcherServlet();\n\t\tmessageDispatcherServlet.setApplicationContext(context);\n\t\tmessageDispatcherServlet.setTransformWsdlLocations(true);\n\t\treturn new ServletRegistrationBean(messageDispatcherServlet, \"\/ws\/*\");\n\t}\n\n}\n<\/pre>\n<p>This class sets up the configures all the beans required as the application infrastructure. <code>@EnableWS<\/code> enables all the Spring Java web services configuration defined in <code>WsConfigurationSupport<\/code> class to be imported to our application configuration. It provides facilities for endpoint mapping to annotated controllers, adapters and exception handlers.<\/p>\n<p>First, in the <code>surchargeSchema<\/code> method, the <code>surcharge.xsd<\/code> file is used to configure a <code>SimpleXsdSchema<\/code> bean. Next, in the <code>defaultWsdl11Definition<\/code> method, this bean set as the schema in a <code>DefaultWsdl11Definition<\/code> with the name surcharge. Last, in the <code>messageDispatcherServlet<\/code> method, a <code>MessageDispatcherServlet<\/code> is created to take the <code>ApplicationContext<\/code> and then used to create a <code>ServletRegistrationBean<\/code> to handle the URI path <code>\/ws<\/code>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>SurchargeEndpoint.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.javacodegeeks.webservices.soap.surcharge.endpoint;\n\nimport org.javacodegeeks.webservices.soap.surcharge.generated.SurchargeRequest;\nimport org.javacodegeeks.webservices.soap.surcharge.generated.SurchargeResponse;\nimport org.javacodegeeks.webservices.soap.surcharge.service.SurchargeService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.ws.server.endpoint.annotation.Endpoint;\nimport org.springframework.ws.server.endpoint.annotation.PayloadRoot;\nimport org.springframework.ws.server.endpoint.annotation.RequestPayload;\nimport org.springframework.ws.server.endpoint.annotation.ResponsePayload;\n\n@Endpoint\npublic class SurchargeEndpoint {\n\n\t@Autowired\n\tSurchargeService service;\n\n\t@PayloadRoot(namespace = \"http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated\", localPart = \"SurchargeRequest\")\n\t@ResponsePayload\n\tpublic SurchargeResponse processCourseDetailsRequest(@RequestPayload SurchargeRequest request) {\n\n\t\tSurchargeResponse response = new SurchargeResponse();\n\n\t\tint surcharge = service.calculateSurcharge(request.getOrder());\n\t\tresponse.setSurcharge(surcharge);\n\n\t\treturn response;\n\t}\n\n}\n<\/pre>\n<p>This class has a <code>SurchargeService<\/code> bean auto-wired. With the <code>@PayloadRoot<\/code> annotation, we mark the method <code>processCourseDetailsRequest<\/code> as the handler for the incoming request. The <code>@ResponsePayload<\/code> annotation marks that the return value should be bound to the response payload.<\/p>\n<p>In the <code>processCourseDetailsRequest<\/code> method, a <code>SurchargeResponse<\/code> object is instantiated. The service bean&#8217;s <code>calculateSurcharge<\/code> method is called passing in the <code>Order<\/code> object from the <code>SurchargeRequest<\/code> input. The calculated <code>surcharge<\/code> returned from the call is set into the <code>SurchargeResponse<\/code> object that is then returned.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>SurchargeService.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.javacodegeeks.webservices.soap.surcharge.service;\n\nimport org.javacodegeeks.webservices.soap.surcharge.generated.SurchargeRequest.Order;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class SurchargeService {\n\t\n\tpublic int calculateSurcharge(Order order) {\n\t\t\n\t\tint surcharge = 15;\n\t\tif (order.getCustomer().getAddress().getCountry().equals(\"US\"))\n\t\t\tsurcharge = 10;\n\n\t\tif (order.getPaymentMethod().equals(\"CC\"))\n\t\t\tsurcharge += 3;\n\n\t\tif (order.getValue() &gt; 1000)\n\t\t\tsurcharge -= 1;\n\n\t\treturn surcharge;\n\t}\n}\n<\/pre>\n<p>This class has a method <code>calculateSurcharge<\/code> that implements the business logic of calculating the <code>surcharge<\/code> for a given <code>order<\/code>, as given in Section 2 above.<\/p>\n<h2><a name=\"howtorunandtest\"><\/a>5. How To Run and Test<\/h2>\n<p>In a terminal window go to the project root folder and enter<\/p>\n<pre class=\"brush:bash\">mvn spring-boot:run<\/pre>\n<p>There are many client applications like SoapUI or Wizdler that you can use to invoke this service. I have used Postman app. The test request data is formed by just a few changes to the sample XML file we started with.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>test1.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;soapenv:Envelope xmlns:soapenv=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\"\n xmlns=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\"&gt;\n    &lt;soapenv:Body&gt;\n        &lt;SurchargeRequest xmlns=\"http:\/\/www.javacodegeeks.org\/webservices\/soap\/surcharge\/generated\"&gt;\n            &lt;order&gt;\n                &lt;id&gt;S12345&lt;\/id&gt;\n                &lt;value&gt;1250&lt;\/value&gt;\n                &lt;payment_method&gt;CC&lt;\/payment_method&gt;\n                &lt;customer&gt;\n                    &lt;name part=\"first\"&gt;Nancy&lt;\/name&gt;\n                    &lt;name part=\"last\"&gt;Smith&lt;\/name&gt;\n                    &lt;address&gt;\n                        &lt;street line=\"1\"&gt;41 Earnest Road&lt;\/street&gt;\n                        &lt;street line=\"2\"&gt;Rotamonte Park&lt;\/street&gt;\n                        &lt;city&gt;Koregon&lt;\/city&gt;\n                        &lt;postalcode&gt;12345&lt;\/postalcode&gt;\n                        &lt;country&gt;UK&lt;\/country&gt;\n                    &lt;\/address&gt;\n                &lt;\/customer&gt;\n            &lt;\/order&gt;\n        &lt;\/SurchargeRequest&gt;\n    &lt;\/soapenv:Body&gt;\n&lt;\/soapenv:Envelope&gt;\n<\/pre>\n<p>Given below is the screen shot of Postman showing the input soap XML and the response from the web service.<\/p>\n<p><figure id=\"attachment_53936\" aria-describedby=\"caption-attachment-53936\" style=\"width: 750px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/output.jpg\"><img decoding=\"async\" class=\"wp-image-53936 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/output.jpg\" alt=\"\" width=\"750\" height=\"479\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/output.jpg 750w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/output-300x192.jpg 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><figcaption id=\"caption-attachment-53936\" class=\"wp-caption-text\">Output showing sample SOAP Request and Response of SurchargeService.<\/figcaption><\/figure><\/p>\n<p>Since the order country is not &#8220;US&#8221;, payment method is &#8220;CC&#8221;, and the value is greater than 1000, the surcharge calculated is 15 + 3 -1 = 17, which is returned in the response.<\/p>\n<h2><a name=\"summary\"><\/a>6. Summary<\/h2>\n<p>In this article, we have seen how to use Spring framework in conjunction with maven plugin to implement a SOAP web service that take XML request and returns an XML response. We have also seen how to start from a sample XML to generate the XML schema definition and from there use the maven plugin and Spring annotations to transform the XML input to Java objects that are then used to execute the business logic.<\/p>\n<h2><a name=\"usefullinks\"><\/a>7. Useful Links<\/h2>\n<p>Following resources will be very useful to get additional information and insights on concepts discussed in this article:<\/p>\n<ul>\n<li><a href=\"https:\/\/blog.smartbear.com\/apis\/understanding-soap-and-rest-basics\/\">https:\/\/blog.smartbear.com\/apis\/understanding-soap-and-rest-basics\/<\/a><\/li>\n<li><a href=\"http:\/\/mh-journal.blogspot.in\/2015\/08\/generating-xsds-for-xml-interfaces.html\">http:\/\/mh-journal.blogspot.in\/2015\/08\/generating-xsds-for-xml-interfaces.html<\/a><\/li>\n<li><a href=\"https:\/\/www.getpostman.com\/docs\/postman\/sending_api_requests\/making_soap_requests\">https:\/\/www.getpostman.com\/docs\/postman\/sending_api_requests\/making_soap_requests<\/a><\/li>\n<\/ul>\n<h2><a name=\"download\"><\/a>8. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/01\/surcharge.zip\"><strong>surcharge.zip<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among disparate systems. Simple Object Access Protocol (SOAP) was developed by Microsoft as an improvement over the existing technologies like Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA) and Java Remote Method Invocation (RMI) &hellip;<\/p>\n","protected":false},"author":141,"featured_media":1248,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[],"class_list":["post-53911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring SOAP with XML Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among\" \/>\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\/spring\/spring-soap-xml-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring SOAP with XML Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-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=\"2018-01-08T13:00:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-14T09:23:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-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=\"Mahboob Hussain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mahboob Hussain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 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\/spring\/spring-soap-xml-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/\"},\"author\":{\"name\":\"Mahboob Hussain\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/7fcaa707830cfea8c55d4ad2b81cbf55\"},\"headline\":\"Spring SOAP with XML Example\",\"datePublished\":\"2018-01-08T13:00:43+00:00\",\"dateModified\":\"2019-02-14T09:23:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/\"},\"wordCount\":1170,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg\",\"articleSection\":[\"spring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/\",\"name\":\"Spring SOAP with XML Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg\",\"datePublished\":\"2018-01-08T13:00:43+00:00\",\"dateModified\":\"2019-02-14T09:23:39+00:00\",\"description\":\"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-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\":\"spring\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/spring\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Spring SOAP with XML 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\/7fcaa707830cfea8c55d4ad2b81cbf55\",\"name\":\"Mahboob Hussain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mahboob-Hussain_avatar_1510827107-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mahboob-Hussain_avatar_1510827107-96x96.jpg\",\"caption\":\"Mahboob Hussain\"},\"description\":\"Mahboob Hussain graduated in Engineering from NIT Nagpur, India and has an MBA from Webster University, USA. He has executed roles in various aspects of software development and technical governance. He started with FORTRAN and has programmed in a variety of languages in his career, the mainstay of which has been Java. He is an associate editor in our team and has his personal homepage at http:\/\/bit.ly\/mahboob\",\"sameAs\":[\"http:\/\/bit.ly\/mahboob\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/mahboob-hussain\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring SOAP with XML Example - Java Code Geeks","description":"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among","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\/spring\/spring-soap-xml-example\/","og_locale":"en_US","og_type":"article","og_title":"Spring SOAP with XML Example - Java Code Geeks","og_description":"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-01-08T13:00:43+00:00","article_modified_time":"2019-02-14T09:23:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Mahboob Hussain","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Mahboob Hussain","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/"},"author":{"name":"Mahboob Hussain","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/7fcaa707830cfea8c55d4ad2b81cbf55"},"headline":"Spring SOAP with XML Example","datePublished":"2018-01-08T13:00:43+00:00","dateModified":"2019-02-14T09:23:39+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/"},"wordCount":1170,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg","articleSection":["spring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/","name":"Spring SOAP with XML Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg","datePublished":"2018-01-08T13:00:43+00:00","dateModified":"2019-02-14T09:23:39+00:00","description":"Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/spring-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/spring\/spring-soap-xml-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":"spring","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/spring\/"},{"@type":"ListItem","position":5,"name":"Spring SOAP with XML 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\/7fcaa707830cfea8c55d4ad2b81cbf55","name":"Mahboob Hussain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mahboob-Hussain_avatar_1510827107-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mahboob-Hussain_avatar_1510827107-96x96.jpg","caption":"Mahboob Hussain"},"description":"Mahboob Hussain graduated in Engineering from NIT Nagpur, India and has an MBA from Webster University, USA. He has executed roles in various aspects of software development and technical governance. He started with FORTRAN and has programmed in a variety of languages in his career, the mainstay of which has been Java. He is an associate editor in our team and has his personal homepage at http:\/\/bit.ly\/mahboob","sameAs":["http:\/\/bit.ly\/mahboob"],"url":"https:\/\/examples.javacodegeeks.com\/author\/mahboob-hussain\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/53911","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\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=53911"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/53911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1248"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=53911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=53911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=53911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}