Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: empty response received

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default empty response received

    Hi Nikita Rybak,

    I am facing similar problem. from my application, i am sending GET request for an xml file to a UPNP device(a router). But response which is a INputStream is of size 0.

    Code used is:
    URLConnection uc = descriptionURL.openConnection();
    		    	uc.connect();
    		    	if (uc instanceof HttpURLConnection) {
    	                HttpURLConnection huc = (HttpURLConnection)uc;
    	                int statusCode = huc.getResponseCode();
    	                String statusMsg = huc.getResponseMessage();
     
    	                 if (logger.isDebugEnabled()) {
    	                    logger.debug("code="+statusCode+" msg="+statusMsg);
     
    	                    int i = 1;
    	                    String name = uc.getHeaderFieldKey(i);
     
    	                    while (name != null) {
     
    	                        if (logger.isDebugEnabled()) {
    	                            logger.debug("   " + name + ": " + uc.getHeaderField(name));
    	                        }
     
    	                        name = uc.getHeaderFieldKey(++i);
    	                    }
    	                }
     
    	                if (statusCode != 200) {
    	                    throw new IOException("code="+statusCode+" msg="+statusMsg);
    	                }
    	            } // end if
    	        	documentStream = uc.getInputStream();


    received InputStream size is 0 here. And headerInfo received is:
    code=200 msg=OK
    875247 [t Delivery Queue] DEBUG DeviceParser - CONTENT-LENGTH: 6263
    875247 [t Delivery Queue] DEBUG DeviceParser - CONTENT-TYPE: text/xml; charset="utf-8"
    875247 [t Delivery Queue] DEBUG DeviceParser - LAST-MODIFIED: Wed, 01 Jan 2003 01:01:18 GMT
    875247 [t Delivery Queue] DEBUG DeviceParser - DATE: Wed, 01 Jan 2003 01:01:18 GMT
    875247 [t Delivery Queue] DEBUG DeviceParser - SERVER: OpenRG/4.0.21.3.3.1.32.1.1.1.6 UPnP/1.0 SAGEM_LB/RG_VERSION
    875257 [t Delivery Queue] DEBUG DeviceParser - CONNECTION: close
    875257 [t Delivery Queue] INFO DeviceParser - documentStream : espial.net.misc.c@5dbaf9b size=0

    Please let me know you have any workaround or solution or reason for the same. port at which my application listen response, is getting valid xml. But this response is not recieved at application layer.

    Your help is most appreciated.

    Thanks
    Rashmi


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    490
    Thanks
    8
    Thanked 46 Times in 44 Posts

    Default Re: empty response received

    Cross posted
    empty response received - Java Forums

    And who's Nikita Rybak?

    db

    edit
    java.net Forums : empty response received ...
    java.net Forums : empty response received ...


    edit2
    empty response received (Sockets and Internet Protocols forum at JavaRanch) (and two other threads locked there)


    But I still don't know who Nikita Rybak is :-\


    empty response received | Java.net


    Sheesh
    empty response received | Java.net
    (resolved) empty response body in ajax (or 206 Partial Content) - Stack Overflow

    And now I know where the "Nikita Rybek" came from
    Last edited by Darryl.Burke; September 16th, 2010 at 06:09 PM. Reason: Found two more cross posts

Similar Threads

  1. Singleton pattern: the purpose of empty constructor
    By Asido in forum Java Theory & Questions
    Replies: 1
    Last Post: August 6th, 2010, 08:58 AM
  2. Problem with updating empty JTable
    By byubi in forum AWT / Java Swing
    Replies: 1
    Last Post: May 15th, 2010, 02:06 AM
  3. How to show empty directories in JTree ?
    By ni4ni in forum AWT / Java Swing
    Replies: 1
    Last Post: April 30th, 2010, 12:55 AM
  4. [SOLVED] Supressing empty lines and does not do until the end! Why ?
    By lumpy in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 18th, 2010, 06:38 AM
  5. Replies: 6
    Last Post: April 14th, 2009, 08:02 AM