this.hints = hints; setupSpecifications();
/** * Set up the specifications used and retrieve the Capabilities document * given by serverURL. * * @param serverURL a URL that points to the capabilities document of a server * @throws IOException if there is an error communicating with the server * @throws ServiceException if the server responds with an error */ public AbstractOpenWebService( final URL serverURL ) throws IOException, ServiceException { if (serverURL == null) { throw new NullPointerException("ServerURL cannot be null"); } this.serverURL = serverURL; setupSpecifications(); capabilities = negotiateVersion(); if (capabilities == null) { throw new ServiceException("Unable to retrieve or parse Capabilities document."); } }
public AbstractOpenWebService(Capabilities capabilties, URL serverURL) { if (capabilties == null) { throw new NullPointerException("Capabilities cannot be null."); } if (serverURL == null) { throw new NullPointerException("ServerURL cannot be null"); } setupSpecifications(); for (int i = 0; i < specs.length; i++) { if (specs[i].getVersion().equals(capabilties.getVersion())) { specification = specs[i]; break; } } if (specification == null) { specification = specs[specs.length-1]; LOGGER.warning("Unable to choose a specification based on cached capabilities. " +"Arbitrarily choosing spec '"+specification.getVersion()+"'."); } this.serverURL = serverURL; this.capabilities = capabilties; }
this.httpClient = httpClient; setupSpecifications();