3 Replies Latest reply on Nov 8, 2011 2:44 AM by Richard Opalka

    How to configure a service-ref in the environment?

    Maarten Winkels Newbie

      Hi,

       

      I'm building an application that uses both internal and external webservices. This application is based on JAX-WS and is using @WebServiceRef to inject references to webservices. The location of the WSDL for the endoints are configured in th web.xml using a service-ref element. This is working great.

       

      The location of the webservices, however, differs per deployment environment. My question is how to make the endpoint (WSDL) location configurable per location. To me this seems very similar to defining a JDBC or any other resource: The application uses anamed resource that is configured in the container. I'm not finding the functionality to do this in JBoss 7, however.

       

      I have been trying a number of options:

      - Use a system property in the web.xml like  <wsdl-file>${some.property}?wsdl</wsdl-file>. This does not seem to work.

      This doesn't seem to work.

      - Use a jboss-web.xml and do property override there.

      I haven't tried this yet, but looking at the source code that parses the jboss-web.xml I see nothing that will inject system properties

      - Configure the service-ref in Global JNDI.

      According to the spec the mappedName property of the @WebServiceRef annotation should link it to a globally defined resource. I cannot find a way to define global JNDI entries in JBoss AS 7, let alone configure a WebServcice EndPoint.

      - Use jUDDI for web service registration and lookup.

      I'm a little bit hesitant to use another product to connect the dots. Is this the only possible solution?

       

      Can anyone point me in the right direction?

       

      Thanks!

      -Maarten Winkels