You can initialize an endpoint by calling its constructor. The following code uses a constructor to create a URLEndpoint.
myEndpoint = new URLEndpoint("http://somehost/myServlet");