{"id":55042,"date":"2018-02-05T15:00:50","date_gmt":"2018-02-05T13:00:50","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=55042"},"modified":"2018-03-06T11:52:48","modified_gmt":"2018-03-06T09:52:48","slug":"jax-ws-callback-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/","title":{"rendered":"JAX-WS Callback Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p><a href=\"https:\/\/javaee.github.io\/tutorial\/jaxws001.html\" target=\"_blank\" rel=\"noopener\">Java Architecture for XML Web Services<\/a>\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.<\/p>\n<p>JAX-WS provides both Callback and Polling mechanisms to invoke web services asynchronously. In Callback mode, the client provides a callback handler to accept and process the inbound response object.<\/p>\n<p>In this example, I will demonstrate how to invoke a JAX-WS service asynchronously via the callback mechanism.<\/p>\n<h2>2. Business Use Case<\/h2>\n<p>A <code>HelloService<\/code> takes exactly 1 minute to complete the <code>sayHello<\/code> operation. The client of\u00a0<code>HelloService<\/code> wants to continue with other tasks while waiting for the response from <code>sayHello<\/code> for performance purposes.<\/p>\n<h2>3. Technologies used<\/h2>\n<p>The example code in this article was built and run using:<\/p>\n<ul>\n<li>Java 1.8.101 (1.8.x will do fine)<\/li>\n<li>Maven 3.3.9 (3.3.x will do fine)<\/li>\n<li>Eclipse Mars (Any Java IDE would work)<\/li>\n<\/ul>\n<h2>4. JAX-WS Service<\/h2>\n<p>Create a project named\u00a0<code>jax-ws-server-jdk<\/code> which creates <code>HelloService<\/code> with one operation: <code>sayHello<\/code>.<\/p>\n<h3>4.1. HelloService Interface<\/h3>\n<p>Create a <code>HelloService<\/code> interface and annotate it with <code>@WebService<\/code>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>HelloService.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package jcg.demo.jaxws.service;\r\n\r\nimport javax.jws.WebMethod;\r\nimport javax.jws.WebService;\r\nimport javax.jws.soap.SOAPBinding;\r\nimport javax.jws.soap.SOAPBinding.Style;\r\n\r\n@WebService(name = \"HelloService\", targetNamespace = \"http:\/\/jcg.demo.async.ws\")\r\n@SOAPBinding(style = Style.DOCUMENT)\r\npublic interface HelloService {\r\n\r\n\t@WebMethod\r\n\tString sayHello(String msg);\r\n\r\n}\r\n<\/pre>\n<h3>4.2. HelloServiceImpl Class<\/h3>\n<p>Create a\u00a0<code>HelloServiceImpl<\/code> to implement the <code>HelloService<\/code>Interface.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>HelloService.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package jcg.demo.jaxws.service.impl;\r\n\r\nimport javax.jws.WebService;\r\n\r\nimport jcg.demo.jaxws.service.HelloService;\r\n\r\n@WebService(endpointInterface = \"jcg.demo.jaxws.service.HelloService\")\r\npublic class HelloServiceImpl implements HelloService {\r\n\r\n\tprivate static final int ONE_MINUTES = 60000;\r\n\r\n\t@Override\r\n\tpublic String sayHello(String message) {\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(ONE_MINUTES);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Server sayHello to \" + message);\r\n\t\treturn \"Hello \" + message;\r\n\t}\r\n\r\n}<\/pre>\n<h3>4.3. HelloServerApp<\/h3>\n<p>Publish the\u00a0<code>HelloServiceImpl<\/code> at <code>http:\/\/localhost:9980\/hello?wsdl<\/code>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>HelloServerApp.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package jcg.demo.jaxws;\r\n\r\nimport javax.xml.ws.Endpoint;\r\n\r\nimport jcg.demo.jaxws.service.impl.HelloServiceImpl;\r\n\r\npublic class HelloServerApp {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tEndpoint ep = Endpoint.create(new HelloServiceImpl());\r\n\t\tep.publish(\"http:\/\/localhost:9980\/hello\");\r\n\t}\r\n}\r\n<\/pre>\n<h2>5. Generate Client with AyncMapping Enabled<\/h2>\n<p>Create a project named\u00a0<code>jax-ws-client-static<\/code> which generates a JAX-WS client from <code>http:\/\/localhost:9980\/hello?wsdl<\/code> with <code>enableAsyncMapping<\/code> enabled.<\/p>\n<h3>5.1. POM.XML<\/h3>\n<p>Configure Maven POM.xml to generate the JAX-WS client with <code>enableAsyncMapping<\/code> enabled.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>async-bindings.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml;wrap-lines:false\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n\r\n&lt;bindings xmlns:wsdl=\"http:\/\/schemas.xmlsoap.org\/wsdl\/\"\r\n\twsdlLocation=\"http:\/\/localhost:9980\/hello?wsdl\" xmlns=\"http:\/\/java.sun.com\/xml\/ns\/jaxws\"&gt;\r\n\r\n\t&lt;!-- applies to wsdl:definitions node, that would mean the entire wsdl --&gt;\r\n\t&lt;enableAsyncMapping&gt;true&lt;\/enableAsyncMapping&gt;\r\n\r\n&lt;\/bindings&gt;\r\n<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml;wrap-lines:false\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;groupId&gt;jax-ws-client&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;jax-ws-client-static&lt;\/artifactId&gt;\r\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;build&gt;\r\n\t\t&lt;plugins&gt;\r\n\t\t\t&lt;plugin&gt;\r\n\t\t\t\t&lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n\t\t\t\t&lt;version&gt;3.5.1&lt;\/version&gt;\r\n\t\t\t\t&lt;configuration&gt;\r\n\t\t\t\t\t&lt;source&gt;1.8&lt;\/source&gt;\r\n\t\t\t\t\t&lt;target&gt;1.8&lt;\/target&gt;\r\n\t\t\t\t&lt;\/configuration&gt;\r\n\t\t\t&lt;\/plugin&gt;\r\n\t\t&lt;\/plugins&gt;\r\n\t&lt;\/build&gt;\r\n\r\n\t&lt;profiles&gt;\r\n\t\t&lt;profile&gt;\r\n\t\t\t&lt;id&gt;codegen&lt;\/id&gt;\r\n\t\t\t&lt;build&gt;\r\n\t\t\t\t&lt;plugins&gt;\r\n\t\t\t\t\t&lt;plugin&gt;\r\n\t\t\t\t\t\t&lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n\t\t\t\t\t\t&lt;artifactId&gt;jaxws-maven-plugin&lt;\/artifactId&gt;\r\n\t\t\t\t\t\t&lt;version&gt;1.12&lt;\/version&gt;\r\n\t\t\t\t\t\t&lt;executions&gt;\r\n\t\t\t\t\t\t\t&lt;execution&gt;\r\n\t\t\t\t\t\t\t\t&lt;id&gt;hello_wsdl&lt;\/id&gt;\r\n\t\t\t\t\t\t\t\t&lt;goals&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;goal&gt;wsimport&lt;\/goal&gt;\r\n\t\t\t\t\t\t\t\t&lt;\/goals&gt;\r\n\t\t\t\t\t\t\t\t&lt;configuration&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;wsdlUrls&gt;\r\n\t\t\t\t\t\t\t\t\t\t&lt;wsdlUrl&gt;http:\/\/localhost:9980\/hello?wsdl&lt;\/wsdlUrl&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;\/wsdlUrls&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;bindingDirectory&gt;${basedir}\/src\/main\/resources\/jaxws&lt;\/bindingDirectory&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;keep&gt;true&lt;\/keep&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;packageName&gt;jcg.demo.jaxws.client.hello&lt;\/packageName&gt;\r\n\t\t\t\t\t\t\t\t\t&lt;sourceDestDir&gt;src\/generated\/java&lt;\/sourceDestDir&gt;\r\n\t\t\t\t\t\t\t\t&lt;\/configuration&gt;\r\n\t\t\t\t\t\t\t&lt;\/execution&gt;\r\n\r\n\t\t\t\t\t\t&lt;\/executions&gt;\r\n\t\t\t\t\t&lt;\/plugin&gt;\r\n\t\t\t\t&lt;\/plugins&gt;\r\n\t\t\t&lt;\/build&gt;\r\n\t\t&lt;\/profile&gt;\r\n\t&lt;\/profiles&gt;\r\n&lt;\/project&gt;<\/pre>\n<h3>5.2. HelloService\u00a0Generated Code<\/h3>\n<p>Execute <code>mv install -P codegen<\/code> to generate the source code and verify that <code>HelloService<\/code> has three operations:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li><code>sayHello<\/code> for synchronous call<\/li>\n<li><code>Response sayHelloAsync<\/code> for asynchronous call with polling<\/li>\n<li><code>Future sayHelloAsync<\/code> for asynchronous call with callback<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\"><em>HelloService.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package jcg.demo.jaxws.client.hello;\r\n\r\nimport java.util.concurrent.Future;\r\nimport javax.jws.WebMethod;\r\nimport javax.jws.WebParam;\r\nimport javax.jws.WebResult;\r\nimport javax.jws.WebService;\r\nimport javax.xml.bind.annotation.XmlSeeAlso;\r\nimport javax.xml.ws.AsyncHandler;\r\nimport javax.xml.ws.RequestWrapper;\r\nimport javax.xml.ws.Response;\r\nimport javax.xml.ws.ResponseWrapper;\r\n\r\n\r\n\/**\r\n * This class was generated by the JAX-WS RI.\r\n * JAX-WS RI 2.1.7-b01-\r\n * Generated source version: 2.1\r\n * \r\n *\/\r\n@WebService(name = \"HelloService\", targetNamespace = \"http:\/\/jcg.demo.async.ws\")\r\n@XmlSeeAlso({\r\n    ObjectFactory.class\r\n})\r\npublic interface HelloService {\r\n\r\n\r\n    \/**\r\n     * \r\n     * @param arg0\r\n     * @return\r\n     *     returns javax.xml.ws.Response&lt;jcg.demo.jaxws.client.hello.SayHelloResponse&gt;\r\n     *\/\r\n    @WebMethod(operationName = \"sayHello\")\r\n    @RequestWrapper(localName = \"sayHello\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHello\")\r\n    @ResponseWrapper(localName = \"sayHelloResponse\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHelloResponse\")\r\n    public Response&lt;SayHelloResponse&gt; sayHelloAsync(\r\n        @WebParam(name = \"arg0\", targetNamespace = \"\")\r\n        String arg0);\r\n\r\n    \/**\r\n     * \r\n     * @param arg0\r\n     * @param asyncHandler\r\n     * @return\r\n     *     returns java.util.concurrent.Future&lt;? extends java.lang.Object&gt;\r\n     *\/\r\n    @WebMethod(operationName = \"sayHello\")\r\n    @RequestWrapper(localName = \"sayHello\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHello\")\r\n    @ResponseWrapper(localName = \"sayHelloResponse\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHelloResponse\")\r\n    public Future&lt;?&gt; sayHelloAsync(\r\n        @WebParam(name = \"arg0\", targetNamespace = \"\")\r\n        String arg0,\r\n        @WebParam(name = \"asyncHandler\", targetNamespace = \"\")\r\n        AsyncHandler&lt;SayHelloResponse&gt; asyncHandler);\r\n\r\n    \/**\r\n     * \r\n     * @param arg0\r\n     * @return\r\n     *     returns java.lang.String\r\n     *\/\r\n    @WebMethod\r\n    @WebResult(targetNamespace = \"\")\r\n    @RequestWrapper(localName = \"sayHello\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHello\")\r\n    @ResponseWrapper(localName = \"sayHelloResponse\", targetNamespace = \"http:\/\/jcg.demo.async.ws\", className = \"jcg.demo.jaxws.client.hello.SayHelloResponse\")\r\n    public String sayHello(\r\n        @WebParam(name = \"arg0\", targetNamespace = \"\")\r\n        String arg0);\r\n\r\n}\r\n<\/pre>\n<h3>5.3. ClientApp<\/h3>\n<p>Create a client application which invokes the service asynchronously.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>ClientApp.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package jcg.demo.callback;\r\n\r\nimport java.util.concurrent.ExecutionException;\r\nimport java.util.concurrent.Future;\r\n\r\nimport javax.xml.ws.Response;\r\n\r\nimport jcg.demo.jaxws.client.hello.HelloService;\r\nimport jcg.demo.jaxws.client.hello.HelloServiceImplService;\r\nimport jcg.demo.jaxws.client.hello.SayHelloResponse;\r\n\r\npublic class ClientApp {\r\n\tprivate static final int TEN_SECONDS = 10000;\r\n\tprivate static final String MESSAGE_DEMO = \"Mary Zheng\";\r\n\r\n\tpublic static void main(String args[]) {\r\n\t\tHelloServiceImplService client = new HelloServiceImplService();\r\n\t\tHelloService helloService = client.getHelloServiceImplPort();\r\n\r\n\t\ttry {\r\n\t\t\tinvokeSync(helloService);\r\n\t\t\tinvokeAsyncWithCallBack(helloService);\r\n\t\t\tinvokeAsyncWithPolling(helloService);\r\n\t\t} catch (InterruptedException | ExecutionException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprivate static void invokeSync(HelloService helloService) {\r\n\t\tString retFromServer = helloService.sayHello(MESSAGE_DEMO);\r\n\t\tSystem.out.println(\"Program waits till service returns. \" + retFromServer);\r\n\r\n\t}\r\n\r\n\tprivate static void invokeAsyncWithPolling(HelloService helloService)\r\n\t\t\tthrows InterruptedException, ExecutionException {\r\n\r\n\t\tResponse response = helloService.sayHelloAsync(MESSAGE_DEMO);\r\n\r\n\t\twhile (!response.isDone()) {\r\n\t\t\tThread.sleep(TEN_SECONDS);\r\n\t\t\tSystem.out.println(\"Program can do something while waiting and checking if the response is done. \");\r\n\t\t}\r\n\t\tSayHelloResponse output = response.get();\r\n\t\tSystem.out.println(\"Retrieved via polling: \" + output.getReturn());\r\n\r\n\t}\r\n\r\n\tprivate static void invokeAsyncWithCallBack(HelloService helloService) throws InterruptedException {\r\n\r\n\t\tFuture future = helloService.sayHelloAsync(MESSAGE_DEMO, (response) -&gt; {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(\"Retrieved via callback response: \" + response.get().getReturn());\r\n\t\t\t} catch (Exception exc) {\r\n\t\t\t\tSystem.out.println(exc.getClass().getName() + \" using callback for response:\" + exc.getMessage());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfor (int i = 0; i &lt; 9; i++) {\r\n\t\t\tSystem.out.println(\"Program can do something while waiting for the callback response!!!\");\r\n\t\t\tThread.sleep(TEN_SECONDS);\r\n\t\t}\r\n\r\n\t}\r\n}\r\n<\/pre>\n<h2>6. Demo Time<\/h2>\n<p>Start <code>HelloServerApp<\/code> and <code>ClientApp<\/code>.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>ClientApp output<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false\">Program waits till service returns. Hello Mary Zheng\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nRetrieved via callback response: Hello Mary Zheng\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting for the callback response!!!\r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nProgram can do something while waiting and checking if the response is done. \r\nRetrieved via polling: Hello Mary Zheng\r\n<\/pre>\n<p><strong>Note<\/strong>: Both <code>invokeAsyncWithCallBack<\/code> and <code>invokeAsyncWithPolling<\/code> allow the client to continue on other task while waiting for the service response.<\/p>\n<h2>7. Summary<\/h2>\n<p>In this example, I first built a JAX-WS service:\u00a0<code>HelloService<\/code>. Then I built a JAX-WS client from the server WSDL with <code>asyncMapping<\/code> enabled. Lastly I built a <code>clientApp<\/code> to demonstrate how to invoke the service asynchronously.<\/p>\n<h2>8. Download the Source Code<\/h2>\n<p>This example consists of a JAX-WS service and JAX-WS client which invokes the service asynchronously with callback.<\/p>\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\/02\/jax-ws-callback.zip\"><strong>JAX-WS Callback Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services. JAX-WS provides both Callback and Polling mechanisms to invoke web services asynchronously. In Callback mode, the client provides a callback handler to accept and process the inbound response object. In this example, I will demonstrate &hellip;<\/p>\n","protected":false},"author":140,"featured_media":1240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[461],"tags":[1711,1264],"class_list":["post-55042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jws","tag-callback","tag-jax-ws"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JAX-WS Callback Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.\" \/>\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-callback-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JAX-WS Callback Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-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-02-05T13:00:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-06T09:52: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=\"Mary Zheng\" \/>\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=\"Mary Zheng\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 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-callback-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/\"},\"author\":{\"name\":\"Mary Zheng\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/8a2034fbabcb20a9396e9819261855ae\"},\"headline\":\"JAX-WS Callback Example\",\"datePublished\":\"2018-02-05T13:00:50+00:00\",\"dateModified\":\"2018-03-06T09:52:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/\"},\"wordCount\":335,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"keywords\":[\"Callback\",\"JAX-WS\"],\"articleSection\":[\"jws\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/\",\"name\":\"JAX-WS Callback Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"datePublished\":\"2018-02-05T13:00:50+00:00\",\"dateModified\":\"2018-03-06T09:52:48+00:00\",\"description\":\"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-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-callback-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 Callback 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\/8a2034fbabcb20a9396e9819261855ae\",\"name\":\"Mary Zheng\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mary-Zheng_avatar_1510732235-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mary-Zheng_avatar_1510732235-96x96.jpg\",\"caption\":\"Mary Zheng\"},\"description\":\"Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/mary-zheng\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JAX-WS Callback Example - Java Code Geeks","description":"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.","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-callback-example\/","og_locale":"en_US","og_type":"article","og_title":"JAX-WS Callback Example - Java Code Geeks","og_description":"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-02-05T13:00:50+00:00","article_modified_time":"2018-03-06T09:52: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":"Mary Zheng","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Mary Zheng","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/"},"author":{"name":"Mary Zheng","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/8a2034fbabcb20a9396e9819261855ae"},"headline":"JAX-WS Callback Example","datePublished":"2018-02-05T13:00:50+00:00","dateModified":"2018-03-06T09:52:48+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/"},"wordCount":335,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","keywords":["Callback","JAX-WS"],"articleSection":["jws"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/","name":"JAX-WS Callback Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","datePublished":"2018-02-05T13:00:50+00:00","dateModified":"2018-03-06T09:52:48+00:00","description":"1. Introduction Java Architecture for XML Web Services\u00a0(JAX-WS) is a Java programming language for creating web services, particularly SOAP services.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jws\/jax-ws-callback-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-callback-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 Callback 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\/8a2034fbabcb20a9396e9819261855ae","name":"Mary Zheng","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mary-Zheng_avatar_1510732235-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/11\/Mary-Zheng_avatar_1510732235-96x96.jpg","caption":"Mary Zheng"},"description":"Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.","url":"https:\/\/examples.javacodegeeks.com\/author\/mary-zheng\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/55042","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\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=55042"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/55042\/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=55042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=55042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=55042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}