xapi-go icon indicating copy to clipboard operation
xapi-go copied to clipboard

Error Connecting to XenServer Beta 3

Open jhawk28 opened this issue 11 years ago • 6 comments

I get this error: Error connecting to XenServer: reading body error: type mismatch - can't unmarshal interface to string with this code:

package main

import (
    "fmt"
    "github.com/softlayer/xapi-go"
    "log"
)

func main() {
    fmt.Println("hello")

    client := xapi.NewXapiClient("http://172.16.88.129", "root", "password", "2.3")
    if err := client.Login(); err != nil {
        log.Fatal("Error connecting to XenServer: ", err)
    }

    session, _ := client.GetSession()
    fmt.Println(session)
}

I printed out the XML response:

<methodResponse><params><param><value><struct><member><name>Status</name><value>Success</value></member><member><name>Value</name><value>OpaqueRef:a490ac79-df44-d0a3-5270-ecdf56aeeeca</value></member></struct></value></param></params></methodResponse>

jhawk28 avatar Oct 06 '14 21:10 jhawk28

I'm seeing the same issue using version "1.2" and "1.1". Were you able to find a work around / fix?

euforia avatar Nov 10 '14 01:11 euforia

No, I haven't had time to look into it.

jhawk28 avatar Nov 10 '14 02:11 jhawk28

We are also seeing this, I've not been able to workout where the problem is. It looks on the surface like it should all work. Very odd

ajcrowe avatar Mar 05 '15 22:03 ajcrowe

I'm sorry for neglecting this library for so long. I pushed a change which I hope fixes this. I don't currently have a server to test against, so I have to rely on a stubbed response.

I also fixed some of the non-idiomtic names for things. Most notable, underscores are now gone.

sudorandom avatar Mar 13 '15 02:03 sudorandom

Reopening this since there's still some issues with what I have so far.

sudorandom avatar Mar 13 '15 03:03 sudorandom

If you let me know when you have something workable, I can test it out.

euforia avatar Mar 13 '15 19:03 euforia