简体   繁体   中英

JAX-WS client authentication on proxy server

I'm trying to use JAX-WS api to send some soap messages on a client application. However, I'm behind a firewall and the only option is to use a proxy server to go outside.

I'm trying to find on google any answer about this and so far all fail: To Use System.setProperty for http.proxyHost , http.proxyPort , http.proxyUser , http.proxyPassword . To use Authenticator like is described here .

I'm running out of options, if someone could help me on this would be great.

Also, I have a option to use org.apache.commons.httpclient but then I need to generate manually the XML. So could you suggest any other approach or API for WS?

For Jax-ws webservice client, use the following

//set proxy info to the ClientProxyFeature
ClientProxyFeature cpf = new ClientProxyFeature();
cpf.setProxyHost("proxyhost");
cpf.setProxyPort(8888);
cpf.setProxyUserName("proxyuser");
cpf.setProxyPassword("proxypwd");

//get the port with the Feature
MyPort port = myService.getPort(cpf);

You can use ws import command when creating web client to configure proxy.

-httpproxy::

use above command to configure proxy.

How to do this depend on your IDE.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/rwbs_wsimport.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM