title: How to have a configurable @WebServiceRef(wsdlLocation
body: <p>I am having a maven build and project with a webservice client that will be deployed on a wildfly server.
  In my Client EJB, I have the following</p>
  
  <pre><code>@Stateless
  public class MyClientEJB {
  
      @WebServiceRef(wsdlLocation = "http://localhost:8080/HelloWorld/HelloWorldService?wsdl")
      private HelloWorldService service;
  </code></pre>
  
  <p>I want to have different url for Test and Production, how can I have this url as a configurable entry. I tried creating profiles in my pom.xml file but that requires following code and I don't know how to use it in @WebServiceRef annotation.</p>
  
  <pre><code>private void initProperties() {
      InputStream is = getClass().getClassLoader().getResourceAsStream("application.properties");
  
      if (is != null) {
          try {
              properties.load(is);
  
              BASE_URL = (String)properties.getProperty("student.restws.url");    
  
          } catch (IOException e) {               
              logger.error("Error when reading properties: ", e);
              throw new RuntimeException("Can not load application.properties file.");
          }
      } else {        
          logger.error("Error when finding application.properties.");
          throw new RuntimeException("Error when finding application.properties.");
      }
  } 
  </code></pre>
  
  <p>Any example would be appreciated. Thanks</p>
  
  <p>Update:</p>
  
  <p>I added wsdl folder under src/main/resources/META_INF and copied the wsdl file there.
  In the @WebServiceRef annotation then updated to
      @WebServiceRef(wsdlLocation = "META-INF/wsdl/HelloWorld.wsdl")</p>
  
  <p>But I get the following runtime error when webservice is invoked.</p>
  
  <pre><code>Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/HelloWorld.wsdl' not found for VirtualFile: "/C:/wildfly-8.1.0.Final/bin/content/hello-world.war"
  </code></pre>
  
  <p>wsdl file has the following defined:</p>
  
  <pre><code>&lt;wsdl:service name="HelloWorldService"&gt;
    &lt;wsdl:port name="HelloWorldPort" binding="tns:HelloWorldEndpointBinding" &gt;
      &lt;soap:address location="http://localhost:9090/HelloWorldPort"/&gt;
    &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  </code></pre>