6 Replies Latest reply on Apr 20, 2007 3:39 AM by Stefano Zaccaria

    Webservices ETA?

    Nathan Ekstrom Newbie

      I'm sure you're tired being asked this but I am wondering when Seam will have built in Webservices support?

      Also thanks to Gavin and every one else who has put so much work into Seam. It is an incredible piece of software which makes my life much easier.

      Thanks

        • 1. Re: Webservices ETA?
          Shane Bryzak Master

          I'm working on it right now. I can't say exactly when it will be ready, but I'm pretty sure that there will be at least some working functionality within the next couple of weeks.

          • 2. Re: Webservices ETA?
            Todd Smart Newbie

            Hi Shane,

            Do you have any updates on the Web Services work you've been doing? I'd be very interested to know what the roadmap for Seam-WS is for the next 3-months...would you have that info?


            Regards,

            Todd

            • 3. Re: Webservices ETA?
              Shane Bryzak Master

              Web services are working now in CVS - I'm still working on getting conversations working across multiple web service requests, but hopefully this problem should be solved in the next week. Take a look at the seambay example in CVS for a taste of how it works.

              • 4. Re: Webservices ETA?
                Stefano Zaccaria Newbie

                 

                "shane.bryzak@jboss.com" wrote:
                Web services are working now in CVS - I'm still working on getting conversations working across multiple web service requests, but hopefully this problem should be solved in the next week. Take a look at the seambay example in CVS for a taste of how it works.

                Hi Shane,
                first all your work is great.
                This kind of program is that i need. I read that the ws function with seam, but i don't understand if with 1.2.1GA release or with the csv head. Because I need to start a jbpm process from a calling of ws, I try to call a class that have a @CreateProcess annotation, but I have some problem... Can you help me? I very appreciate
                Thanks

                • 5. Re: Webservices ETA?
                  Shane Bryzak Master

                  Web services support is still under development, in CVS only. I can't really help you with starting a JBPM process because we haven't built support for that yet :)

                  • 6. Re: Webservices ETA?
                    Stefano Zaccaria Newbie

                    Sorry Shane if I disturb you again but is rare found people that answer so fast in the forums, believe me this is very appreciated!
                    I've another questions about ws and seam...
                    1) You wrote to me that the ws is only support in CVS, therefore I must to check out and compile from CSV or is sufficiente that I down load the night build ?

                    2) I've take a look in to the "seambay" examples be present in to CVS. This example, call a object that is annotating with seam tag from a ws class...

                    package org.jboss.seam.example.seambay;
                    
                    import javax.ejb.Stateless;
                    import javax.jws.WebMethod;
                    import javax.jws.WebService;
                    
                    import org.jboss.seam.Component;
                    import org.jboss.seam.core.Manager;
                    import org.jboss.seam.security.Identity;
                    
                    @Stateless
                    @WebService
                    public class AuctionService implements AuctionServiceRemote
                    {
                     @WebMethod
                     public boolean login(String username, String password)
                     {
                     Identity.instance().setUsername(username);
                     Identity.instance().setPassword(password);
                     Identity.instance().login();
                     return Identity.instance().isLoggedIn();
                     }
                    
                     @WebMethod
                     public boolean logout()
                     {
                     Identity.instance().logout();
                     return !Identity.instance().isLoggedIn();
                     }
                    
                     @WebMethod
                     public Category[] listCategories()
                     {
                     CategoryAction catAction = (CategoryAction) Component.getInstance(
                     CategoryAction.class, true);
                    
                     catAction.loadCategories();
                    
                     return catAction.getCategories().toArray(new Category[catAction.getCategories().size()]);
                     }
                    
                     @WebMethod
                     public Integer createAuction(String title, String description, int categoryId)
                     {
                     AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
                    
                     action.createAuction();
                     action.setDetails(title, description, categoryId);
                    
                     return action.getAuction().getAuctionId();
                     }
                    
                     @WebMethod
                     public Auction getNewAuctionDetails(int auctionId)
                     {
                     AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
                    
                     action.editAuction(auctionId);
                    
                     // TODO remove the auction image from the result
                    
                     return action.getAuction();
                     }
                    
                     @WebMethod
                     public void updateAuction(int auctionId, String title, String description, int categoryId)
                     {
                     AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
                    
                     action.editAuction(auctionId);
                     action.setDetails(title, description, categoryId);
                     }
                    
                     @WebMethod
                     public void setAuctionDuration(int auctionId, int days)
                     {
                     Manager.instance().restoreConversation("" + auctionId);
                     AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
                    
                     action.setDuration(days);
                     }
                    
                     @WebMethod
                     public void confirmAuction(int auctionId)
                     {
                     AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
                    
                     action.confirm();
                     }
                    
                     @WebMethod
                     public Auction[] findAuctions(String searchTerm)
                     {
                     AuctionSearchAction search = (AuctionSearchAction) Component.getInstance(
                     AuctionSearchAction.class, true);
                    
                     search.setSearchTerm(searchTerm);
                     search.queryAuctions();
                    
                     return search.getAuctions().toArray(new Auction[search.getAuctions().size()]);
                     }
                    }
                    


                    where AuctionAction is

                    package org.jboss.seam.example.seambay;
                    
                    import static org.jboss.seam.ScopeType.CONVERSATION;
                    
                    import java.io.Serializable;
                    import java.util.Calendar;
                    import java.util.GregorianCalendar;
                    
                    import javax.persistence.EntityManager;
                    
                    import org.jboss.seam.annotations.Begin;
                    import org.jboss.seam.annotations.End;
                    import org.jboss.seam.annotations.In;
                    import org.jboss.seam.annotations.Name;
                    import org.jboss.seam.annotations.Scope;
                    import org.jboss.seam.annotations.security.Restrict;
                    
                    @Scope(CONVERSATION)
                    @Name("auctionAction")
                    @Restrict("#{identity.loggedIn}")
                    public class AuctionAction implements Serializable
                    {
                     private static final long serialVersionUID = -6738397725125671313L;
                    
                     @In EntityManager entityManager;
                    
                     @In Account authenticatedAccount;
                    
                     private Auction auction;
                    
                     private int durationDays;
                    
                     @Begin
                     public void createAuction()
                     {
                     auction = new Auction();
                     auction.setAccount(authenticatedAccount);
                     auction.setStatus(Auction.STATUS_UNLISTED);
                     entityManager.persist(auction);
                     }
                    
                     @Begin(join = true)
                     public void editAuction(Integer auctionId)
                     {
                     auction = entityManager.find(Auction.class, auctionId);
                     }
                    
                     public void setDetails(String title, String description, int categoryId)
                     {
                     auction.setTitle(title);
                     auction.setDescription(description);
                     auction.setCategory(entityManager.find(Category.class, categoryId));
                     }
                    
                     public void setDuration(int days)
                     {
                     this.durationDays = days;
                     }
                    
                     @End
                     public void confirm()
                     {
                     Calendar cal = new GregorianCalendar();
                     cal.add(Calendar.DAY_OF_MONTH, durationDays);
                     auction.setEndDate(cal.getTime());
                     auction.setStatus(Auction.STATUS_LIVE);
                     auction = entityManager.merge(auction);
                     }
                    
                     public Auction getAuction()
                     {
                     return auction;
                     }
                    }


                    So, if in the same manner, I call a class annotating with seam tag inherent jbpm, why this not will function ?
                    Thanks again
                    Stefano