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:ZSteriaId
xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-style"><IvId>165566361159K97732</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_steria_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_retur/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_retur/z_steria_id_retur
 
here 
</BODY></HTML>

        at
org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:73)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:633)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2064)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1942)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1867)
        at
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.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$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.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)
-- 
View this message in context: 
http://www.nabble.com/Client-doesn%27t-follow-redirect-tp21069032p21069032.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to