I think I see the problem....
Your headers that are returning have:
location=[http://sapprd02:8060/sap/bc/srt/rfc/sap/z_steria_id_retur/100/z_steria_id_retur/z_steria_id_retur]
However, we are calling:
List<String> locs = headers.get("Location");
(notice the capital L) Thus, I'm pretty sure its not finding the new
location to redirect to. Relatively simple fix... We can loop through the
keyset doing an equalsIgnoreCase.
Dan
On Thursday 18 December 2008 3:59:39 am emilSverige wrote:
> Hi,
> I have a load balanced SAP web service residing.
> I have generated CXF java client code to connect to this service. It works
> fine if I connect directly to the service, but fails if I try to connect
> via the load balancer. I believe the server is responding with status 301,
> but I haven't been able to confirm that.
> I have set autoredirect=true, but nothing changes.
>
> How can I confirm that a response 301 is sent from the server? I see
> nothing about it in the logs. It looks like a 301 in the logs, but I would
> say it looks like it returns some HTML code instead. I tried debugging, but
> don't know where to look.
>
> This is the logs:
>
> 2008-dec-18 09:49:33 org.apache.cxf.transport.http.HTTPConduit prepare
> INFO: AutoRedirect is turned on.
> 2008-dec-18 09:49:33
> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> INFO: Outbound Message
> ---------------------------
> Encoding: UTF-8
> Headers: {Authorization=[Basic UElBUFBMVVNFUjpzYXA0Y29sbA==],
> SOAPAction=[""], Accept=[*]}
> Messages:
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:ZSte
>riaId
> xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-style"><IvId>16556636
>1159K97732</IvId></ns2:ZSteriaId></soap:Body></soap:Envelope>
> --------------------------------------
> 2008-dec-18 09:49:33 org.apache.cxf.interceptor.LoggingInInterceptor
> logging INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {content-type=[text/html; charset=utf-8], connection=[close],
> host=[sapcr:8160],
> location=[http://sapprd02:8060/sap/bc/srt/rfc/sap/z_steria_id_retur/100/z_s
>teria_id_retur/z_steria_id_retur], Content-Length=[325], server=[SAP Message
> Server, release 700 (PCR)], date=[Thu, 18 Dec 2008 08:49:33 GMT]}
> Messages:
> Message:
>
> Payload: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <HTML><HEAD>
> <TITLE>301 MOVED PERMANENTLY</TITLE>
> </HEAD><BODY>
> <H1>Moved Permanently</H1>
> The document has moved
> http://sapprd02:8060/sap/bc/srt/rfc/sap/z_steria_id_retur/100/z_steria_id_r
>etur/z_steria_id_retur here
> </BODY></HTML>
>
> --------------------------------------
> 2008-dec-18 09:49:33 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Response was of unexpected text/html
> ContentType. Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC
> "-//IETF//DTD HTML 2.0//EN">
> <HTML><HEAD>
> <TITLE>301 MOVED PERMANENTLY</TITLE>
> </HEAD><BODY>
> <H1>Moved Permanently</H1>
> The document has moved
> http://sapprd02:8060/sap/bc/srt/rfc/sap/z_steria_id_retur/100/z_steria_id_r
>etur/z_steria_id_retur here
> </BODY></HTML>
>
> at
> org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInIntercepto
>r.java:73) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:633) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>eInternal(HTTPConduit.java:2064) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>e(HTTPConduit.java:1942) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
>duit.java:1867) at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputSt
>ream.java:47) at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
>rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) at
> $Proxy41.zSteriaId(Unknown Source)
> at se.collectum.pki.utils.SteriaId2CrmId.convert(SteriaId2CrmId.java:53)
--
Daniel Kulp
[email protected]
http://dankulp.com/blog