IBM Support

How do I use the Wake-On-Lan SOAP WSDL?

Technote (troubleshooting)


Problem(Abstract)

The Root Server exposes a SOAP interface providing the ability to initiate Wake-On-LAN requests to sets of computers.

Resolving the problem

The Root Server exposes a SOAP interface providing the ability to initiate Wake-On-LAN requests to sets of computers. Below is the WSDL for the interface:

 
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tns="http://schemas.bigfix.com/WakeOnLAN" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://schemas.bigfix.com/WakeOnLAN" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://schemas.bigfix.com/WakeOnLAN" xmlns="http://www.w3.org/2001/XMLSchema">
<xs:element name="WakeOnLANRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Computer">
<xs:complexType>
<xs:attribute name="ComputerID" type="xs:unsignedLong" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</schema>
</wsdl:types>
<wsdl:message name="WakeOnLANIn">
<wsdl:part name="parameters" element="tns:WakeOnLANRequest" />
</wsdl:message>
<wsdl:portType name="WakeOnLANPortType">
<wsdl:operation name="WakeOnLAN">
<wsdl:input message="tns:WakeOnLANIn" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WakeOnLANBinding" type="tns:WakeOnLANPortType">
<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="WakeOnLAN">
<wsdlsoap:operation soapAction="http://schemas.bigfix.com/WakeOnLAN" />
<wsdl:input>
<wsdlsoap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WakeOnLANService">
<wsdl:port name="WakeOnLANPort" binding="tns:WakeOnLANBinding">
<wsdlsoap:address location="http://example.com/WakeOnLAN" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Here is an example Perl script for using the interface:
# WakeOnLAN.pl

use strict;
use SOAP::Lite;

$SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE = 1; # Prevents the error Unexpected Content-Type 'text/plain'

my $service = SOAP::Lite->uri( "http://amakihi.bigfix.com:52311/WakeOnLAN.wsdl" )->proxy( "http://amakihi.bigfix.com:52311/WakeOnLAN" );

my $args =
[
	SOAP::Data->name( "Computer" )->attr( { "ComputerID" => "2345" } ),
	SOAP::Data->name( "Computer" )->attr( { "ComputerID" => "2334634645" } )
];

my $result = $service->WakeOnLAN( $args );
if ( $result && $result->fault )
{
print "Error: " . $result->faultstring . "\n";
}
else
{
print "Success!\n";
}
Here is an example C# for using the interface:
using System;
using System.Collections.Generic;
using System.Text;
using WakeOnLAN;

namespace WakeOnLAN
{
class Program
{
static void Main(string[] args)
{
try
{
if ( args.GetLength( 0 ) != 2 )
{
Console.Out.WriteLine( "Usage: WakeOnLAN.exe 
      
      
       " );
Console.Out.WriteLine( "Example: WakeOnLAN.exe bes.example.com:52311 234534232" );
return;
}

WakeOnLAN.WakeOnLANService wakeOnLAN = new WakeOnLAN.WakeOnLANService();
wakeOnLAN.Url = "http://" + args[0] + "/WakeOnLAN";

WakeOnLAN.WakeOnLANRequestComputer computer = new WakeOnLAN.WakeOnLANRequestComputer();
computer.ComputerID = System.Convert.ToUInt64( args[1] );

WakeOnLAN.WakeOnLANRequestComputer[] computers = new WakeOnLAN.WakeOnLANRequestComputer[1]{ computer };

wakeOnLAN.WakeOnLAN( computers );
Console.Out.WriteLine( "Success!" );
}
catch ( System.Exception e )
{
Console.Error.WriteLine( "Error: " + e.Message );
}
}
}
}

      
     

Historical Number

1200

Document information

More support for: IBM BigFix family

Software version: Version Independent

Operating system(s): Platform Independent

Reference #: 1506266

Modified date: 18 September 2014


Translate this page: