cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: How to handle unexpected text/html ContentType in Response
Date Mon, 22 Feb 2010 22:31:39 GMT
On Sun February 21 2010 9:48:49 am SaravananRamamoorthy wrote:
> Hi Dan,
> 
> Can we get html mime headers using the interceptor? If it so could you
> please send some links on the same.

Well, the easy thing to do is do:

Map<String, List<String>> reqHeaders = 
(Map)message.get(Message.PROTOCOL_HEADERS));

And then look in the Map.   All the headers should be in there.

Dan


> 
> Regards
> Saravanan
> 
> SaravananRamamoorthy wrote:
> > Hi Dan,
> > 
> > There is an webseal layer before processing the webservice. So the
> > unauthorized html streaming returned from the webseal.
> > 
> > Regards
> > Saravanan
> > 
> > dkulp wrote:
> >> Sounds like a very poorly implemented webservice that isn't adhering to
> >> specs.
> >> 
> >> :-(
> >> 
> >> My only thought is to write an interceptor that would "process" the html
> >> page
> >> into something a bit more tolerable.
> >> 
> >> Dan
> >> 
> >> On Wed February 17 2010 3:20:03 am SaravananRamamoorthy wrote:
> >>> Hi All,
> >>> 
> >>> I have created a webservice client using cxf. The Webservice requires
> >>> Http
> >>> Basic Authentication.If we pass the correct credentials it retrieves
> >>> the result as a string.
> >>> 
> >>> If the credentials are incorrect , then the webservice returns a html
> >>> page
> >>> that shows the some unauthorized details where the actual response for
> >>> the
> >>> webservice is a string.
> >>> 
> >>> Ex:
> >>> String result = port.someOperation(parameters...)
> >>> 
> >>> Could anyone suggest that how to retrieve the unauthorized status from
> >>> the
> >>> html response.
> >>> 
> >>> I do not use any spring stuff.
> >>> I have used HTTPConduit to disable streaming.
> >>> 
> >>> 		Client client = ClientProxy.getClient(port);
> >>> 		HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
> >>> 		
> >>> 		HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> >>> 		httpClientPolicy.setAllowChunking(false);
> >>> 		httpConduit.setClient(httpClientPolicy);
> >>> 
> >>> Am I missing something?
> >>> 
> >>> Regards
> >>> Saravanan Ramamoorthy

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message