1 Reply Latest reply on Oct 6, 2006 7:28 AM by Kristof Taveirne

    help in generating WSDL

    Marco Novice

      hi all,
      can anyone help me out in how to generate WSDL for my EJB?

      i have this very simple EJB3 that i want to expose a s a webService

      here's the interface

       * Copyright @ 2006
       * By Marco Mistroni
      package com.mm.j2me.ejb;
      import java.rmi.RemoteException;
      import javax.ejb.*;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import org.jboss.ws.annotation.PortComponent;
      import com.mm.j2me.core.Agency;
      import com.mm.j2me.core.WSFacade;
      @WebService (name="WSFacade",
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
       use = SOAPBinding.Use.LITERAL,
       parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
       contextRoot = "/",
      public interface WSRemoteSEI extends Remote {
       public String[] testWebServiceMethod() throws RemoteException;

      here' smy simple EJB3
      @WebService (name="WSFacade",
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
       use = SOAPBinding.Use.LITERAL,
       parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
      @Remote (WSFacade.class)
      @RemoteBinding( jndiBinding="/ejb3/WSRemoteSEI")
      public class TestFacade implements WSFacade{
       EntityManager em;
       public void deleteAgency(Agency agency) {
       // TODO Auto-generated method stub
       Query query = getQuery("findAgencyById");
       query.setParameter("id", agency.getId());
       Agency agencyToDelete = (Agency)query.getSingleResult();
       public void deleteJobApplication(JobApplication app) {
       Query query = getQuery("findJAById");
       query.setParameter("id", app.getId());
       JobApplication jaToDelete = (JobApplication)query.getSingleResult();
       public void deleteOpportunity(Opportunity opp) {
       Query query = getQuery("findOpportunityById");
       query.setParameter("id", opp.getId());
       Opportunity oppToDelete = (Opportunity)query.getSingleResult();
       public Agency[] getAllAgencies() {
       // TODO Auto-generated method stub
       Query query = getQuery("findAllAgencies");
       List<Agency> list = query.getResultList();
       Agency[] agencies = new Agency[list.size()];
       return (Agency[])(list.toArray(agencies));
       public JobApplication[] getAllJobApplications() {
       return new JobApplication[]{};
       public Opportunity[] getAllOpportunities() {
       //Query query = getQuery("findAllOpportunities");
       //return query.getResultList();
       return new Opportunity[]{};
       public void insertAgency(Agency agency) {
       // TODO Auto-generated method stub
       public void insertJobApplication(JobApplication app) {
       public void insertOpportunity(Opportunity opp) {
       public User login(String username) {
       // TODO Auto-generated method stub
       return null;
       private Query getQuery(String name) {
       return em.createNamedQuery(name);
       public String testWebServiceMethod() {
       String[] agencies = {"agency1;job1;", "agency2;job2"};

      i m runnign wstools with this cnfig file

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration xmlns="http://www.jboss.org/jbossws-tools"
       xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
       <wsdl-java file="http://localhost:9080//v1/soap/WSFacade?wsdl">
       <mapping file="jaxrpc-mapping-client.xml" />

      and all i got is plenty, plenty of generated classes:
      Annotation, AnnotationType, AnnotationTypeResponse, Certificat, CertPath, Class, Classloader, CodeSigner

      thing is that some classes does not even compile...
      why does it generate all extra classes ? i need only 2 of them WSFacade_PortType adn WSFacade_Service

      why do i have all those extra classes?
      anyone could recommend me the easiest wayt ogenerate wsdl from java for jbossws?

      thanks in advance and regards