8 Replies Latest reply on May 30, 2013 9:35 AM by shashi Paripalli

    Is it possible to configure JAX-WS services with an external descriptor?

    Carlo Bonamico Newbie

      Hi,

      I had to manage a situation similar to https://community.jboss.org/thread/146575 where a JBoss instance publishes a JaxWs service (annotated with @WebService) on plain http:// on an internal network, and an external Apache httpd server with mod_proxy or mod_jk re-publishes the service over https:// on the outside. The environment is JBoss-WS on JBoss AS 5.1.0.

       

      In order to be able to rewrite the soap:address field in the WSDL I successfully followed @asoldano advice:

       

      >Something else you might want to try is setting your soap:address to something like "https://REPLACE-ME", that should force the https protocol to be use in the soap:address when rewriting it. I think this probably has the side effect of overwriting the webServicePort you might want to >specify though.

       

      Then enabled rewriting of the address in

       

      jbossws.deployer/META-INF/jboss-beans.xml

       

      <bean name="ServiceEndpointManager" class="org.jboss.ws.server.ServiceEndpointManager">
            <!--
              The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
              element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
           
              If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless AlwaysModifySOAPAddress is true.
              If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
            -->
            <property name="webServiceHost">www.external.domain.com</property>
            <property name="webServiceSecurePort">443</property>
            <property name="alwaysModifySOAPAddress">true</property>
            ...
          </bean>

       

      In this way the resulting url exposed in the wsdl is https://www.external.domain.com/path/... which is what I needed to achieve.

       

      However, apparently this only works for services which have an associated wsdl file provided by the developer (@WebService(wsdlLocation = "WEB-INF/...")) in the deployment. I would like to enable a similar behavior on services which have only the defining implementation class.

      Is it possible to associate to an @WebService class an external deployment descriptor which only specifies soap:address and/or other specific jaxws parameters, without having to explcitely create (and obviously maintain over time) the wsdlby hand?

       

      In general, I think that this scenario is not so uncommin, and it would be useful to have a parameter as suggested by @asoldano to simply enable rewriting of http:// into https://

      >If nothing of this helps, please create a feature request jira. We might think about adding another configuration option (webServiceProtocol) and achieve what you want throught that.