开发者

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 开发者_Python百科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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜