Aplicação SOA
Autor: Arthur Tavares | Publicado: 2011-02-11T11:01:00-08:00

Caso de Uso:

Tínhamos que buscar alguns dados de tabelas diferentes para utilizarmos em nosso aplicativo.
Para isso, fizemos um barramento SOA (que não vou postar por motivo de sigilo da empresa...) e conectamos este cliente a ele.

Problemas resolvidos com este código:
Swing: Utilização de tabelas dentro de abas, sem a utilização de containers.
Popular tabelas com array bidimensional de strings

SOA: Transportar strings entre o barramento e o Cliente.


-----------------------------------------------------------------------------------------------------------------



-----------------------------------------------------------------------------------------------------------------
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.XMLType;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class Unitizacao implements ActionListener{
&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; JFrame tela = new JFrame();
&nbsp;&nbsp;&nbsp; JTextField TfOdex;
&nbsp;&nbsp;&nbsp; JTable tbData1, tbData2, tbData3, tbData4, tbData5;
&nbsp;&nbsp;&nbsp; JTextArea area6 = new JTextArea();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; public static void main(String args[]){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Cria o Objeto para tirar o swing de um método static
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Unitizacao u = new Unitizacao();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; u.run();
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; public void run(){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Tenta utilizar uma biblioteca de aparencia para o Swing
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; area6.setText(e.getMessage());
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Layout null para posicionamento manual dos itens
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setLayout(null);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // INÍCIO GRUPO DE OBJETOS DO CABEÇALHO
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Objeto do texto Odex
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JLabel LbOdex = new JLabel("ODEX");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Objeto Font para ajustar o tipo, estilo e tamanho da fonte
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Font t = new Font("Arial", Font.BOLD, 20); 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Atribuindo o Objeto Font ao Objeto do texto Odex
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LbOdex.setFont(t);
&nbsp;&nbsp;&nbsp;&nbsp; // ajustar posição do elemento no JPanel: (coluna, linha, largura, altura)
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LbOdex.setBounds(10, 40, 60, 30);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Objeto da caixa de diálogo
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TfOdex = new JTextField("");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ajustar posição do elemento no JPanel: (coluna, linha, largura, altura)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TfOdex.setBounds(80, 40, 370, 30);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Objeto do botão Consultar
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JButton consulta = new JButton("Consultar");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; consulta.setBounds(480, 40, 120, 30);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Adiciona o listner ao Botão
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; consulta.addActionListener(this);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Determina o comando que o listener recebe ao clicar no Botão
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; consulta.setActionCommand("consultar");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Objeto do botão Sair
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JButton sair = new JButton("Sair");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sair.setBounds(630, 40, 120, 30);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sair.addActionListener(this);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sair.setActionCommand("sair");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // FIM DO GRUPO DE OBJETOS DO CABEÇALHO
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // INÍCIO DO GRUPO DE OBJETOS DE ABAS
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Cria o Objeto do conjunto de Abas
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JTabbedPane tabelaDePaineis = new JTabbedPane(JTabbedPane.TOP);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.setBounds(0, 100, 800, 500);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ABA 1
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Objeto da Aba 1
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JPanel painel01 = new JPanel(null);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Objeto da Tabela 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbData1 = new JTable();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData1.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Crio o objeto do Scroll e coloco a tabela dentro dele.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc = new JScrollPane(tbData1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Indica que a scroll bar vertical é necessária
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Indica que a scroll bar horizontal é necessária
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Adiciona a Scroll (com a tabela dentro) no objeto da primeira aba.
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel01.add(sc);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ABA 2
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JPanel painel02 = new JPanel(null);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbData2 = new JTable();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData2.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc2 = new JScrollPane(tbData2);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc2.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel02.add(sc2);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ABA 3
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JPanel painel03 = new JPanel(null);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbData3 = new JTable();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData3.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData3.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc3 = new JScrollPane(tbData3);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc3.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel03.add(sc3);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ABA 4
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JPanel painel04 = new JPanel(null);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbData4 = new JTable();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData4.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData4.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc4 = new JScrollPane(tbData4);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc4.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc4.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc4.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel04.add(sc4);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ABA 5
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JPanel painel05 = new JPanel(null);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbData5 = new JTable();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData5.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData5.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc5 = new JScrollPane(tbData5);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc5.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc5.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc5.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel05.add(sc5);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ABA 6 - LOG
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JPanel painel06 = new JPanel(null);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; area6.setBounds(5,5,685,360);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JScrollPane sc6 = new JScrollPane(area6);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc6.setBounds(5,5,780,430);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc6.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sc6.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; painel06.add(sc6);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // adiciona as abas no objeto de abas
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("Informações",painel01);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("Detalhes",painel02);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("MaterialUC",painel03);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("MaterialCOM",painel04);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("Serviços",painel05);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tabelaDePaineis.addTab("Log",painel06);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ADICIONANDO OS OBJETOS AO FRAME
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.add(LbOdex);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.add(TfOdex);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.add(consulta);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.add(sair);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tela.add(tabelaDePaineis);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // SETANDO DETALHES DO FRAME
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setTitle("Unitização");&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setSize(800, 600);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setBounds(100,100, 800, 600);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setResizable(false);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tela.setVisible(true);&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; public void actionPerformed(ActionEvent e){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(e.getActionCommand().equals("consultar")){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String[][] resposta = null;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // chama o método de conexão, passando o método que será invocado.
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = conecta("Informacoes");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ajusta a tabela com o array retornado pela conexão.
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData1.setModel(new DefaultTableModel(resposta, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"}));
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = conecta("Detalhes");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData2.setModel(new DefaultTableModel(resposta, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"}));
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = conecta("MaterialUC");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData3.setModel(new DefaultTableModel(resposta, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"}));
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = conecta("MaterialCOM");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData4.setModel(new DefaultTableModel(resposta, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"}));
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = conecta("Servicos");
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tbData5.setModel(new DefaultTableModel(resposta, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"}));

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(e.getActionCommand().equals("sair")){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.exit(0);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; public String[][] conecta(String operacao){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String[][] resposta = null;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Service&nbsp; service&nbsp; = new Service();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Call call;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String odex = TfOdex.getText();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call = (Call) service.createCall();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Atribuindo a URL do Servico
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Importante: é necessário um serviço SOA para conexão
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call.setTargetEndpointAddress(new java.net.URL("&lt;&lt;INSERIR AQUI A URL DO BARRAMENTO SOA IMPLEMENTADO&gt;&gt;"));

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Definindo o metodo a ser invocado
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call.setOperationName(operacao);

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Definindo os parametros de entrada
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call.addParameter("odex", XMLType.XSD_STRING, ParameterMode.IN);

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Definindo o tipo do parametro de retorno
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_ARRAY);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Invocando o servico
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resposta = (String[][]) call.invoke(new Object[] {odex});

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (Exception ex) {
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String a = "Serviço "+operacao+" "+ex.getMessage();
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; area6.setText(a);
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return resposta;
&nbsp;&nbsp;&nbsp; }
}