Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: Unable to use the generated type from wsdl #12063

Closed
seema-emc opened this Issue Aug 6, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@seema-emc
Copy link

seema-emc commented Aug 6, 2015

I am very new to Go and unable to find help on other sources. I am trying to create go code with standard vim25.wsdl file. It generated the go code successfully. Two structures are here..

type RetrieveServiceContentRequestType struct {
XMLName xml.Name xml:"urn:vim25 RetrieveServiceContentRequestType"

This *ManagedObjectReference `xml:"_this,omitempty"`

}

type ManagedObjectReference struct {
XMLName xml.Name xml:"urn:vim25 ManagedObjectReference"

Value string

Type string `xml:"type,attr,omitempty"`

}

Now I am unable to assign values to RetrieveServiceContentRequestType as follows with following error:
client := mysoap.NewVimPortType("https://myvc/sdk", true)

var serviceInstance = mysoap.ManagedObjectReference{
    Type:  "ServiceInstance",
    Value: "ServiceInstance",
}
fmt.Println(serviceInstance)
req := mysoap.RetrieveServiceContentRequestType{
    This: &serviceInstance,
}
_, err:= client.RetrieveServiceContent(&req)

Error xml: name "_this" in tag of mysoap.RetrieveServiceContentRequestType.This
conflicts with name "ManagedObjectReference" in *mysoap.ManagedObjectReference.X
MLName

Any help would be appreciated.

@adg

This comment has been minimized.

Copy link
Contributor

adg commented Aug 7, 2015

Hi. This issue tracker is for tracking bugs in the Go project. If you need help, please ask the mailing list.

@adg adg closed this Aug 7, 2015

@mikioh mikioh changed the title Unable to use the generated type from wsdl encoding/xml: Unable to use the generated type from wsdl Aug 7, 2015

@golang golang locked and limited conversation to collaborators Aug 8, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.