Juniper / go-netconf

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

h3c any netconf(ssh) call failed #89

Open Niekq opened 5 years ago

Niekq commented 5 years ago

The request param just like the examples/ssh1/ssh1.go

Request: _<get-chassis-inventory/>_

Reply: &{XMLName:{Space:urn:ietf:params:xml:ns:netconf:base:1.0 Local:rpc-reply} Errors:[{Type:application Tag:operation-failed Severity:error Path: Message:The Line 2 Column 6 :" <?xml version="1.0" encoding="UTF-8"?> <rpc message-id="d38f44", no target name. Info:applicationoperation-failederrorThe Line 2 Column 6 :"

<?xml version="1.0" encoding="UTF-8"?>

<rpc message-id="d38f44", no target name.}] Data:applicationoperation-failederrorThe Line 2 Column 6 :"

<?xml version="1.0" encoding="UTF-8"?>

<rpc message-id="d38f44", no target name. Ok:false RawReply:<?xml version="1.0" encoding="UTF-8"?>applicationoperation-failederrorThe Line 2 Column 6 :"

<?xml version="1.0" encoding="UTF-8"?>

<rpc message-id="d38f44", no target name.}

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 not devices to test other product devices, so just the h3c device is ok.

zy943453722 commented 3 years ago

i have same question, who knows why? please explain, thanks!

nemith commented 2 years ago

Wild guess this may be the use of uuid for message ids. My rewrite is going to use proper atomically increasing integers per-session but no ETA on it (See #24 )

Getting a dump of the complete comminication would be good to add to the unit tests. Also any virtual h3c or way we can have access to one?