How to set an AxisProperty so it affects only one service and not the others (axis 1.4)

StackOverflow https://stackoverflow.com/questions/21312949

  •  01-10-2022
  •  | 
  •  

Pergunta

I have 3 auto-generated soap services generated with Axis 1.4

I would like to set a proxy property only for one of them: AxisProperties.setProperty("https.proxyHost",<some_host>)

However it looks like these properties are shared across all services under the same class loader

I cannot use the "https.nonProxyHost" since the hosts are dynamic

Thanks in advance...

Foi útil?

Solução

After theral investigation I came to a conclusion that this cannot be done on AXIS 1.4:

  1. Axis 1.4 has a bug: problem with http proxy parameters caching mechanism

    Basically, Axis 1.4 turns to a class called “DefaultHTTPSTransportClientProperties“ that acts as cache: If proxy host is null it will populate the host (in the cache) as an empty string. The bug is that after the cache was set once, it cannot change.

  2. On later versions of AXIS it is possible to setup different proxies:

    • AxisProperty uses the thread class loader hierarchy to deside which properties to use
    • If you want a specific property you should create your own class loader
    • Then spawn a thread on that class loader and instantiate AxisProperties with specific proxy settings
    • Now run the service from that thread and you will have specific properties for that class loader
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top