TimLuq / wsdl-to-ts

Generate TypeScript typings for WSDL services
ISC License
61 stars 48 forks source link

Wrongly generated Interface #7

Closed gitowiec closed 6 years ago

gitowiec commented 6 years ago

I just did

wsdl-to-ts https://secure.przelewy24.pl/external/wsdl/service.php?wsdl --tslint=false

and got this strange thing:

export interface ITrnRefundOutput {
    return: {
        /** xsd:complexType(undefined) */
        nsName: xsd:complexType;
        /** tns(undefined) */
        prefix: tns;
        /** complexType(undefined) */
        name: complexType;
        children: {
            0: {
                /** xsd:all(undefined) */
                nsName: xsd:all;
                /** xsd(undefined) */
                prefix: xsd;
                /** all(undefined) */
                name: all;
                children: {
                    0: {
                        /** xsd:element(undefined) */
                        nsName: xsd:element;
                        /** xsd(undefined) */
                        prefix: xsd;
                        /** element(undefined) */
                        name: element;
                        children: {};
                        xmlns: Przelewy24PortTypes.Ixmlns;
                        /** $value(undefined) */
                        valueKey: $value;
                        /** $xml(undefined) */
                        xmlKey: $xml;
                        ignoredNamespaces: Przelewy24PortTypes.IignoredNamespaces;
                        /** result(undefined) */
                        $name: result;
                        /** tns:ArrayOfSingleRefund(undefined) */
                        $type: tns:ArrayOfSingleRefund;
                    };
                    1: {
                        /** xsd:element(undefined) */
                        nsName: xsd:element;
                        /** xsd(undefined) */
                        prefix: xsd;
                        /** element(undefined) */
                        name: element;
                        children: {};
                        xmlns: Przelewy24PortTypes.Ixmlns;
                        /** $value(undefined) */
                        valueKey: $value;
                        /** $xml(undefined) */
                        xmlKey: $xml;
                        ignoredNamespaces: Przelewy24PortTypes.IignoredNamespaces;
                        /** error(undefined) */
                        $name: error;
                        /** tns:GeneralError(undefined) */
                        $type: tns:GeneralError;
                    };
                };
                xmlns: Przelewy24PortTypes.Ixmlns;
                /** $value(undefined) */
                valueKey: $value;
                /** $xml(undefined) */
                xmlKey: $xml;
                ignoredNamespaces: Przelewy24PortTypes.IignoredNamespaces;
            };
        };
        /** https://secure.przelewy24.pl/external/wsdl/service.php(undefined) */
        xmlns: https://secure.przelewy24.pl/external/wsdl/service.php;
        /** $value(undefined) */
        valueKey: $value;
        /** $xml(undefined) */
        xmlKey: $xml;
        ignoredNamespaces: Przelewy24PortTypes.IignoredNamespaces;
        /** TrnRefundResult(undefined) */
        $name: TrnRefundResult;
    };
}

That interface is wrong, it is not compatible with TypeScript, in case I am doing it wrong, how to use wsdl-to-ts?

Here is whole generated file https://gist.github.com/gitowiec/4e279a83a0fe404e46f5937474fbfc88

TimLuq commented 6 years ago

Interesting error. I'm able to replicate this error with the same WSDL and the cause of the weird output seem to be from the soap library. I haven't investigated enough to be exactly sure why it gives that result for this specific file.

The type information is extracted using soap::Client.describe() for v0.x, perhaps you should try using it directly and then open an issue over at the soap library if you see that the error persists.

Sorry for not being able to help out more at this time.