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

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

I definitely recommend that you make the people who implemented the .NET 
service aware of the fact that no standard tool (Web service framework, ESB, 
BPEL engine, test tool, etc.) will ever be able out of the box to consume their 
service and that you convince them to make it standards compliant.

> 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