Options options = serviceClient.getOptions();
HttpTransportProperties.ProxyProperties proxy =
    new HttpTransportProperties.ProxyProperties();
proxy.setProxyName("proxy.example");
proxy.setProxyPort(8080);
options.setProperty(HTTPConstants.PROXY, proxy);

Run this before invoking the operation on the same serviceClient. For a generated stub, obtain it with _getServiceClient(). Reusing its existing Options preserves endpoint and operation settings that a new empty object could discard.

This uses Axis2 1.8.x's org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties. Replace the proxy host and integer port; for a permitted public-service test, select an HTTP candidate from the HTTP proxy list. For authentication, the same object exposes setUserName and setPassWord; supply them from application credential configuration rather than the SOAP service account.

The runtime HTTPConstants.PROXY property overrides deployment proxy defaults in axis2.xml, making it suitable for a deliberately different route on one client.

Match the API and HTTP sender to the application. Newer Axis2 transport documentation describes an HttpClient 5 sender; those imports do not replace this 1.8.x interface. The chosen transport must also support the proxy's required authentication scheme.

Artiglyn mynjee