Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230200

Re: vCenter Converter API with Ruby

$
0
0

Hi,

 

I started to poke around with Ruby and SOAP (with Savon) to find a way to make requests to the API.

I was able to figure out how to send the requests, but one thing bugs me out. It's the "_this" parameter for all requests that is required.

For example, if I want to send a ConverterLogin request, I need to pass userName and password parameters with the request and "_this" parameter.

From the API docs I see that "_this" parameter is a reference to the method itself, but I'm not sure what exactly this means.

This is a dump of my request (so far):

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:converter="urn:converter" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

<env:Body>

<converter:ConverterLogin>

<converter:_this type="ConverterServiceInstance">ServiceInstance</converter:_this>

<converter:userName>MyUser</converter:userName>

<converter:password>MyPassword</converter:password>

</converter:ConverterLogin>

</env:Body>

</env:Envelope>

but each time I get "ManagedObjectNotFoundFault" from the API

<ManagedObjectNotFoundFault xmlns="urn:converter" xsi:type="vim25:ManagedObjectNotFound" xmlns:vim25="urn:vim25">

<vim25:obj type="ConverterServiceInstance">ServiceInstance</vim25:obj>

</ManagedObjectNotFoundFault>

 

Can someone explain to me what is this "_this" parameter and how need to be used correctly. I'm a little bit noob in this area, so more details will be good and sample XML dumps will be fine as well...

 

Thanks


Viewing all articles
Browse latest Browse all 230200

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>