java - How to identify application that calls web service -


I have a Java servlet application with 6 web services and one web requests, I have to determine whether it is live or tested, by calling the web service example I believe that I can set it up with the URL, I.e.

  https: // localhost: 8443 / projectname / etc  

or

  https: // localhost: 8443 / projectnameTEST / etc  

I'm trying to get it by using HttpServletRequest and I know that I have a type of How do Ia is to call the designated Web service "getDocument" But I started to HttpServletRequest inside GetDocument? In this way how can I create a parameter "request" in the getDocument web service and have it started for request information?

  Public Zero doGet (HttpServletRequest request, HttpServletResponse response) throws exceptions ... stringbuffer url = request.getRequestURL (); ...}  

You can retrieve client information, for example:

  @WebService () public class SomeWebService {... @resource Personal WebServiceContext wsc; ... @WebMethod Public Zero FactorOffWebService () {Message Contestex MC = wsc.getMessageContext (); // Retrieve client information HttpServletRequest httpServletRequest = (HttpServletRequest) mc.get (MessageContext.SERVLET_REQUEST); Println (httpServletRequest.getServletContext () getContextPath ().); ...}}  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -