Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":727,"date":"2014-05-15T16:24:22","date_gmt":"2014-05-15T19:24:22","guid":{"rendered":"http:\/\/www.feltex.com.br\/felix\/?p=727"},"modified":"2014-08-20T14:07:16","modified_gmt":"2014-08-20T17:07:16","slug":"resteasy-wildfly-7-hello-world","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/","title":{"rendered":"Web Service RESTEasy no servidor WildFly – Hello world"},"content":{"rendered":"

Web Service RESTEasy no servidor WildFly – Hello world<\/H1><\/p>\n

Ol\u00e1 Amigos, inniciaremos a campanha de Web Service. Hoje faremos um no padr\u00e3o Web RESTFul<\/a>. Para isso devemos utilizar as ferramentas da JBOSS. Quando instalado o Servidor de aplica\u00e7\u00e3o WildFly temos embutido o framework RestEasy que ser\u00e1 utilizado neste nosso exemplo. A dupla RESTEasy WildFly ser\u00e1 utilizada neste exemplo.<\/p>\n

\"RestEasy01\"<\/a><\/p>\n

<\/p>\n

Ambiente a ser configurado:<\/p>\n

    \n
  1. Servidor WildFly<\/li>\n
  2. RestEasy 3<\/li>\n
  3. JDK 7<\/li>\n<\/ol>\n

    Tarefas:<\/p>\n

      \n
    • Servidor WildFly<\/li>\n<\/ul>\n

      Veja como ficar\u00e1 o nosso exemplo:
      \n

      Primeiro iremos \u00a0 criar uma aplica\u00e7\u00e3o Web (RESTEasy WildFly).<\/H2><\/p>\n

      Em uma aplica\u00e7\u00e3o Web. Crie uma classe chamada “AloMundoService”. Esta classe disponibilizar\u00e1 o servi\u00e7o que enviar\u00e1 uma mensagem para o usu\u00e1rio. Veja o c\u00f3digo abaixo:<\/p>\n

      \r\npackage br.com.feltex.webservice.servico;\r\n\r\nimport javax.ws.rs.GET;\r\nimport javax.ws.rs.Path;\r\nimport javax.ws.rs.PathParam;\r\n\r\n@Path(\"\/aloMundo\")\r\npublic class AloMundoService {\r\n\r\n\t@GET\r\n\t@Path(\"\/mensagem\/{nome}\")\t\r\n\tpublic String criarMensagem(@PathParam(\"nome\") String nome) {\r\n\t\treturn \"Ola \" + nome + \" seja bem vinda!\" + System.currentTimeMillis();\r\n\t}\r\n}\r\n\r\n<\/pre>\n

      Em seguida temos que criar uma classe que iniciar\u00e1 os servi\u00e7os assim que o servidor for inicializado com a nossa aplica\u00e7\u00e3o.
      \nVeja o c\u00f3digo abaixo.<\/p>\n

      \r\npackage br.com.feltex.webservice.servico;\r\n\r\nimport java.util.HashSet;\r\nimport java.util.Set;\r\n\r\nimport javax.ws.rs.ApplicationPath;\r\nimport javax.ws.rs.core.Application;\r\n\r\n@ApplicationPath(\"\/rs\")\r\npublic class WSServico extends Application {\r\n\r\n\tprivate Set singletons = new HashSet();\r\n\tprivate Set> empty = new HashSet>();\r\n\r\n\tpublic WSServico() {\r\n\t\tsingletons.add(new AloMundoService());\r\n\t}\r\n\r\n\tpublic Set> getClasses() {\r\n\t\treturn empty;\r\n\t}\r\n\r\n\tpublic Set getSingletons() {\r\n\t\treturn singletons;\r\n\t}\r\n}\r\n<\/pre>\n

      Agora temos que configurar o uso do framework RestEasy em nossa aplica\u00e7\u00e3o.
      \nPara isso adicione ao seu arquivo web.xml as configura\u00e7\u00f5es abaixo.<\/p>\n

      \r\n\r\n\r\n\tRestEasyAloMundo<\/display-name>\r\n\t\r\n\t\tindex.html<\/welcome-file>\r\n\t<\/welcome-file-list>\r\n\r\n\t\r\n\t\r\n\t\tjavax.ws.rs.Application<\/param-name>\r\n\t\tbr.com.feltex.webservice.servico.WSServico<\/param-value>\r\n\t<\/context-param>\r\n\r\n\t\r\n\t\tresteasy.servlet.mapping.prefix<\/param-name>\r\n\t\t\/rs<\/param-value>\r\n\t<\/context-param>\r\n\t\r\n\t\torg.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap<\/listener-class>\r\n\t<\/listener>\r\n\t\r\n\t\tResteasy<\/servlet-name>\r\n\t\torg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher<\/servlet-class>\r\n\t<\/servlet>\r\n\r\n\t\r\n\t\r\n\t\tResteasy<\/servlet-name>\r\n\t\t\/rs\/*<\/url-pattern>\r\n\t<\/servlet-mapping>\r\n<\/web-app>\r\n\r\n<\/pre>\n

      Por fim crie uma p\u00e1gina “index.html” onde teremos o link para testar o servi\u00e7o.<\/p>\n

      \r\n\r\n\r\n\r\nProjeto RestEasy<\/title>\r\n<\/head>\r\n<body>\r\n\tSeja bem vindo ao Projeto WebServiceRestEasy.\r\n\t<\/p>\r\n\t<a href=\"rs\/aloMundo\/mensagem\/Maria\">Chamar Web Service<\/a>\r\n<\/body>\r\n<\/html>\r\n\r\n<\/pre>\n<p> Agora seu webservice com RestEasy est\u00e1 configurado e pronto para uso.<br \/>\n Execute sua aplica\u00e7\u00e3o no servidor Wildfly e clique no link que ser\u00e1 exibido na “index.html”, ou ainda, poder\u00e1 utilizar o seguinte link diretamente no seu browser:<\/p>\n<pre>\r\n  <a href=\"http:\/\/localhost:8080\/RestEasyAloMundo\/rs\/aloMundo\/mensagem\/Maria\" target=\"_blank\" class=\"broken_link\">http:\/\/localhost:8080\/RestEasyAloMundo\/rs\/aloMundo\/mensagem\/Maria<\/a>\r\n<\/pre>\n<p>O resultado deve ser algo parecido com isso:<\/p>\n<pre>\r\n   Ola Maria seja bem vinda!1400795712679\r\n<\/pre>\n<p>   Parab\u00e9ns pelo seu novo servi\u00e7o WEB. Vida que segue!<\/p>\n<p>Baixe o exemplo completo <a href=\"http:\/\/feltex.com.br\/felix\/java\/exemplos\/RestEasyAloMundo.war\">aqui <\/a><\/p>\n<p><H2>Links relacionados<\/H2><br \/>\n<a href=\"https:\/\/www.feltex.com.br\/felix\/webservice-ejb-hello-wolrd\/\" title=\"WebService com EJB Hello Wolrd\" target=\"_blank\">WebService com EJB Hello Wolrd<\/a><\/p>\n<p><a href=\"https:\/\/www.feltex.com.br\/felix\/arquivo-xml-java-dom-parser\/\" title=\"Como criar arquivo XML em Java (DOM Parser)\" target=\"_blank\">Como criar arquivo XML em Java (DOM Parser)<\/a><\/p>\n<p><H2>N\u00e3o esque\u00e7a de curtir este post nas rede sociais. D\u00ea a sua contribui\u00e7\u00e3o social e ajude o autor:<\/H2><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Web Service RESTEasy no servidor WildFly – Hello world Ol\u00e1 Amigos, inniciaremos a campanha de Web Service. Hoje faremos um no padr\u00e3o Web RESTFul. Para isso devemos utilizar as ferramentas da JBOSS. Quando instalado o Servidor de aplica\u00e7\u00e3o WildFly temos …<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/\"> <span class=\"screen-reader-text\">Web Service RESTEasy no servidor WildFly – Hello world<\/span> Read More »<\/a><\/p>\n<p><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":1335,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Web Service RESTEasy no servidor WildFly - Hello world<\/title>\n<meta name=\"description\" content=\"Criando um webservice RESTEasy WildFly 8 Hello world\" \/>\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.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web Service RESTEasy no servidor WildFly - Hello world\" \/>\n<meta property=\"og:description\" content=\"Criando um webservice RESTEasy WildFly 8 Hello world\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/\" \/>\n<meta property=\"og:site_name\" content=\"Aprenda Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/feltex.br\" \/>\n<meta property=\"article:published_time\" content=\"2014-05-15T19:24:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-08-20T17:07:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"640\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andr\u00e9 F\u00e9lix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/\",\"name\":\"Aprenda Java\",\"description\":\"Cursos de java, SQL e Engenharia de Software\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#primaryimage\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg\",\"contentUrl\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg\",\"width\":640,\"height\":640,\"caption\":\"RESTEasy WildFly\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#webpage\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/\",\"name\":\"Web Service RESTEasy no servidor WildFly - Hello world\",\"isPartOf\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#primaryimage\"},\"datePublished\":\"2014-05-15T19:24:22+00:00\",\"dateModified\":\"2014-08-20T17:07:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\"},\"description\":\"Criando um webservice RESTEasy WildFly 8 Hello world\",\"breadcrumb\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Web Service RESTEasy no servidor WildFly – Hello world\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\",\"name\":\"Andr\\u00e9 F\\u00e9lix\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#personlogo\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"caption\":\"Andr\\u00e9 F\\u00e9lix\"},\"sameAs\":[\"http:\/\/www.feltex.com.br\"],\"url\":\"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Web Service RESTEasy no servidor WildFly - Hello world","description":"Criando um webservice RESTEasy WildFly 8 Hello world","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.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/","og_locale":"pt_BR","og_type":"article","og_title":"Web Service RESTEasy no servidor WildFly - Hello world","og_description":"Criando um webservice RESTEasy WildFly 8 Hello world","og_url":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/","og_site_name":"Aprenda Java","article_publisher":"https:\/\/www.facebook.com\/feltex.br","article_published_time":"2014-05-15T19:24:22+00:00","article_modified_time":"2014-08-20T17:07:16+00:00","og_image":[{"width":640,"height":640,"url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg","type":"image\/jpeg"}],"twitter_misc":{"Escrito por":"Andr\u00e9 F\u00e9lix","Est. tempo de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.feltex.com.br\/felix\/#website","url":"https:\/\/www.feltex.com.br\/felix\/","name":"Aprenda Java","description":"Cursos de java, SQL e Engenharia de Software","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#primaryimage","inLanguage":"pt-BR","url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg","contentUrl":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/05\/RESTEasy-WildFly.jpg","width":640,"height":640,"caption":"RESTEasy WildFly"},{"@type":"WebPage","@id":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#webpage","url":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/","name":"Web Service RESTEasy no servidor WildFly - Hello world","isPartOf":{"@id":"https:\/\/www.feltex.com.br\/felix\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#primaryimage"},"datePublished":"2014-05-15T19:24:22+00:00","dateModified":"2014-08-20T17:07:16+00:00","author":{"@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069"},"description":"Criando um webservice RESTEasy WildFly 8 Hello world","breadcrumb":{"@id":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.feltex.com.br\/felix\/resteasy-wildfly-7-hello-world\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Web Service RESTEasy no servidor WildFly – Hello world"}]},{"@type":"Person","@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069","name":"Andr\u00e9 F\u00e9lix","image":{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/#personlogo","inLanguage":"pt-BR","url":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","caption":"Andr\u00e9 F\u00e9lix"},"sameAs":["http:\/\/www.feltex.com.br"],"url":"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/727"}],"collection":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/comments?post=727"}],"version-history":[{"count":29,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":1338,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/727\/revisions\/1338"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media\/1335"}],"wp:attachment":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media?parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/categories?post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/tags?post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}