Package java.net

Examples of java.net.HttpURLConnection.connect()


    }

    /** {@inheritDoc} */
    public InConnection getInbound() throws IOException, WsConfigurationException {
        HttpURLConnection connection = (HttpURLConnection)m_url.openConnection();
        connection.connect();
        return createInConnection(connection);
    }

    /** {@inheritDoc} */
    public OutConnection getOutbound(MessageProperties properties, XmlOptions xmlOptions) throws IOException,
View Full Code Here


    public OutConnection getOutbound(MessageProperties properties, XmlOptions xmlOptions) throws IOException,
            WsConfigurationException {
        HttpURLConnection connection = (HttpURLConnection)m_url.openConnection();
        connection.setDoInput(false);
        setupOutput(connection, properties);
        connection.connect();
        return createOutConnection(connection, properties, xmlOptions);
    }

    /** {@inheritDoc} */
    public DuplexConnection getDuplex(MessageProperties properties, XmlOptions xmlOptions) throws IOException,
View Full Code Here

    public DuplexConnection getDuplex(MessageProperties properties, XmlOptions xmlOptions) throws IOException,
            WsConfigurationException {
        HttpURLConnection connection = (HttpURLConnection)m_url.openConnection();
        connection.setDoInput(true);
        setupOutput(connection, properties);
        connection.connect();
        return new SimpleDuplexConnection(createInConnection(connection),
            createOutConnection(connection, properties, xmlOptions));
    }
   
    private HttpInConnection createInConnection(HttpURLConnection connection) throws WsConfigurationException {
View Full Code Here

      url = (URL)http_properties.get( ClientIDGenerator.PR_URL );
     
    
      HttpURLConnection con = (HttpURLConnection)url.openConnection();
     
      con.connect();
     
      ByteArrayOutputStream message = new ByteArrayOutputStream();
      InputStream is = con.getInputStream();
     
      byte[] data = new byte[ 1024 ];
View Full Code Here

      URL url = new URL(source.getURIRef());
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setInstanceFollowRedirects(false);
      connection.addRequestProperty(HeaderName.ACCEPT.toString(), "application/rdf+xml; q=1, application/xml; q=.9, text/xml; q=.8, */*; q=.1");
      connection.setReadTimeout(3000);
      connection.connect();
      int responseCode = connection.getResponseCode();
      if (responseCode != 200) {
        log.info("Response code: "+connection.getResponseCode());
        if ((responseCode >= 300) && (responseCode < 400)) {
          String location = connection.getHeaderField(HeaderName.LOCATION.toString());
View Full Code Here

        conn.setRequestMethod("GET");
        conn.setInstanceFollowRedirects(true);
        if (acceptLanguage != null) {
            conn.setRequestProperty("accept-language", acceptLanguage);
        }
        conn.connect();
        int code = conn.getResponseCode();
        contentType = conn.getContentType();
        if (code != HttpURLConnection.HTTP_OK) {
            throw new IOException("Result code: " + code);
        }
View Full Code Here

        conn.setUseCaches(false);
        conn.setRequestMethod("POST");
        conn.setRequestProperty("Connection", "Keep-Alive");
        String boundary = UUID.randomUUID().toString();
        conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);
        conn.connect();
        DataOutputStream out = new DataOutputStream(conn.getOutputStream());
        out.writeBytes("--" + boundary + "--\r\n");
        out.writeBytes("Content-Disposition: form-data; name=\"upload\";"
                + " filename=\"" + fileName +"\"\r\n\r\n");
        IOUtils.copyAndCloseInput(in, out);
View Full Code Here

      }
      http.setRequestMethod("GET");
      http.setDoOutput(true);
      http.setReadTimeout(httpHost.getTimeout());

      http.connect();

      String httpResponseCode = "" + http.getResponseCode();
      if(httpResponseCode.equals(httpHost.getHttpStatusCode())==false) {
        logger.fine("StatusCode does not match.. got "+httpResponseCode+
            ", expected: "+httpHost.getHttpStatusCode());
View Full Code Here

          if ( time_remaining > 0 ){
           
            Java15Utils.setConnectTimeout( connection, time_remaining );
          }
               
          connection.connect();
       
          time_remaining  = listener.getPermittedTime();
                   
          if ( time_remaining < 0 ){
           
View Full Code Here

        if ( time_remaining > 0 ){
         
          Java15Utils.setConnectTimeout( connection, time_remaining );
        }
             
        connection.connect();
     
        time_remaining  = listener.getPermittedTime();
                 
        if ( time_remaining < 0 ){
         
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.