{"id":14679,"date":"2013-06-28T18:00:51","date_gmt":"2013-06-28T15:00:51","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=14679"},"modified":"2013-07-01T22:54:37","modified_gmt":"2013-07-01T19:54:37","slug":"developing-soap-web-service-using-apache-cxf","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html","title":{"rendered":"Developing SOAP Web service using Apache CXF"},"content":{"rendered":"<p>In last post I walked through the steps for developing a simple <a title=\"Developing RESTful Services using Apache CXF\" href=\"http:\/\/www.javacodegeeks.com\/2013\/07\/developing-restful-services-using-apache-cxf.html\">RESTFull service using apache CXF<\/a>. \u00a0In this post I will be talking about developing SOAP web service using CXF. Before moving forward let us understand few of the concepts\/elements which makes up a SOAP web service<\/p>\n<h2>SOAP or Simple Object Access Protocol\u00a0<\/h2>\n<p>SOAP is a protocol for exchanging XML-based messages over the network using application protocols like http, smtp, etc as carrier. SOAP message comprises of a SOAP envelope. The envelope can be broken into a header and a body. Header contains context related definitions like security while the body contains actual application data. A typical SOAP message looks like<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;soap:Envelope xmlns:soap=\"http:\/\/www.w3.org\/2003\/05\/soap-envelope\"&gt;\r\n  &lt;soap:Header&gt;\r\n  &lt;\/soap:Header&gt;\r\n  &lt;soap:Body&gt;\r\n    &lt;m:GetStockPrice xmlns:m=\"http:\/\/www.example.org\/stock\"&gt;\r\n      &lt;m:StockName&gt;IBM&lt;\/m:StockName&gt;\r\n    &lt;\/m:GetStockPrice&gt;\r\n  &lt;\/soap:Body&gt;\r\n&lt;\/soap:Envelope&gt;<\/pre>\n<h2>WSDL or Web Services Description Language<\/h2>\n<p>WSDL is a standard based XML Language which is used to describe a web service. A WSDL completely describes what public interface an web service exposes, what parameter it expects, structure of output it returns, location of web service. A WSDL defines a web service as collection of communication end points that are capable of exchanging messages. These communication end points are called ports. Port are composed of two parts.<\/p>\n<ol>\n<li>Contains the public interface exposed by the web service. The interface contains all the methods, parameter needed to invoke them and response structure returned by them.<\/li>\n<li>The second part binds the public interface to network protocol like http. The binding comprises of information like location of the public interface and message format for the service.<\/li>\n<\/ol>\n<h2>SOAP communication styles<\/h2>\n<p>There exists two types of communication styles<\/p>\n<ol>\n<li>Document<\/li>\n<li>RPC<\/li>\n<\/ol>\n<p>The communication style used by SOAP web service is defined in its WSDL.<\/p>\n<p>In the Document style the application data which is part of soap body is sent as XML document. This document can be validated completely by a xml schema which is also part of WSDL. As XML can contain structure as per wish of service developer hence the responsibility of\u00a0marshaling\u00a0and unmarshaling xml payload lies at end of provider and consumer code.<\/p>\n<p>In RPC style as the name suggests the consumer invokes the methods of service as if he were invoking a local method. To facilitate this the RPC message consists of list of public interface methods that a consumer can invoke. These methods are listed by names as xml elements. \u00a0The method parameters needed by these method forms sub elements of \u00a0the method element. The responisibility of marshaling\/unmarshaling lies with the web service framework. The framework contains its own\u00a0marshaling\/unmarshaling libraries. RPC style results in tightly coupled code between application code and the web service framework, hence norm is create document style services. With Key concepts in place let see an example of how to write a soap web service using Apache CXF.<\/p>\n<h2>Getting the source code for this tutorial<\/h2>\n<p>I have\u00a0committed\u00a0the source files for this tutorial in SVN.<\/p>\n<ul>\n<li><em>You can download\u00a0the web app from: <\/em><a title=\"http:\/\/subversion.assembla.com\/svn\/weblog4j\/Weblog4jDemo\/trunk\" href=\"http:\/\/subversion.assembla.com\/svn\/weblog4j\/Weblog4jDemo\/trunk\">http:\/\/subversion.assembla.com\/svn\/weblog4j\/Weblog4jDemo\/trunk<\/a><\/li>\n<li><em>You can download\u00a0the\u00a0client from: <\/em><a title=\"http:\/\/subversion.assembla.com\/svn\/weblog4j\/DemoClient\/trunk\" href=\"http:\/\/subversion.assembla.com\/svn\/weblog4j\/DemoClient\/trunk\">http:\/\/subversion.assembla.com\/svn\/weblog4j\/DemoClient\/trunk<\/a><\/li>\n<\/ul>\n<p><strong>Note:<\/strong> Both are ItelliJ maven projects so you can directly import them to your intelliJ IDE or copy over the files manually to other IDEs<\/p>\n<h2>Create a struts2 skeleton application to contain your service. <\/h2>\n<p>You can use any MVC framework but I prefer struts2 for my own reasons. You can see an example of how to create an empty struts2 application in eclipse using maven <a title=\"Creating a new struts2 project in Eclipse with  Struts2-archetype-starter using m2eclipse\" href=\"http:\/\/weblog4j.com\/2011\/08\/23\/creating-a-new-struts2-project-in-eclipse-with-struts2-archetype-starter-using-m2eclipse\/\">here<\/a>.<\/p>\n<h2>Add CXF dependencies\u00a0<\/h2>\n<p>In your project POM add following dependencies to download CXF jars<\/p>\n<pre class=\" brush:xml\">&lt;properties&gt;\r\n       &lt;cxf.version&gt;2.5.0&lt;\/cxf.version&gt;\r\n&lt;\/properties&gt;\r\n&lt;dependencies&gt;\r\n       &lt;!-- apache cxf --&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;${cxf.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n\r\n        &lt;dependency&gt;\r\n          &lt;groupId&gt;org.apache.cxf&lt;\/groupId&gt;\r\n          &lt;artifactId&gt;cxf-rt-frontend-jaxrs&lt;\/artifactId&gt;\r\n          &lt;version&gt;${cxf.version}&lt;\/version&gt;\r\n       &lt;\/dependency&gt;\r\n\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;${cxf.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;<\/pre>\n<p>For example let us create a simple book shelf web service. For simplicity let us assume following use case.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ol>\n<li>Insert a book in book self<\/li>\n<li>Retrieve a book from book shelf by title.<\/li>\n<\/ol>\n<h2>Developing the service<\/h2>\n<p>This can be done in two ways Code first and contract first. We will be using the code first approach.<\/p>\n<h2>Creating a Service Endpoint Interface (SEI)<\/h2>\n<p>Let us create a SEI interface called BookShelfService<\/p>\n<pre class=\" brush:java\">package com.aranin.weblog4j.services;\r\n\r\nimport com.aranin.weblog4j.vo.BookVO;\r\n\r\nimport javax.jws.WebMethod;\r\nimport javax.jws.WebService;\r\n\r\n@WebService\r\npublic interface BookShelfService {\r\n\r\n    @WebMethod\r\n    public  String insertBook(BookVO bookVO);\r\n    @WebMethod\r\n    public  BookVO getBook(String title);\r\n}<\/pre>\n<p>If you look at the above SEI you can tell that it is a normal java interface with exception of two annotation<\/p>\n<ul>\n<li>@WebService \u2013 This is an annotation JAXWS library. It turns a normal POJO into a webservice. In our case the annotation is placed right above the interface definition and it notifies that BookShelfService is not a normal interface rather an webservice interface or SEI. There are other attributes to this annotation that can completely define the webservice but we will not be using it right now.<\/li>\n<li>@WebMethod \u2013 This annotation is optional and is mainly used to provide a name attribute to the public method in wsdl.<\/li>\n<\/ul>\n<h2>Implementing the service.\u00a0<\/h2>\n<p>Now we have our SEI so let us implement the methods in the interface in our BookShelfServiceImpl<\/p>\n<pre class=\" brush:java\">package com.aranin.weblog4j.services;\r\n\r\nimport com.aranin.weblog4j.hashdb.HashDB;\r\nimport com.aranin.weblog4j.vo.BookVO;\r\n\r\nimport javax.jws.WebService;\r\n\r\n@WebService(endpointInterface = \"com.aranin.weblog4j.services.BookShelfService\",\r\n\t\tserviceName=\"bookShelfService\")\r\npublic class BookShelfServiceImpl implements BookShelfService {\r\n    public String insertBook(BookVO bookVO) {\r\n        HashDB.insertBook(bookVO);\r\n        return \"Book with name : \" + bookVO.getBookName() + \" is now available on the shelf\";  \/\/To change body of implemented methods use File | Settings | File Templates.\r\n    }\r\n\r\n    public BookVO getBook(String title) {\r\n\r\n        return HashDB.getBook(title);  \/\/To change body of implemented methods use File | Settings | File Templates.\r\n    }\r\n}<\/pre>\n<p>This class is a simple POJO implementing the SEI. Only notable thing here is the\u00a0@WebService annotation. If you look at it closely we have provided the fully qualified class name of the SEI it implements and name of the webservice.<\/p>\n<h2>Data Binding class (BookVO)<\/h2>\n<pre class=\" brush:java\">package com.aranin.weblog4j.vo;\r\n\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport java.io.Serializable;\r\n\r\n@XmlRootElement(name = \"Book\")\r\npublic class BookVO implements Serializable {\r\n\r\n    private long bookId;\r\n    private String bookName;\r\n    private String author;\r\n\r\n    public long getBookId() {\r\n        return bookId;\r\n    }\r\n\r\n    public void setBookId(long bucketId) {\r\n        this.bookId = bookId;\r\n    }\r\n\r\n    public String getBookName() {\r\n        return bookName;\r\n    }\r\n\r\n    public void setBookName(String bookName) {\r\n        this.bookName = bookName;\r\n    }\r\n\r\n    public String getAuthor() {\r\n        return author;\r\n    }\r\n\r\n    public void setAuthor(String author) {\r\n        this.author = author;\r\n    }\r\n}<\/pre>\n<p>The only thing to note here is the @XmlRootElement annotation. This annotation is part of JAXB library. CXF uses JAXB as default data binding component. As BookVO needs to be transported as XML during the webservice calls hence it needs to marshalled\/unmarshalled by the JAXB engine in the CXF installation. Using\u00a0@XmlRootElement annotation we help JAXB in mapping the BookVO class to an xml with its name attribute as root element of the xml.<\/p>\n<h2>Spring Based Server Bean<\/h2>\n<p>What makes CXF a first rate choice as webservice framework is that it publishes its service endpoints via a spring based configuration file. Lets create a \u00a0the configuration file and register our service in it. We will name the file as beans.xml and save it in WEB-INF folder of our application<\/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\n\txmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txmlns:jaxws=\"http:\/\/cxf.apache.org\/jaxws\"\r\n    xmlns:jaxrs=\"http:\/\/cxf.apache.org\/jaxrs\"\r\n\txsi:schemaLocation=\"\r\n\r\nhttp:\/\/www.springframework.org\/schema\/beans\r\n\r\nhttp:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd\r\n\r\nhttp:\/\/cxf.apache.org\/jaxrs\r\n\r\nhttp:\/\/cxf.apache.org\/schemas\/jaxrs.xsd\r\n\r\nhttp:\/\/cxf.apache.org\/jaxws\r\n\r\nhttp:\/\/cxf.apache.org\/schemas\/jaxws.xsd\"&gt;\r\n\r\n&lt;import resource=\"classpath:META-INF\/cxf\/cxf.xml\" \/&gt;\r\n&lt;import resource=\"classpath:META-INF\/cxf\/cxf-extension-soap.xml\" \/&gt;\r\n&lt;import resource=\"classpath:META-INF\/cxf\/cxf-servlet.xml\" \/&gt;\t\r\n\r\n&lt;jaxws:endpoint\r\n       id=\"bookShelfService\"\r\n       implementor=\"com.aranin.weblog4j.services.BookShelfServiceImpl\"\r\n       address=\"\/bookshelfservice\" \/&gt;\r\n\r\n&lt;\/beans&gt;<\/pre>\n<h2>Now to load the beans.xml we simply add following in web.xml<\/h2>\n<pre class=\" brush:xml\">&lt;context-param&gt;\r\n&lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n    &lt;param-value&gt;\/WEB-INF\/beans.xml,\/WEB-INF\/applicationContext.xml&lt;\/param-value&gt;\r\n&lt;\/context-param&gt;<\/pre>\n<p>Finally we need to wire spring and CXF through web.xml.<\/p>\n<pre class=\" brush:java\">&lt;servlet&gt;\r\n       &lt;servlet-name&gt;CXFServlet&lt;\/servlet-name&gt;\r\n       &lt;display-name&gt;CXF Servlet&lt;\/display-name&gt;\r\n\t&lt;servlet-class&gt;\r\n\t\torg.apache.cxf.transport.servlet.CXFServlet\r\n\t&lt;\/servlet-class&gt;\r\n\t&lt;load-on-startup&gt;2&lt;\/load-on-startup&gt;\r\n&lt;\/servlet&gt;\r\n\r\n&lt;servlet-mapping&gt;\r\n\t&lt;servlet-name&gt;CXFServlet&lt;\/servlet-name&gt;\r\n\t&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n&lt;\/servlet-mapping&gt;<\/pre>\n<p><strong>Note:<\/strong> I have not included loading of Spring ContextLoaderListner. If you create a struts2 application via maven using struts2 starter archetype then spring is downloaded and registered by maven project itself.<\/p>\n<p>Now your webservice is ready. Compile and deploy the application in any servlet container. If everything is good then you can see your wsld on following location: <a href=\"http:\/\/localhost:8080\/weblog4jdemo\/bookshelfservice?wsdl\">http:\/\/localhost:8080\/weblog4jdemo\/bookshelfservice?wsdl<\/a><\/p>\n<h2>Create your client<\/h2>\n<p>There are many tools which can be used to generate client code using the wsdl. To save you further trouble we will utilize CXF\u2019s own front end apis. So let us look at the steps.<\/p>\n<ol>\n<li>Create a simple maven project using IDE of your choice. I am using IntelliJ currently and it is awesome. Lets say name of the project is DemoClient.<\/li>\n<li>Add the CXF dependencies as shown in create skeleton application section.<\/li>\n<li>Since we know what the SEIs and public method and binding objects are. We will create them in the client side to save us trouble. In case there are many such classes we can use tools like wsdl2java etc to generate our code.<\/li>\n<li>Create a stub SEI in exact same package structure as the parent SEI.<\/li>\n<li>Create BookVO in same package structure as the parent BookVO.<\/li>\n<li>The above classes should be exactly same as you have created in the parent application.<\/li>\n<li>We need not create the SEI implementation at client end.<\/li>\n<li>Now we will create a client using\u00a0JaxWsProxyFactoryBean. This class is a factory which works with the SEI proxies to invoke web service methods. Here is the class.<\/li>\n<\/ol>\n<pre class=\" brush:java\">package com.aranin.weblog4j.client;\r\n\r\nimport com.aranin.weblog4j.services.BookShelfService;\r\nimport com.aranin.weblog4j.vo.BookVO;\r\nimport org.apache.cxf.jaxws.JaxWsProxyFactoryBean;\r\n\r\npublic class DemoClient {\r\n    public static void main(String[] args){\r\n        String serviceUrl = \"http:\/\/localhost:8080\/weblog4jdemo\/bookshelfservice\";\r\n        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();\r\n\t\tfactory.setServiceClass(BookShelfService.class);\r\n\t\tfactory.setAddress(serviceUrl);\r\n\t\tBookShelfService bookService = (BookShelfService) factory.create();\r\n\r\n        \/\/insert book\r\n        BookVO bookVO = new BookVO();\r\n        bookVO.setAuthor(\"Issac Asimov\");\r\n        bookVO.setBookName(\"Foundation and Earth\");\r\n\r\n        String result = bookService.insertBook(bookVO);\r\n\r\n        System.out.println(\"result : \" + result);\r\n\r\n        bookVO = new BookVO();\r\n        bookVO.setAuthor(\"Issac Asimov\");\r\n        bookVO.setBookName(\"Foundation and Empire\");\r\n\r\n        result = bookService.insertBook(bookVO);\r\n\r\n        System.out.println(\"result : \" + result);\r\n\r\n        bookVO = new BookVO();\r\n        bookVO.setAuthor(\"Arthur C Clarke\");\r\n        bookVO.setBookName(\"Rama Revealed\");\r\n\r\n        result = bookService.insertBook(bookVO);\r\n\r\n        System.out.println(\"result : \" + result);\r\n\r\n        \/\/retrieve book\r\n\r\n        bookVO = bookService.getBook(\"Foundation and Earth\");\r\n\r\n        System.out.println(\"book name : \" + bookVO.getBookName());\r\n        System.out.println(\"book author : \" + bookVO.getAuthor());\r\n\r\n    }\r\n}<\/pre>\n<p>Here is the output of above calls<\/p>\n<pre class=\" brush:java\">INFO: Creating Service {http:\/\/services.weblog4j.aranin.com\/}BookShelfServiceService from class com.aranin.weblog4j.services.BookShelfService\r\nresult : Book with name : Foundation and Earth is now available on the shelf\r\nresult : Book with name : Foundation and Empire is now available on the shelf\r\nresult : Book with name : Rama Revealed is now available on the shelf\r\nbook name : Foundation and Earth\r\nbook author : Issac Asimov\r\n\r\nProcess finished with exit code 0<\/pre>\n<p>There are tons of other stuff you can explore in Apache CXF like Creating dynamic clients, interceptors, leveraging other transport protocol, webservice over https etc. But I intend this post as getting started tutorial.<\/p>\n<p>Phew this is a long post again. I need to improve my writing skills to shorten the length. But still I hope that you enjoyed it and found it useful. I intend to write about a javascript client for webservices in my next post. Until then goodbye and happy coding.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/weblog4j.com\/2012\/05\/01\/developing-soap-web-service-using-apache-cxf\/\">Developing SOAP Web service using Apache CXF<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Niraj Singh at the <a href=\"http:\/\/weblog4j.com\/\">Weblog4j<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP web service using CXF. Before moving forward let us understand few of the concepts\/elements which makes up a SOAP web service SOAP or Simple Object Access Protocol\u00a0 SOAP &hellip;<\/p>\n","protected":false},"author":457,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[171,604,106],"class_list":["post-14679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-cxf","tag-soap","tag-web-services"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Developing SOAP Web service using Apache CXF<\/title>\n<meta name=\"description\" content=\"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Developing SOAP Web service using Apache CXF\" \/>\n<meta property=\"og:description\" content=\"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-06-28T15:00:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-07-01T19:54:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/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=\"Niraj Singh\" \/>\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=\"Niraj Singh\" \/>\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:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html\"},\"author\":{\"name\":\"Niraj Singh\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c1701df4314ba15d96a7e8ee21167280\"},\"headline\":\"Developing SOAP Web service using Apache CXF\",\"datePublished\":\"2013-06-28T15:00:51+00:00\",\"dateModified\":\"2013-07-01T19:54:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html\"},\"wordCount\":1361,\"commentCount\":26,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Apache CXF\",\"SOAP\",\"Web Services\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html\",\"name\":\"Developing SOAP Web service using Apache CXF\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2013-06-28T15:00:51+00:00\",\"dateModified\":\"2013-07-01T19:54:37+00:00\",\"description\":\"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/developing-soap-web-service-using-apache-cxf.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Developing SOAP Web service using Apache CXF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c1701df4314ba15d96a7e8ee21167280\",\"name\":\"Niraj Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g\",\"caption\":\"Niraj Singh\"},\"sameAs\":[\"http:\\\/\\\/weblog4j.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/niraj-singh\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Developing SOAP Web service using Apache CXF","description":"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP","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:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html","og_locale":"en_US","og_type":"article","og_title":"Developing SOAP Web service using Apache CXF","og_description":"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP","og_url":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-06-28T15:00:51+00:00","article_modified_time":"2013-07-01T19:54:37+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Niraj Singh","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Niraj Singh","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html"},"author":{"name":"Niraj Singh","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c1701df4314ba15d96a7e8ee21167280"},"headline":"Developing SOAP Web service using Apache CXF","datePublished":"2013-06-28T15:00:51+00:00","dateModified":"2013-07-01T19:54:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html"},"wordCount":1361,"commentCount":26,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Apache CXF","SOAP","Web Services"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html","url":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html","name":"Developing SOAP Web service using Apache CXF","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2013-06-28T15:00:51+00:00","dateModified":"2013-07-01T19:54:37+00:00","description":"In last post I walked through the steps for developing a simple RESTFull service using apache CXF. \u00a0In this post I will be talking about developing SOAP","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/developing-soap-web-service-using-apache-cxf.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Developing SOAP Web service using Apache CXF"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c1701df4314ba15d96a7e8ee21167280","name":"Niraj Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/147bedcf1582a3657c88a171d9057c1f6e52c9cc61db7ebff937824d89ed3995?s=96&d=mm&r=g","caption":"Niraj Singh"},"sameAs":["http:\/\/weblog4j.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/niraj-singh"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/14679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/457"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=14679"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/14679\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=14679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=14679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=14679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}