5 Replies Latest reply on Sep 16, 2011 5:11 AM by foumpie

    AS7 + WS + Web App

    Marty Phee Newbie

      If I enable webservices on a bean then the website stops working, but the webservice does work.

       

      I assume this is just a mapping to the correct servlet issue.  What do I need to do to the web.xml to get both a site workng and the webservices.  I modeled this off the kitchen sink and the website along with the restful calls work fine. 

       

      What do I need to put into the web.xml to get both the website and the webservices running under the same application?  Or should they be in two seperate applications?

        • 1. Re: AS7 + WS + Web App
          Jim Ma Apprentice

          Can you paste your web.xml ? and also provide more information about how do you enable webservices on a bean ? Thanks.

          • 2. Re: AS7 + WS + Web App
            Marty Phee Newbie

            It's just a basic web.xml generated by the archetype.  That's why I'm wondering what servlet mappings I'll need for the ws and the jsf.

             

            <?xml version="1.0" encoding="UTF-8"?>

            <web-app version="3.0"

                xmlns="http://java.sun.com/xml/ns/javaee"

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="

                    http://java.sun.com/xml/ns/javaee

                    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

             

                <!-- An optional parameter that makes troubleshooting errors much easier -->

                <!-- You should remove this context parameter before deploying to production! -->

                <context-param>

                    <param-name>javax.faces.PROJECT_STAGE</param-name>

                    <param-value>Development</param-value>

                </context-param>

               

                <!-- JSF 2.0 Servlet activates automatically when the WEB-INF/faces-config.xml descriptor is present -->

             

                <!-- Enable this mapping to protect your view templates from direct URL access -->

                <!--

                <servlet-mapping>

                    <servlet-name>Faces Servlet</servlet-name>

                    <url-pattern>*.xhtml</url-pattern>

                </servlet-mapping>

                -->

                <session-config>

                    <session-timeout>60</session-timeout>

                </session-config>

             

                <!-- This section is optional. We are allowing index.jsf to handle the root URL (i.e., /). -->

                <welcome-file-list>

                    <!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->

                    <welcome-file>index.jsf</welcome-file>

                </welcome-file-list>

             

             

            </web-app>

            • 3. Re: AS7 + WS + Web App
              Jim Ma Apprentice

              Adding a webservice servlet-mapping in your web.xml does not work ?

              • 4. Re: AS7 + WS + Web App
                Marty Phee Newbie

                I'm sure it would.  Can you give me the proper servlet mappings I need?  I couldn't find them since AS does it automatically.

                • 5. Re: AS7 + WS + Web App
                  foumpie Newbie

                  Something like this ?

                   

                      <servlet>
                          <servlet-name>testWS</servlet-name>
                          <servlet-class>com.full.package.name.testWS</servlet-class>
                      </servlet>
                      <servlet-mapping>
                          <servlet-name>testWS</servlet-name>
                          <url-pattern>/testWS</url-pattern>
                      </servlet-mapping>
                  

                   

                  http://localhost/contextroot/textWS?wsdl

                  should now work.