Juniper / go-netconf

NETCONF implementation in Go.
Other
253 stars 110 forks source link

fixed #89 delete xml.Header,When send rpc message #97

Closed neilliu89 closed 2 years ago

neilliu89 commented 4 years ago

I have the same question. I modify the session.go file's code like this, is ok. But I don't know why,maybe,it‘s the h3c's problem. I remove the xml header info, like this:

func (s Session) Exec(methods ...RPCMethod) (RPCReply, error) { rpc := NewRPCMessage(methods)

request, err := xml.Marshal(rpc)
if err != nil {
    return nil, err
}
//header := []byte(xml.Header)
//request = append(header, request...)
log.Debugf("REQUEST: %s\n", request)

I have no devices to test other product devices, so just the h3c device is ok.

nemith commented 2 years ago

It is a bug with h3c but it is optional anyway, however I don't think it is necessary.