adobina
adobina

Reputation: 23

How to set Axis2 Web Service Client configuration using axis2.xml?

The documentation for Axis2 mentions axis2.xml file for configuration transport settings. However I could not seem to set transport type from HTTP/1.1 to HTTP/1.0 without chunking. I have put axis2.xml file in the classpath, in the same directory but no luck. Where should I put this configuration file in order to change the transport settings?

Upvotes: 1

Views: 5497

Answers (2)

Amila Suriarachchi
Amila Suriarachchi

Reputation: 1238

you should be able to create a configuration context from the axis2.xml and set it as given above. But your requirement is just to use http 1.0 you can do that like this as well.

serviceClient.getOptions().setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_10);

Upvotes: 0

stjohnroe
stjohnroe

Reputation: 3206

I believe that the axis2.xml file location can specified as a jvm property parameter:

java MyApp -Daxis2.xml="location of axis2.xml"

or by creating a ConfigurationContext using a ConfigurationContextFactory and passing this to the ServiceClient constructor

Upvotes: 2

Related Questions