softlayer / xapi-go

A XAPI (XenServer API) go binding with native interfaces and structs. Still a work in progress, welcoming pull requests.
Other
15 stars 11 forks source link

Error Connecting to XenServer Beta 3 #5

Open jhawk28 opened 10 years ago

jhawk28 commented 10 years ago

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>
euforia commented 10 years ago

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

jhawk28 commented 10 years ago

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

ajcrowe commented 9 years ago

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

sudorandom commented 9 years ago

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 commented 9 years ago

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

euforia commented 9 years ago

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