The relationship between MObjects + MFn function sets is one of the stranger features of the OpenMaya API, and can be hard to wrap your head around. Basically, the mobject represents the actual "data", is is generally what is passed into / from the various methods, while the MFns can be thought of as classes used to "decode" the data, so that you can actually interact with them. Therefore, before you can actually do anything with an MObject, you will often need to cast it into the appropriate MFn function set.
In your case, since MFnSingleIndexedComponent.create returns an MObject, you need to then immediately turn around and cast that MObject into an MFnSingleIndexedComponent object (or set an an existing MFnSingleIndexedComponent to point to it).
Also, note that since the apiComponents arg to getWeights is an INPUT parameter, you will need to modify / set it BEFORE calling getWeights.
- Paul