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

naveen kvm commented on AXIS2-4219:
-----------------------------------

Andreas. Thanks for your response. Currently there is a .NET client for the 
.NET webservice. The .NET client sends Content-Type and Media-Type as 
"application/x-gzip". But when i try to invoke the webservice from my axis 
1.4.1 ADB client, the .NET webservice is giving exception saying "Content-Type 
"text/xml" is not the expected type "application/x-gzip"". As of now, there are 
no java clients that were able to send and receive data from this .NET 
webservice.  When i am sending the request, i am using the generated adb stub.
It is preparing envelope as follows:

org.apache.axis2.client.OperationClient _operationClient = 
_serviceClient.createClient(_operations[2].getName());

env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
                                                    documentRequest4,
                                                    optimizeContent(new 
javax.xml.namespace.QName("http://www.xyz.com/att/agent/server";,
                                                    "DocumentRequest")));

_serviceClient.addHeadersToEnvelope(env);
        // set the message context with that soap envelope
        _messageContext.setEnvelope(env);

        // add the message contxt to the operation client
        _operationClient.addMessageContext(_messageContext);

        //execute the operation client
        _operationClient.execute(true);

I have captured the request message.


It is as follows:

Content-Type: text/xml; charset=UTF-8\r\n
SOAPAction: 
"http://www.xyz.com/att/agent/server/ClientManagement/DocumentRequest"\r\n
Host: 132.126.123.138:8080\r\n
Accept-Encoding: gzip\r\n
Content-Encoding: gzip\r\n

Content-encoded entity body (gzip): 411 bytes

This content-encoded body is containing my soap request xml.

I am checking the possibility on the .NET webservice side to extract the 
content-encoding of my request and then send a response.

Also i want to know about any way through which we can send the request as 
non-soap gzip encoded message instead of soap xml using the adb generated stub.

Thanks for your help.




> 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