Hi,

Thank you for the response. I have resolved issue. Please find the code
below

 

 

Constructed custom binding class which extends DefaultRestletBinding and set
the ClientIno object into Restlet Request

public class customRestletBinding  extends DefaultRestletBinding{

      

      

      public void populateRestletRequestFromExchange(Request request,
Exchange exchange){

            

            ClientInfo clientInfo = new
ClientInfo(MediaType.APPLICATION_ALL_XML);

            request.setClientInfo(clientInfo);

            super.populateRestletRequestFromExchange(request, exchange);

 

      }

        

       

}

 

 

Regards,

Praveen Chakinala

 

 

 

From: William Tam [via Camel]
[mailto:ml-node+s465427n5698824...@n5.nabble.com] 
Sent: Thursday, May 10, 2012 4:47 AM
To: pchakinala
Subject: Re: camel restlet : Accept header

 

I opened a Jira https://issues.apache.org/jira/browse/CAMEL-5268 to 
track this issue. 

Thanks. 

On 05/08/2012 03:47 AM, pchakinala wrote: 


> Hi , 
>   We have restful service developed with CXF. Now we are planning to
consume 
> it using camel-restlet component. We are setting below headers to return 
> response message in XML format. 
> 
> Camel client  Processor code: 
> 
>   exchange.getIn().getHeaders().put("Content-Type", "application/xml"); 
>   exchange.getIn().getHeaders().put("Accept", "application/xml"); 
> 
> 
>   <to 
>
uri="restlet:http://localhost:8081/pss-ui-2.0.0/api/rest/pssrestservices/fin
dPartyById/{restParam}?restletMethod=get"/> 
> 
> However after setting the headers also we got response in json format 
> instead of xml. 
> 
> 
> Please update me  is there any other way to set the Accept parameter in
the 
> Restlet request header. 
> 
> Regards, 
> pchakinala 
> 
> -- 
> View this message in context:
http://camel.465427.n5.nabble.com/camel-restlet-Accept-header-tp5692917.html
> Sent from the Camel - Users mailing list archive at Nabble.com. 

 

  _____  

If you reply to this email, your message will be added to the discussion
below:

http://camel.465427.n5.nabble.com/camel-restlet-Accept-header-tp5692917p5698
824.html 

To unsubscribe from camel restlet : Accept header, click here
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscrib
e_by_code&node=5692917&code=cHJhdmVlbi5jaGFraW5hbGFAcGxhbmV0c29mdC5jb218NTY5
MjkxN3wtMjAwNDE3OTQwNg==> .
 
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_view
er&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNa
mespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.No
deNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_ema
ils%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML 



This message contains information that may be privileged or confidential and is 
the property of PlanetSoft Holdings Inc. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.

--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-restlet-Accept-header-tp5692917p5699199.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to