You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bianca Schober <bs...@mhp.de> on 2006/12/12 17:30:18 UTC

How can I tell a Webservice Client to use the company's proxy?

Hello,
 
I am trying to use a Webservice like in the samples of Axis, see below.
I am getting a connection time out and I think it's because of the firewall of my company.
 
How can I configure the call so that it knows the name of the proxy we use?
 
Thanx a lot for help!!!
 
Cheers,
Bianca
 
package samples.userguide.example1;

import org.apache.axis.client.Call;

import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient

{

public static void main(String [] args) {

try {

String endpoint = 

"http://nagoya.apache.org:5049/axis/services/echo";

Service service = new Service();

Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("http://soapinterop.org/", "echoString") );

String ret = (String) call.invoke( new Object[] { "Hello!" } );

System.out.println("Sent 'Hello!', got '" + ret + "'");

} catch (Exception e) {

System.err.println(e.toString());

}

}

}


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: How can I tell a Webservice Client to use the company's proxy?

Posted by Nirmish Dholakia <ni...@c-sam.co.in>.
Hi Bianca,

Just add your proxy server and port in system propertry as below.

System.setProperty("http.proxyHost", ”YOUR_PROXY_HOST"); 
System.setProperty("http.proxyPort", ”YOUR_PROXY_HOST_PORT");  



-----Original Message-----
From: Bianca Schober [mailto:bschober@mhp.de] 
Sent: Tuesday, December 12, 2006 10:00 PM
To: axis-user@ws.apache.org
Subject: How can I tell a Webservice Client to use the company's proxy?

Hello,
 
I am trying to use a Webservice like in the samples of Axis, see below.
I am getting a connection time out and I think it's because of the firewall
of my company.
 
How can I configure the call so that it knows the name of the proxy we use?
 
Thanx a lot for help!!!
 
Cheers,
Bianca
 
package samples.userguide.example1;

import org.apache.axis.client.Call;

import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient

{

public static void main(String [] args) {

try {

String endpoint = 

"http://nagoya.apache.org:5049/axis/services/echo";

Service service = new Service();

Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("http://soapinterop.org/", "echoString") );

String ret = (String) call.invoke( new Object[] { "Hello!" } );

System.out.println("Sent 'Hello!', got '" + ret + "'");

} catch (Exception e) {

System.err.println(e.toString());

}

}

}


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/579 - Release Date: 12/7/2006
1:31 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/579 - Release Date: 12/7/2006
1:31 PM
 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org