[jira] [Updated] (CXF-8214) CLONE - no content length in http header

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (CXF-8214) CLONE - no content length in http header

Ivan Topić (Jira)

     [ https://issues.apache.org/jira/browse/CXF-8214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Topić updated CXF-8214:
----------------------------
    Description:
We are using *org.apache.cxf.jaxrs.client.WebClient* in our solution where we send a list of custom headers. 

All but "Content-Length" are included and sent. 

Issue exisit in *org.apache.cxf:cxf-rt-rs-client* package, both *3.3.4* and *3.3.5* versions. 

 

Partial code:

Map<String, Object> headers;

...

...

...
Client client = WebClient.client(api);
if (headers != null)
    headers.forEach(client::header);

 

  was:
Even if I disabled the chunking, no content length field is added to http header.

here the code for disable chunking
        Client client = ClientProxy.getClient(as);
        HTTPConduit http = (HTTPConduit) client.getConduit();

        //Turn off chunking so that NTLM can occur      
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
        httpClientPolicy.setConnectionTimeout(36000);
        httpClientPolicy.setAllowChunking(false);
        http.setClient(httpClientPolicy);

here the logs:
03.02.10-18:24:02,922 [main] DEBUG phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor@54a5f709
03.02.10-18:24:02,923 [main] DEBUG phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.StaxOutInterceptor$StaxOutEndingInterceptor@4f4a1ab7
03.02.10-18:24:02,923 [main] DEBUG phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor@fa5e4e4
03.02.10-18:24:02,924 [main] INFO  interceptor.LoggingOutInterceptor - Outbound Message
---------------------------
ID: 1
Address: http://yule.prov.bz:8090/DPA/DpaService.svc?wsdl
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=["http://www.dpa.com/AuthenticationService/Login"], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">......
--------------------------------------
03.02.10-18:24:02,925 [main] DEBUG http.HTTPConduit - Response Code: 411 Conduit: {http://www.dpa.com}AuthenticationServicePort.http-conduit
03.02.10-18:24:02,925 [main] DEBUG http.HTTPConduit - Content length: 24
03.02.10-18:24:02,925 [main] DEBUG http.HTTPConduit - Header fields:
    null: [HTTP/1.1 411 Length Required]
    Date: [Wed, 03 Feb 2010 17:24:03 GMT]
    Content-Length: [24]
    Content-Type: [text/html]
    Connection: [close]
....


javax.xml.ws.soap.SOAPFaultException: Response was of unexpected text/html ContentType.  Incoming portion of HTML stream: <h1>Length Required</h1>
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
        at $Proxy59.login(Unknown Source)
        at it.bz.prov.egov.test.cxf.security.documentale.DocSecuredCxf.main(DocSecuredCxf.java:140)


> CLONE - no content length in http header
> ----------------------------------------
>
>                 Key: CXF-8214
>                 URL: https://issues.apache.org/jira/browse/CXF-8214
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>         Environment: invoking .net (wcf) ws  deployed on iis
>            Reporter: Ivan Topić
>            Priority: Major
>             Fix For: Invalid
>
>
> We are using *org.apache.cxf.jaxrs.client.WebClient* in our solution where we send a list of custom headers. 
> All but "Content-Length" are included and sent. 
> Issue exisit in *org.apache.cxf:cxf-rt-rs-client* package, both *3.3.4* and *3.3.5* versions. 
>  
> Partial code:
> Map<String, Object> headers;
> ...
> ...
> ...
> Client client = WebClient.client(api);
> if (headers != null)
>     headers.forEach(client::header);
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)