3 Replies Latest reply on Jan 25, 2013 11:39 AM by davsclaus

    Invalid query exception while setting HTTP_QUERY header

    jeevankumart

      Hi,

       

         I am trying to set the HTTP query parameters using "Exchange.HTTP_QUERY" header before calling the http URI.

       

         But i am getting an exception (Invalid query) if the property value is having spaces. In my case ${property.address} contains spaces/some special characters. If i remove the spaces, then it worked.

       

         Is there a way to avoid the exception?

       

       

      <setHeader headerName="Exchange.HTTP_QUERY">                   <simple>cust_id=${property.custId}&amp;cust_name=${property.custName}&amp;address=${property.address}</simple>
      </setHeader>
      
      <to uri="https://hostname:443/services"></to>
      
      
      camel-core - 2.10.0.fuse-71-047 | Failed delivery for (MessageId: queue_PasTestQueue_ID_vzsjcsebd02-33842-1359090854718-1_10_1_1_2 on ExchangeId: ID-vzsjcsebd01-33908-1359091496990-44-2). Exhausted after delivery attempt: 1 caught: org.apache.commons.httpclient.URIException: Invalid query
      org.apache.commons.httpclient.URIException: Invalid query
              at org.apache.commons.httpclient.URI.parseUriReference(URI.java:2049)[238:org.apache.servicemix.bundles.commons-httpclient:3.1.0.7]
              at org.apache.commons.httpclient.URI.<init>(URI.java:147)[238:org.apache.servicemix.bundles.commons-httpclient:3.1.0.7]
              at org.apache.commons.httpclient.HttpMethodBase.getURI(HttpMethodBase.java:265)[238:org.apache.servicemix.bundles.commons-httpclient:3.1.0.7]