0 Replies Latest reply on Nov 4, 2009 3:19 AM by genarotr

    How to connect to a Java WSDL in Flash Builder 4 ?

    genarotr

      Hi everybody!

      I have a Java project made with Hibernate + JPA.

      There is the code of the Java Class:

       

      package com.scop.acesso;
      
      import java.io.Serializable;
      import java.util.List;
      
      import com.scop.dao.DisciplinaDAO;
      import com.scop.dao.ProfessorDAO;
      import com.scop.dao.ProvaDAO;
      import com.scop.dao.TurmaDAO;
      import com.scop.entity.Disciplina;
      import com.scop.entity.Professor;
      import com.scop.entity.Prova;
      import com.scop.entity.Questoes;
      import com.scop.entity.Turma;
      
      
      public class CadastrodeProva implements Serializable{
           /**
            * 
            */
           private static final long serialVersionUID = 1L;
      
      
           public Turma[] ListTurma()
           {
                try{
                     TurmaDAO turmadao = new TurmaDAO();
                     List<Turma> list = turmadao.listarTurma();
                     Turma[] turmas = new Turma[list.size()];
                     for(int i = 0; i< list.size(); i++)
                     {
                          turmas[i] = list.get(i);
                     }
      
                     return turmas;
                }catch(Exception e){
                     e.printStackTrace();
                }
                return null;
           }
      
           public Disciplina[] ListDisciplina()
           {
                try{
                     DisciplinaDAO disciplinadao = new DisciplinaDAO();
                     List<Disciplina> list = disciplinadao.listarDisciplina();
                     Disciplina[] disciplinas = new Disciplina[list.size()];
                     for(int i = 0; i< list.size(); i++)
                     {
                          disciplinas[i] = list.get(i);
                     }
      
                     return disciplinas;
                }catch(Exception e){
                     System.out.println("Erro: " + e.getMessage());
                }
                return null;
                
           }
      
           public Professor[] ListProfessor()
           {
                try{
                     ProfessorDAO disciplinadao = new ProfessorDAO();
                     List<Professor> list = disciplinadao.listarProfessor();
                     Professor[] professores = new Professor[list.size()];
                     for(int i = 0; i< list.size(); i++)
                     {
                          professores[i] = list.get(i);
                     }
      
                     return professores;
                }catch(Exception e){
                     e.printStackTrace();
                }
                return null;
           }
      
      
      
           public void cadastraProva(Turma codigoturma, Disciplina codigodisciplina, Professor codigoprofessor, String dataprova, int qtdquestoes, List<Questoes> questoesList, double valorprova)
           {
                Prova prova = new Prova();
                ProvaDAO provadao = new ProvaDAO();
                prova.setCodigoturma(codigoturma);
                prova.setCodigodisciplina(codigodisciplina);
                prova.setCodigoprofessor(codigoprofessor);
                prova.setDataprova(dataprova);
                prova.setQtdquestoes(qtdquestoes);
                prova.setQuestoesList(questoesList);
                prova.setValorprova(valorprova);
                provadao.inserirProva(prova);
           }
      
      
      
      }
      

       

      When i generate WSDL automatically in Eclipse i receive this message:

      "IWAB0489E Error when deploying Web Service to Axis runtime"

       

      My questions are...

      The Java Class is wrong?

       

      I have to follow any model in Java for FB4 recognize the WSDL?

       


      I made some tests with simples Java Classes like this:

       

      package com.calculo.vo;
      
      public class CalculoVO {
           public int soma(int a, int b) {
                 return a + b;
              }
      }
      

       

      and this

       

      package classes;
      
      public class NoticiaEsporteVO {
           public String noticia;
           public String data;
           
           public String getNoticia() {
                return noticia;
           }
           public void setNoticia(String noticia) {
                this.noticia = noticia;
           }
           public String getData() {
                return data;
           }
           public void setData(String data) {
                this.data = data;
           }
      }
      

       

      With that classes i generate WSDL normally and FB4 revognize them.

       

       

      Someone can help me? PLEASE!!!

       

      obs: IM BAGGIN xD