lumeohq / xsd-parser-rs

A xsd/wsdl => rust code generator written in rust
Apache License 2.0
100 stars 39 forks source link

Panics trying to generate from ws-discovery.wsdl #157

Open Alibirb opened 9 months ago

Alibirb commented 9 months ago

When trying to generate code for https://github.com/lumeohq/onvif-rs/blob/main/wsdl/ws-discovery.wsdl, I get:

thread 'main' panicked at wsdl-parser/src/generator/function.rs:53:17:
internal error: entered unreachable code: No present in ONVIF

I added a debugging line and found that the operation it fails on is:

Operation {
    node: Element { tag_name: {http://schemas.xmlsoap.org/wsdl/}operation, attributes: [Attribute { name: name, value: "HelloOp" }], namespaces: [Namespace { name: Some("tns"), uri: "http://schemas.xmlsoap.org/ws/2005/04/discovery" }, Namespace { name: Some("wsa"), uri: "http://schemas.xmlsoap.org/ws/2004/08/addressing" }, Namespace { name: Some("wsdl"), uri: "http://schemas.xmlsoap.org/wsdl/" }, Namespace { name: Some("xs"), uri: "http://www.w3.org/2001/XMLSchema" }] },
    ty: Notification {
        output: Param {
            node: Element { tag_name: {http://schemas.xmlsoap.org/wsdl/}output, attributes: [Attribute { name: message, value: "tns:HelloMsg" }, Attribute { name: {http://schemas.xmlsoap.org/ws/2004/08/addressing}Action, value: "http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello" }], namespaces: [Namespace { name: Some("tns"), uri: "http://schemas.xmlsoap.org/ws/2005/04/discovery" }, Namespace { name: Some("wsa"), uri: "http://schemas.xmlsoap.org/ws/2004/08/addressing" }, Namespace { name: Some("wsdl"), uri: "http://schemas.xmlsoap.org/wsdl/" }, Namespace { name: Some("xs"), uri: "http://www.w3.org/2001/XMLSchema" }] },
        },
    },
}