The important thing to call out in addition to what Gael and Javier said is that other than acting as an example, the language you use isn't all that important. AMT responds to WS-Man messages, as long as they are properly formatted.
To use power control as an example, the function used to power on the system is the RequestPowerStateChange function in the CIM_PowerManagementService class. This function requires 2 arguments, the reference to the CIM_ComputerSystem it's operating on (more on this later), and the power state you want this system to move to (this is an integer value).
The Power state is pretty straightforward, but the reference to CIM_ComputerSystem needs a bit more explanation. The reference to CIM_ComputerSystem gives which instance of CIM_ComputerSystem the power operation is working on. AMT has two instances, the one representing the computer is the one with Name="ManagedSystem".
So the most basic way you can call a power operation is:
1. Get the reference to CIM_PowerManagentService
2. Define the reference to the instance ofCIM_ComputerSystem
3. Create the power operation request
4. Invoke and parse the response.
Inthe RemoteControl java example (which is in the content here:), that looks like this:
1. Get the instance of CIM_PowerManagmentService
[bash]powerMS_ref = connection.newReference("CIM_PowerManagementService"); [/bash]
2.Define the reference to CIM_ComputerSystem (refer to the instance with Name=ManagedSystem)
[bash]computerSystem_ref = connection.newReference("CIM_ComputerSystem");
computerSystem_ref.addSelector("Name", "ManagedSystem"); computerSystem_ref.addSelector("CreationClassName", "CIM_ComputerSystem");[/bash]
3. Create the RequestPowerStateChange request
[bash]requestPSC_IN = powerMS_ref.createMethodInput("RequestPowerStateChange"); requestPSC_IN.setProperty("PowerState", Integer.toString(PowerState)); requestPSC_IN.setProperty("ManagedElement", computerSystem_ref)[/bash]
4. Invoke the request and parse the response
[java]requestPSC_OUT = (ManagedInstance)(powerMS_ref.invoke(requestPSC_IN)); return Integer.parseInt(requestPSC_OUT.getProperty("ReturnValue").toString()); [/java]
Unless there is a lot of abstraction in the example you're looking at, you'll seea very similar mapping to the underlying WS-Man infrastructure in those examples as well. For example, you'll see something similar in both the SDK examples and the DTK. Strictly speaking,it would be possible to build theWs-Man request out of raw strings, although I really don't recommend it, it'd be like coding in assembly.
The main reason I'm bringing up this point is for tworeasons. First, to point out the similarity to the well-documented flows in the SDK (look in the Features section). And second,that often the best way to debug is to look at the actual request that is getting sent to the AMT system over the wire with a traffic analyzer, and knowing the underlying structure is helpful for that.