Code example for URLConnection

Methods: setConnectTimeout, setReadTimeout, setRequestProperty

0
                connection = url.openConnection();
            } catch (IOException e) {
                throw new CGException("Could not open the URL connection", e);
            } 
        } 
        connection.setReadTimeout(getReadTimeout());
        connection.setConnectTimeout(getConnectTimeout());
        connection.setRequestProperty("Connection", "close"); // if http is being used
        return connection;
    } 
     
    public static OMElement getWSDLElement(String wsdlLocation) throws CGException {
        OMNode wsdNode = getOMElementFromURI(wsdlLocation);
        OMElement wsdlElement;
        if (wsdNode instanceof OMElement) {
            wsdlElement = (OMElement) wsdNode;
            String asString = wsdlElement.toString();
        } else { 
            throw new CGException("Invalid instance type detected when parsing the WSDL '" + 
                                   wsdlLocation + "'. Required OMElement type!");
        }