8 Replies Latest reply on Aug 1, 2007 8:39 PM by shane.bryzak

    SOS-Creating WebService with Seam

    djohan0817

      Could someone please explain to me the steps that I have to follow to create a WebService and a WS Client with Seam, because I was following the Seam documentation, I put the file called standard-jaxws-endpoint-config.xml into the META-INF directory of the jar file that contains the web service classes, but still it doesn't work...

        • 1. Re: SOS-Creating WebService with Seam
          lowecg2004

          What do you mean by "does not work" - do you get exceptions or error messages of any sort? There was a fix put in yesterday resolving an NPE if no conversationId was specified on a WS call. I've been having trouble with sessions, but have been able to deploy and invoke the web service just fine:

          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=114733

          If you're using a stateless session bean (SLSB), then make sure you're using the @Remote (rather than @Local) annotation for your interface.

          What version of Seam and JBoss are you using? I'm using the following:

          JBossAS 4.2.0.GA
          Seam 2.0.0.CVS31-07-2007
          JBossWS 2.0.0.GA
          JDK 6.0

          Also be aware that there is extra config required to run WS under JDK 6.0.

          Cheers,

          Chris

          • 2. Re: SOS-Creating WebService with Seam
            djohan0817

            Thanks Chris for your response. Well first of all, I must tell you that I've been using Seam for a few months but I've never done Web Services with it, so I'm kinda new to this stuff.

            I'm using :
            JBossAS 4.0.5.GA
            JBoss Seam 1.1.6.GA
            JDK 5.0

            In order for you to help me, I'll explain what I've done. I have my project that I've been working on, now I have to add a web Service layer. So I added a new namespace in the project and I create a class and it's interface. Here is the content of my class (it's just a test):

            import javax.jws.WebMethod;
            import javax.jws.WebService;
            
             @WebService
             @Stateless
             public class WS_Test implements WS_TestLocal
             {
             private String message = new String("Hello, ");
            
            
             @WebMethod
             public String sayHello(String name) {
             return message + name + ".";
             }
            }


            I'm using Ant with eclipse to explode the project on JBoss. It generates the WSDL file, when I type "http://localhost:8080/jbossws" in the adress bar of my browser, I can see my web Service as a Registered Service Endpoint but when I click on it to view the wsdl, I get an error that tells me that the resource is not available. I don't understand...Any Idea?

            Johan

            • 3. Re: SOS-Creating WebService with Seam
              lowecg2004

              Johan,

              The name of your interface is WS_TestLocal which implies you are using the @Local annotation. For web services you need to use @Remote. For example, I think you should use something like this:

              @Remote
              public interface WS_TestRemote {
               String sayHello(String name);
              }


              Cheers,

              Chris.

              • 4. Re: SOS-Creating WebService with Seam
                djohan0817

                I had already replaced it when I saw your first response. Even though it's WS_TestLocal, I had the @Remote annotation inside.

                • 5. Re: SOS-Creating WebService with Seam
                  lowecg2004

                  In your logs do you see an entry something like this:

                  INFO [LifecycleHandlerImpl] WebService started: http://DFVGM71J:8080/dcs-dcs/DevelopmentAuthenticator


                  Where "http://DFVGM71J:8080/dcs-dcs/DevelopmentAuthenticator" is the published end point of my web service. To see the WSDL, add "?wsdl" to the URL:

                  http://DFVGM71J:8080/dcs-dcs/DevelopmentAuthenticator?wsdl

                  I have JBossWS 2.0.0, so your log entries may be different.

                  C

                  • 6. Re: SOS-Creating WebService with Seam
                    djohan0817

                    This is what I saw in my log:

                    17:41:55,187 INFO [EJBContainer] STARTED EJB: webServices.WS_Test ejbName: WS_Test
                    17:41:55,562 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/deploy/malongo.ear/malongo.jar/
                    17:41:55,671 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/malongo.ear/malongo.jar/WS_TestService2213.wsdl
                    17:41:55,921 INFO [ServiceEndpointManager] WebService started: http://Johan:8080/malongo/WS_Test


                    When I add "?wsdl" at the end of "http://Johan:8080/malongo/WS_Test" in my browser, it gives me an error of type HTTP STATUS 404, telling me that the requested resource is not available.

                    Johan

                    • 7. Re: SOS-Creating WebService with Seam
                      lowecg2004

                      I'm sorry Johan, but I'm all out of ideas :( Hopefully one of the Seam guys can help.

                      • 8. Re: SOS-Creating WebService with Seam
                        shane.bryzak

                        I suggest you head over to the JBossWS forum, as this isn't a Seam issue.