aspose file tools*
The moose likes Web Services and the fly likes Webservice client trough HTTP Proxy on Websphere 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice client trough HTTP Proxy on Websphere 6.0" Watch "Webservice client trough HTTP Proxy on Websphere 6.0" New topic
Author

Webservice client trough HTTP Proxy on Websphere 6.0

Mieza del Val
Greenhorn

Joined: Jul 04, 2008
Posts: 1
We are stucked trying to connect to a Webservice trough a HTTP Proxy.
We are deploying the application on Websphere 6.0 and we are using this
code:

package es.stl.gpm.request.soap;

import java.util.Properties;

import javax.naming.InitialContext;
import javax.xml.rpc.Stub;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;

import com.ibm.etools.j2ee.common.QName; import com.ibm.ws.webservices.engine.client.Service;

import com.ibm.wsspi.webservices.Constants;

public class ConexionSOAPThread extends Thread{

/**
* Atributo que representa la conexi�n.
*/
private SOAPConnection _connection;

private SOAPMessage peticion;

/**
* Direcci�n del destino
*/
private String _endpoint;

private SOAPMessage respuesta;

protected void setEndpoint(String _endpoint) {
this._endpoint = _endpoint;
}

protected void setPeticion(SOAPMessage peticion) {
this.peticion = peticion;
}

// This method is called when the thread runs
public void run()
{
try {

System.out.println("Before call");

((Stub)_connection)._setProperty(Constants.HTTP_PROXYHOST_PROPERTY,"proxyhost");


((Stub)_connection)._setProperty(Constants.HTTP_PROXYPORT_PROPERTY,"8080");


((Stub)_connection)._setProperty(Constants.HTTPS_PROXYHOST_PROPERTY,"proxyhost");


((Stub)_connection)._setProperty(Constants.HTTPS_PROXYPORT_PROPERTY,"8080");


respuesta = _connection.call(peticion,_endpoint);
System.out.println("After call");

} catch (SOAPException e) {
e.printStackTrace();
}
catch (Throwable e) {
e.printStackTrace();
};


}

public void setConnection(SOAPConnection _connection) {
this._connection = _connection;
}

public SOAPMessage getRespuesta() {
return respuesta;
}

}

We can't use anymore System.properties to set the proxy and the port due a customer petition.

Same code without the stub._setProperty work correctly setting the same HttpProxy and port values on System.properties.

Thanks in advance for your help!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Webservice client trough HTTP Proxy on Websphere 6.0