[ 
https://issues.apache.org/jira/browse/AXIS2-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666151#action_12666151
 ] 

Andreas Veithen commented on AXIS2-4219:
----------------------------------------

When using compressed SOAP requests, the Content-Type should remain "text/xml; 
charset=...", but the Content-Encoding header would be "gzip". If your .NET 
service requires you to set the Content-Type to "application/x-gzip", it is not 
a standard SOAP Web service.

> Overriding Content-Type HTTP Header Fails
> -----------------------------------------
>
>                 Key: AXIS2-4219
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4219
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Axis 1.4.1, adb, no atachments with request message
>            Reporter: naveen kvm
>            Priority: Blocker
>
> I need to override the Content-Type HTTP header value while sending gzip 
> request to .NET webservice.
> I am getting the following error:
> HTTP/1.1 415 Cannot process the message because the content type 'text/xml; 
> charset=UTF-8' was not the expected type 'application/x-gzip'.\r\n
> I am using SOAP 1.1 and HTTP 1.1.
> the .NET webservice expects the value of Content-Type header to be 
> application/x-gzip.
> I have added a new header for content type as follows in my code:
> this.addHttpHeader(_messageContext, "Content-Type","application/x-gzip");
> But now i am facing different exception from. NET webservice:
> <h1>Bad Request (Invalid Header Name)</h1>
> This is because the request message now contains 2 headers for Content-Type 
> with values as 'text/xml; charset=UTF-8'  and 'application/x-gzip'.
> I want to edit the content-type header and change it's value to 
> application/x-gzip.
> I have enabled g-zip support as follows in my stub class:
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.MC_ACCEPT_GZIP,
>                 Boolean.TRUE);
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.MC_GZIP_REQUEST,
>                 Boolean.TRUE);
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.MC_GZIP_RESPONSE,Boolean.TRUE);
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.COMPRESSION_GZIP,Boolean.TRUE);
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.FALSE);
>                 
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.HEADER_CONTENT_TYPE,"application/x-gzip");
> Plz help me to edit the value of Content-Type header in Axis2 1.4.1 ADB 
> generated stub or client while sending the request.
> Thanks in advance.
> Naveen.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to