Monthly Archives: March 2015

How to enable HTTP raw log monitor in JBoss

How to enable HTTP raw log monitor in JBoss?


  1. Go to <JBOSS_SERVER_DIRECTORY>/deploy/jbossweb.sar/server.xml
  2. Uncomment Access logger<!– Access logger –><Valve className=”org.apache.catalina.valves.AccessLogValve”
    prefix=”localhost_access_log.” suffix=”.log”
    pattern=”common” directory=”${jboss.server.log.dir}”
    resolveHosts=”false” />

Secure wsdl client artifacts using wsimport and jax ws client

Q: How to create client artifacts (value objects and other service class methods etc) of secure resource (WSDL) using wsimport?

Solution: Use following command to generate artifacts in given directory. Make sure to put authFile.txt file at current path.

wsimport -keep -d <DirectoryName> -verbose -Xnocompile -Xauthfile authFile.txt <WSDL_URL>

Content of authFile.txt




Q: How to create JAX WS client where WSDL is secure and API is also secure? 

Solution: There will be authentication at two layers.

1) HTTP Layer
2) Method Layer (API)

Here is the sample.

public class JaxWsClientSample {

	// HTTP Authentication
	static { {

			protected getPasswordAuthentication() {
				return new"username",

	public static void main(String[] args) {

		// Create service object and get port
		// Note: TestBean_Service is service class that can be found in 
// generated client artifacts and name may be different in your case
		TestBean_Service service = new TestBean_Service();
		TestBean port = service.getTestBeanPort();

		//Use BindingProvider API to provide credentials for API security
		BindingProvider prov = (BindingProvider) port;
		Map<String, Object> reqCtx = prov.getRequestContext();

		// API credentials
		reqCtx.put(BindingProvider.USERNAME_PROPERTY, "username");
		reqCtx.put(BindingProvider.PASSWORD_PROPERTY, "password");

		// Invoke webservice method through port
		Response response = port.doSomething(request);