I've been looking through the Axis2 code and found this class:
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SOAPMessageFormatter.java

Is this where the contentType is set for Rest clients? It contains the code:

if (encoding != null && contentType != null &&
                
contentType.indexOf(HTTPConstants.MEDIA_TYPE_MULTIPART_RELATED)==-1) {
             contentType += "; charset=" + encoding;

Suggesting that if the encoding is null it won't append the charset. However
regardless of that the default charset is applied here:
org/apache/axis2/transport/TransportUtils.java

Is there any way around this? I've tried adding custom headers in the hope
of overwriting the existing content-type, however it simply adds the header
again.



Film Noir wrote:
> 
> Greetings,
> 
> I'm trying to create a client which can access the MultiMap webservice:
> http://www.multimap.com/apidocs/1.2/web_service/ws_geocoding.htm
> 
> However, I'm having trouble creating a Rest client that can access it.
> This is my client code:
> 
> ------------
> Options options = new Options();
> options.setTo(new EndpointReference(toEpr));
> 
> options.setProperty(Constants.Configuration.ENABLE_REST,
> Constants.VALUE_TRUE);
> options.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,
> Constants.VALUE_TRUE);
> options.setProperty(Constants.Configuration.HTTP_METHOD,
> Constants.Configuration.HTTP_METHOD_GET);
> 
> ServiceClient sender = new ServiceClient();
> sender.setOptions(options);
> OMElement result = sender.sendReceive(getPayload());
> -------
> 
> This is generating the following HTTP request:
> 
> GET /API/geocode/[myid]?countryCode=IE&city=Cork HTTP/1.1
> Content-Type: application/x-www-form-urlencoded; charset=utf-8
> SOAPAction: ""
> User-Agent: Axis2
> Host: localhost:8090
> 
> But the service isn't having it and returns a:
> MM_API_UNSUPPORTED_REQUEST_TYPE
> 
> If I remove the 'charset=UTF-8', using TCP Monitor, and resubmit it works
> correctly. (so that Content-Type is 'Content-Type:
> application/x-www-form-urlencoded')
> 
> Is it possible to disable that specific http header so that Axis2 won't
> generate it?
> 
> Regards,
> 

-- 
View this message in context: 
http://www.nabble.com/Diabling-HTTP-Headers-tp20639004p20659243.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to