5 Replies Latest reply on Feb 2, 2015 3:58 AM by xdat26

    Generated double-slash in webservice URL

    akulikov

      Currently I am doingmigration of our project from jboss 4 to jboss 6 final. One of the problems isgenerated extra slash in a path to the web services endpoint.

      We are using POJO web services.

      Some configuration:

      In jboss-web.xml we have <context-root>/</context-root>

      In web.xml we have

      <servlet>

      <servlet-name>trainingCertificationService</servlet-name>

      <servlet-class>org.webservice.TrainingCertificationSoap</servlet-class>

      <load-on-startup>1</load-on-startup>

      </servlet>

      <servlet-mapping>

      <servlet-name>trainingCertificationService</servlet-name>

      <url-pattern>/iut/trainingCertificationService</url-pattern>

      </servlet-mapping>

      I am able to deploy current project but every web service endpoint contains double-slash

      Here is an example http://localhost:8080//iut/trainingCertificationServicehttp://localhost:8080/iut/trainingCertificationService?wsdl

      Somehow jboss deployment is adding endpoint configuration to a root context. A result is simple //iut/myWebservices.Is anybody knows how to remove extra slash from endpoint path? Our project is huge. So I created test project and deployed web service with a context-root different from “/” and I got correct result and path to the web service endpoint. Even in a test project after setting context-root to a “/” I got double slashesin URL. Is it a jboss bug or I am missing something.  I am using jboss 6.0.0 final and java version"1.6.0_22"

      Thank you for help

        • 1. Generated double-slash in webservice URL
          asoldano

          Does the url with double slash still work? If not, please create a jira. This appears to be a bug with an edge case. Btw, do you really want to deploy to the / context root?

          • 2. Generated double-slash in webservice URL
            akulikov

            Yes web services are working and “/” context root shouldstay.

            Double-slash is making tree small problems:

            1.      we have a clients for an existing web services

            2.      we got some kind custom build flush map which is using current endpoint address(no way to rebuild it)

            3.      we are government organization - firewall and load-balancer rules is finalized. 

             

            Currently I am moving web services from current “WAR” fileto a new with a different context root. A lot of job. I am hoping to find simplesolution instance of rework part of the project.

            • 3. Generated double-slash in webservice URL
              asoldano

              OK, I've created https://issues.jboss.org/browse/JBWS-3288

               

              Thanks for reporting the issue.

              • 4. Generated double-slash in webservice URL
                akulikov

                Thank you

                 

                here is more info

                 

                 

                 

                 

                Java code:

                package org.anatoliy;

                 

                importjavax.jws.WebService;

                importjavax.jws.soap.SOAPBinding;

                 

                @WebService

                @SOAPBinding(style = SOAPBinding.Style.RPC)

                public class MyEchoClass {

                     

                      public StringechoOne(String input)

                      {

                            return "returns:" + input ;

                      }

                }

                 

                mapping in web.xml

                <servlet>

                <servlet-name>TestEcho</servlet-name>

                <servlet-class>org.anatoliy.MyEchoClass</servlet-class>

                </servlet>

                <servlet-mapping>

                <servlet-name>TestEcho</servlet-name>

                <url-pattern>/testEcho</url-pattern>

                </servlet-mapping>

                 

                Jboss-web.xml

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

                <!DOCTYPE jboss-webPUBLIC "-//JBoss//DTDWeb Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">

                 

                <jboss-web>

                     

                      <class-loading/>

                      <security-domain>java:/jaas/iseek</security-domain>

                      <context-root>uit</context-root>

                      <virtual-host>iseek.org</virtual-host>

                      <use-session-cookies>true</use-session-cookies>

                      <replication-config/>

                </jboss-web>

                jbossws/services will show:

                Endpoint Name jboss.ws:context=uit,endpoint=TestEchoEndpoint Address http://localhost:8080/uit/testEcho

                 

                By changing context-root in  jboss-web.xml from uit to “/”

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

                <!DOCTYPE jboss-webPUBLIC "-//JBoss//DTDWeb Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">

                 

                <jboss-web>

                     

                      <class-loading/>

                      <security-domain>java:/jaas/iseek</security-domain>

                      <context-root>/</context-root>

                      <virtual-host>iseek.org</virtual-host>

                      <use-session-cookies>true</use-session-cookies>

                      <replication-config/>

                </jboss-web>

                I will have a endpoint address with a double slash

                Endpoint Name jboss.ws:context=,endpoint=TestEcho EndpointAddress http://localhost:8080//testEcho

                 

                Both configurations is working.

                • 5. Re: Generated double-slash in webservice URL
                  xdat26

                  hi.

                  i have the same problem on jboss5.1.GA(jdk-6) and jboss-cxf3.4.0

                  is there any way to solve the problem?