I am creating a web service that needs to register on another server by sending my wsdl url to that server.
I built a very simple web service in Netbeans,
@WebService
public class RegisterTest{
@WebMethod(operationName = "emphasize")
public String emphasize(@WebParam(name = "inputStr") String input){
return input + "!!!";
}
}
and Netbeans automatically directs me to localhost: 8080 / RegisterTest / RegisterTestService? Tester, and of course wsdl can be found in localhost: 8080 / RegisterTest / RegisterTestService? wsdl.
How to get this URL programmatically?
Edit: I noticed that the only place that seems to store this URL is the Glassfish server itself. The context root seems to be found only in glassfish / domain // config / domain.xml. Is there a good way to access Glassfish APIs? I can easily get the endpoint address through the user interface in applications> serviceName> View Endpoint, is there a programmatic way to do this? I tried looking at asadmin commands but cannot find anything there that has a context url or a final url.
source
share