Paŭlo Ebermann
Paŭlo Ebermann

Reputation: 74760

Providing Apache Axis with a socketfactory object, not class

In my current project, we are using Apache Axis to do remote calls via SOAP.

Now there are cases where the server host+port is not directly accessible due to firewall constraints, but there is the possibility of an SSH tunnel.

The Axis documentation mentions the possibility to plug in an own Socket factory. But this plugging in only seems to be possible by providing the name of an implementation class in a System property.

I just spent a hour or such to implement a SocketFactory (via a custom SocketImpl implementation) based on a JSch session - but this SocketFactory object is dependent on a Session object, and can't be simply instantiated independently.

I think I could somehow solve this using static variables/methods, but this certainly does not look nice.

Actually, I want to be able to provide a new SocketFactory (with another base SSH Session) for every server (or group of servers), of which might exist several at the same time - thus, it would be necessary to provide this to the ServiceLocator.

Is there some way to solve this?

Upvotes: 0

Views: 476

Answers (1)

h3xStream
h3xStream

Reputation: 6621

You could open a permanent tunnel. ssh -L1337:127.0.0.1:8080 192.168.0.x

and then connect to the local address (127.0.0.1:1337) as if it was remote.

Upvotes: 1

Related Questions