You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by "Kalcevich, Daniel" <dk...@firstam.com> on 2006/10/05 21:13:53 UTC

Protocol Exception

Hi,

I am trying to make an HTTP GET call with my code to the URL below, and
I am getting the error below.  I know that calls like this have worked
before using a URLConnection.  Any help is greatly appreciated.  Thanks.

Daniel

--------------
Exception:

com.firstam.rets.exception.RETSException:
org.apache.commons.httpclient.ProtocolException: The server
xxx.xxx.xxx.com failed to respond with a valid HTTP response
	at
com.firstam.rets.RETSService.searchMedia(RETSService.java:684)
	at
com.firstam.rets.RETSService.searchMedia(RETSService.java:616)
	at com.firstam.rets.RETSService.main(RETSService.java:920)
Caused by: org.apache.commons.httpclient.ProtocolException: The server
rets.socal.mlsrets.com failed to respond with a valid HTTP response
	at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBa
se.java:1846)
	at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase
.java:1590)
	at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java
:995)
	at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMe
thodDirector.java:397)
	at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho
dDirector.java:170)
	at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
96)
	at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
24)
	at
com.firstam.rets.RETSService.searchMedia(RETSService.java:670)
	... 2 more

-----------
Attempted Request:

http://xxx.xxx.xxx.com/RETS/Search?Format=COMPACT&SearchType=MEDIA&Query
=(MediaType=vt),(TABLEUID=95419541,95424559,95491869,95465383,95490663,9
5484223,95491672,95433334,95456632,95491762,95471474,95490504,95490480,9
5490579,95490153,95487096,95467556,95429266,95491592,95430889,95418037,9
5458115,95489022,95477134,95438567,95433846,95490056,95487900,95429661,9
5491763,95450303,95487297,95422020,95439302,95484132,95444379,95477459,9
5470115,95457524,95430182,95479117,95479519,95466624,95463473,95478666,9
5491892,95449362,95411819,95471072,95442487,95491298,95465573,95483712,9
5491696,95448713,95491916,95423290,95491664,95475607,95446019,95479858,9
5491928,95443703,95415148,95472730,95459875,95489932,95467077,95491426,9
5461731,95484939,95487876,95432710,95472359,95457989,95479679,95400346,9
5471009,95460403,95468059,95440607,95465740,95447754,95473480,95391961,9
5491905,95407769,95467947,95471175,95454300,95483339,95485832,95460563,9
5491412,95491406,95469119,95459161,95460886,95491755,95458282,95473712,9
5437870,95449033,95470612,95431350,95491931,95447378,95433804,95434016,9
5396577,95488612,95464468,95399568,95490655,95468711,95490226,95455567,9
5439638,95465032,95491932,95449142,95453083,95452432,95491223,95387739,9
5475455,95437709,95448580,95460703,95477630,95447444,95457068,95491210,9
5471637,95487312,95484257,95491255,95491949,95470943,95491087,95481110,9
5461001,95461271,95482504,95490469,95393736,95481035,95491915,95479173,9
5468079,95482607,95457270,95472685,95490510,95438854,95456474,95479448,9
5428727,95469404,95478400,95492001,95462041,95438223,95471093,95423048,9
5449689,95451574,95466647,95433478,95406387,95449594,95465198,95488790,9
5452406,95473424,95422508,95449791,95475200,95457199,95484095,95467715,9
5412622,95491358,95471945,95472699,95491974,95459859,95450880,95478815,9
5455263,95454441,95454895,95317697,95491574,95481439,95482559,95491703,9
5389268,95447906,95467753,95445077,95491453,95445977,95491398,95461801,9
5491998,95433625,95474871,95491860,95492032,95446299,95468797,95468761,9
5422722,95416869,95458993,95492020,95463130,95454721,95488252,95446861,9
5437797,95394573,95462260,95457871,95475129,95470382,95468646,95473255,9
5451146,95451369,95432467,95470743,95476877,95436663,95492019,95469734,9
5488358,95481977,95404389,95364723,95469712,95483091,95492029,95491610,9
5491818,95492038,95491960,95461682,95479158,95364070,95485865,95412699,9
5458222,95415269,95434120,95457092,95467336,95491239,95490605,95418267,9
5491089,95492014,95491831,95491946,95491827,95492048,95492050,95443366,9
5444786,95492059,95490985,95481886,95488575,95463345,95476422,95422304,9
5487371,95464338,95480672,95468890,95444120,95471626,95492068,95488095,9
5491796,95369554,95492042,95462449,95474052,95487051,95446556,95439750,9
5484663,95490900,95490640,95461443,95470808,95491911,95491821)&Limit=NON
E&QueryType=DMQL&Class=MEDIA&Select=MEDIASOURCE,TABLEUID



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Protocol Exception

Posted by Roland Weber <ht...@dubioso.net>.
Hello Daniel,

> com.firstam.rets.exception.RETSException:
> org.apache.commons.httpclient.ProtocolException: The server
> xxx.xxx.xxx.com failed to respond with a valid HTTP response

Please post a wire log, so we know what the HTTP server responds.
http://jakarta.apache.org/commons/httpclient/logging.html

Feel free to hide host names and passwords in the log. But
you should make sure to hide all occurrences and not just
the first one ;-)

> Caused by: org.apache.commons.httpclient.ProtocolException: The server
> [...].com failed to respond with a valid HTTP response

That query string you are using is bad. You really should
switch to a POST or PUT request and send the parameters
in the message body. That's what it's there for. RFC 2616
has a few words to say on URL length, for example in 3.2.1:

   The HTTP protocol does not place any a priori limit on the length of
   a URI. Servers MUST be able to handle the URI of any resource they
   serve, and SHOULD be able to handle URIs of unbounded length if they
   provide GET-based forms that could generate such URIs. A server
   SHOULD return 414 (Request-URI Too Long) status if a URI is longer
   than the server can handle (see section 10.4.15).

      Note: Servers ought to be cautious about depending on URI lengths
      above 255 bytes, because some older client or proxy
      implementations might not properly support these lengths.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org