Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 40 other subscribers
  • Archives

  • Categories

  • Stats

    • 426,575
  • Live Traffic

Archive for the ‘Web Services’ Category

Tips&Tricks: How to set web service url end point

Posted by Jai on October 11, 2013


A quick tip to change the url end point for a webservice. Keep the web service end point as configurable to be able to use it under different test/demo/live environments.

WebClientTestService service = new WebClientTestService() ;
String serviceEndPoint = "http://localhost/soap/testEndPoint";
Map<String, Object> context = ((BindingProvider)service).getRequestContext();
//Set service end point
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceEndPoint);

Keep the service end point etc. configurations as system property or pick from properties file to make it configuration in the system to be able to use different test/demo/live environment without changes the client code.

Posted in Java, Tips&Tricks, Web Services | Tagged: , | 1 Comment »

Java Application performance analysis and optimization using AppDynamics

Posted by Jai on December 11, 2012


The enterprise java application stack is growing bigger and bigger which makes it equally difficult to keep control on all the layers of the infrastructure to get maximum result out of it. One of the basic requirement of any web application is well performing, we will cover here an ideal enterprise java web application setup and see how to analyze and optimize the same using AppDynamics tool.

Java Enterprise web application N-tier set up

Take an example of below n-tier java web application interacting with complex middleware system, integrate with numerous external web api’s and equally powerful backend storage system.

enterprise_java_web_application_setup

enterprise_java_web_application_setup

The diagram covers quite common and complex enterprise application set up.

  • Web Servers (eg. Apache web server)
  • Application Servers (tomcat application server)
  • Mobile application server (tomcat application server)
  • Email Server
  • Web content management server (eg. Team Site, Alfresco)
  • Web application Administration server (tomcat application server)
  • File servers (Shared disk eg. NFS)
  • Real time/Messaging/Queue server (eg. ActiveMQ)
  • Data/File processing backend servers (tomcat application server)
  • Data storage/Database servers (eg. MySQL/Oracle)

Problem Context

Read the rest of this entry »

Posted in Architecture, Database, Hibernate, Java, Security, Spring, Web Services | Tagged: , , , , , | Leave a Comment »

Tips&Tricks: How to monitor and log soap messages

Posted by Jai on October 30, 2012


A quick tip to monitor and log soap messages. Most of the monitoring tools are kind of middle man to monitor the request-response between client and server. Now you can log the traffic to file and see how data is passing around.

Set the below system property,

com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

If you are running your client from application server eg. tomcat, you can set it as CATALINA_OPTS param.
Read the rest of this entry »

Posted in Java, Tips&Tricks, Web Services | Tagged: , , , , | 2 Comments »

Tips&Tricks: How to add soap header using JAX-WS RI

Posted by Jai on October 26, 2012


This post shares the tip how to add the soap header using jax-ws. One of the quick example could be web service authentication mechanism based on session id or some unique key based on soap headers in the request.

An example of how to do it using jax-ws, add-soap-header-object-using-pure-jax-ws

If you want to use jax-ws RI, adding_soap_header and jax-ws-adding-soap-headers

Read the rest of this entry »

Posted in Java, Tips&Tricks, Web Services | Tagged: , , , | 1 Comment »

Tips&Tricks: Configure Web service client to use wsdl location path as local file path

Posted by Jai on October 24, 2012


This post share how you can configure Web Service client to use wsdl file location as the local file instead of remote web service wsdl location path.

There are few ways to do the same, depending on which scenario will be fit for you.

Common approach of setting wsdl location, remote wsdl URI

If you generate web service code based on wsdl file, the below location is you local file or remote address.

public final static URL WSDL_LOCATION;
static {
        URL url = null;
        try {
            url = new URL("http://localhost:8080/trySomeWSDL.wsdl");
        } catch (MalformedURLException e) {
            java.util.logging.Logger.getLogger(WebServiceTestClient.class.getName())
                .log(java.util.logging.Level.INFO,
                     "Can not initialize the default wsdl from {0}", "http://localhost:8080/trySomeWSDL.wsdl");
        }
        WSDL_LOCATION = url;
    }

Read the rest of this entry »

Posted in Java, Tips&Tricks, Web Services | Tagged: , , | 3 Comments »