/** * Clear the actual service endpoints in {@code description} and use {@code selectedEndpoint} instead of * actual endpoints. * * @param selectedEndpoint Endpoint which will replace the WSDL endpoints * @param description WSDL 2.0 description * @throws APIMgtWSDLException If an error occurred while updating endpoints */ private void updateEndpoints(String selectedEndpoint, Description description) throws APIMgtWSDLException { Service[] serviceMap = description.getServices(); for (Service svc : serviceMap) { Endpoint[] portMap = svc.getEndpoints(); for (Endpoint endpoint : portMap) { EndpointElement element = endpoint.toElement(); try { element.setAddress(new URI(selectedEndpoint)); } catch (URISyntaxException e) { throw new APIMgtWSDLException( "Error occurred while setting the wsdl address location as " + selectedEndpoint, e, ExceptionCodes.INTERNAL_WSDL_EXCEPTION); } } } }
/** * Clear the actual service endpoints in {@code description} and use {@code selectedEndpoint} instead of * actual endpoints. * * @param selectedEndpoint Endpoint which will replace the WSDL endpoints * @param description WSDL 2.0 description * @throws APIMgtWSDLException If an error occurred while updating endpoints */ private void updateEndpoints(String selectedEndpoint, Description description) throws APIMgtWSDLException { Service[] serviceMap = description.getServices(); for (Service svc : serviceMap) { Endpoint[] portMap = svc.getEndpoints(); for (Endpoint endpoint : portMap) { EndpointElement element = endpoint.toElement(); try { element.setAddress(new URI(selectedEndpoint)); } catch (URISyntaxException e) { throw new APIMgtWSDLException( "Error occurred while setting the wsdl address location as " + selectedEndpoint, e, ExceptionCodes.INTERNAL_WSDL_EXCEPTION); } } } }
endpoint.setAddress(getURI(address));
endpoint.setAddress(getURI(address));