4 Replies Latest reply on Aug 6, 2008 7:53 AM by rohit.macherla

    Host name issue while deploying WebService

    rohit.macherla

      Hi,

      I have a WebService created as a .war file with the implementation class developed in Java and properly annotated. When I deploy the War file, i.e., when I put the WAR file in the /server/default/deploy folder, the WSDL is generated automatically and is in the location /data/wsdl/<app-name>.

      But this WSDL has the SOAP:ADDRESS field as something like this :

      http://STD42S15.tndsdc.bsnl.co.in:8080/CompositeWebServiceForServiceOrder/CompositeWebServiceForServiceOrderService

      The problem is with the hostname. JBoss 4.2.2.GA is the version that I am using and it is installed on HP-UX platform. When I get the hostname of the server by typing the "hostname" in the Unix window, I get only :
      STD42S15

      According to our server admin, the fully qualified name "STD42S15.tndsdc.bsnl.co.in" is present only in the DNS names config.

      I want my WebService to be generated with the SOAP:ADDRESS :
      http://STD42S15:8080/CompositeWebServiceForServiceOrder/CompositeWebServiceForServiceOrderService

      I mean without the .tndsdc.bsnl.co.in

      When I change the jboss-service.xml entry of the following :


      <mbean code="org.jboss.web.WebService"
      name="jboss:service=WebService">
      <!-- The Bind address and Port -->
      <attribute name="BindAddress">${jboss.bind.address}</attribute>
      <attribute name="Port">8083</attribute>
      <!-- The address to use for the host portion of the RMI codebase URL -->
      <attribute name="Host">${java.rmi.server.hostname}</attribute>
      <!-- Should non-EJB .class files be downloadable -->


      to


      <mbean code="org.jboss.web.WebService"
      name="jboss:service=WebService">
      <!-- The Bind address and Port -->
      <attribute name="BindAddress">${jboss.bind.address}</attribute>
      <attribute name="Port">8083</attribute>
      <!-- The address to use for the host portion of the RMI codebase URL -->
      <attribute name="Host">STD42S15</attribute>
      <!-- Should non-EJB .class files be downloadable -->

      I thought the problem would be resolved, but it hasn't. Whenever I start the server, from the logs i can see that the bind.address is still "STD42S15.tndsdc.bsnl.co.in". I thought 0.0.0.0 would be the bind address as i start my server using the command

      ./run.sh -b 0.0.0.0


      Any help on how to change the default host name would be appreciated.
      Thanks.


        • 1. Re: Host name issue while deploying WebService
          rohit.macherla

          The hostname field in the quote did not appear properly.
          I paste it again.

          <attribute name="Host">${java.rmi.server.hostname}</attribute>


          was changed to

          <attribute name="Host">STD42S15</attribute>


          • 2. Re: Host name issue while deploying WebService
            rohit.macherla

            Hi all,

            I have found the place where I can change the hostname.

            After the server is started, from the JMX console, go to the MBean view :

            MBean Name: Domain Name: jboss.ws
            service: ServerConfig


            In this MBean, we have the MBean attribute : WebServiceHost whose value can be changed. However, I find that even though we change the file, the changes will be lost once we restart the server.
            Can this MBean properties be included in the jboss-service.xml so that I need not change this setting each time ? I need a way to make this change permanent, I mean, it shouldn't disapper each time I restart the server.

            • 3. Re: Host name issue while deploying WebService
              peterj

              Try editing the webServiceHost property for the WSServerConfig bean in the server/xxx/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml file.

              The problem with changing the binding address in individual files is that that you have to change all of the addresses in all of the files. And then remembed ot also set -b to that same host. It is usually preferred to leave the config files as they are and only use the -b option. Having said that there are situations in which using 0.0.0.0 as the binding address causes weird problems (it has been a while since I dealt with this so I don't recall what the issues were) but using "-b hostname" ("-b STD42515" in your case) should not cause any issues.

              • 4. Re: Host name issue while deploying WebService
                rohit.macherla

                Thanks PeterJ.

                When have used the bind address as the hostname, in our case "STD42S15", the WSDL's are generated with this hostname now.

                Thanks again.