Monday, September 22, 2008

Jars required for jboss ejb client

set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-aop-jdk50-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-aspect-jdk50-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-ejb3-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-ejb3x.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jbossall-client.ja



Jars required for jaxws ws client

set CLASSPATH=%CLASSPATH%;.\jaxws\FastInfoset.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\activation.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\http.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-impl.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-xjc.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-rt.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-tools.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr173_api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr181-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr250-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\resolver.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\saaj-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\saaj-impl.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\sjsxp.jar


set CLASSPATH=%CLASSPATH%;%JBOSS_DIR%\lib\endorsed\xercesImpl.jar
Adding basic authentication to ws client

JAXWS

TriprequestService service = new TriprequestService();
Triprequest port = service.getTriprequestPort();
BindingProvider bp = (BindingProvider) port;
Map map = bp.getRequestContext();
map.put(BindingProvider.USERNAME_PROPERTY, "shafiek1");
map.put(BindingProvider.PASSWORD_PROPERTY, "password");
map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://qapo:8888/trex-pn/triprequest");


JAXRPC

stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,
username);
stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,
password);