To use the Whois WebService , you need to know which client-side technology you are going to use.
For a quick start, you can use any SOAP testing tool to get a quick overview of what type of information Whois-WS is providing and how the request works. With SOAPUI, you can set up auto-created example requests in no time:

If you would like to access the Whois-WS from within your Java application, and if you can make use of the Spring Framework , you are probably going to use the Spring-WS client template WebServiceTemplate .
Add Spring-WS dependency to your pom.xml:
<dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-core</artifactId> <version>1.0.3</version> </dependency>
Then you can use the WebServiceTemplate class. Build your SOAP request body, configure the WebServiceTemplate and send the request. Please note that we're using a custom HttpUrlConnectionMessageSender to add a missing HTTP Header (SOAPAction):
// import org.springframework.ws.client.core.WebServiceTemplate;
final StringBuilder wsRequest = new StringBuilder();
wsRequest.append("<whois:WhoisRequest xmlns:whois=\"http://www.smartwerkz.com/whois/\">");
wsRequest.append("<whois:DomainName>");
wsRequest.append(domainName);
wsRequest.append("</whois:DomainName>");
wsRequest.append("</whois:WhoisRequest>");
final WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setDefaultUri("http://www.smartwerkz.com/whois-ws/");
// Custom MessageSender as workaround for missing SOAPAction HTTP Header
final HttpUrlConnectionMessageSender messageSender =
new HttpUrlConnectionMessageSender() {
@Override
public WebServiceConnection createConnection(String uri)
throws IOException {
HttpUrlConnection createConnection =
(HttpUrlConnection) super.createConnection(uri);
createConnection.getConnection().setRequestProperty(
"SOAPAction",
"http://www.smartwerkz.com/whois/Whois");
return createConnection;
}
};
webServiceTemplate.setMessageSender(messageSender);
webServiceTemplate.sendSourceAndReceiveToResult(
new StringSource(wsRequest.toString()), result);
// "result" contains the WhoisResponse XML structure with the requested
// whois information about the domain