Usage

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:

SOAP request, secured

  1. Download, install and start soapui
  2. Create a new project
  3. Enter Whois-WS as project name
  4. Enter http://www.smartwerkz.com/whois-ws/whois.wsdl as WSDL Location
  5. Click OK to import the WSDL and create a sample request
  6. Expand the tree and open Request 1
  7. Edit the XML source and replace the "?" with a domain name of your choice
  8. Click the green arrow button in the upper left corner of the Request window
  9. You should now see the XML Response by the Whois-WS on the right side.
  10. In case of errors, you will see the error message of the webserver

Java+Spring+Maven

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			

				

Java/Plain


PHP

No example available yet.


JavaScript

No example available yet.


Ruby

No example available yet.