This project is read-only.

Import in types section

Jun 9, 2015 at 6:37 PM
Sometimes the Types section can contain import statements, i fixed this by updating the ConvertTypes method
private void ConvertTypes(DescriptionType wsdl2, ServiceDescription wsdl1)
        {

            var types = wsdl2.Items.FirstOrDefault(s => s is TypesType) as TypesType;
            if (types==null)
                return;
            
            foreach (var e in types.Any)
            {
                switch (e.LocalName)
                {
                    case "import":
                        
                        string loc = e.Attributes.GetNamedItem("schemaLocation").InnerText;
                        string ns = e.Attributes.GetNamedItem("namespace").InnerText;

                        InvokeDocumentReference(ref loc);
                        wsdl1.Imports.Add(new Import() {Namespace = ns, Location = loc});
                    break;
                    default://schema
                        var sc = new XmlDocument();
                        var scRoot = sc.ImportNode(e, true);                                                
                        var s = XmlSchema.Read(new StringReader(scRoot.OuterXml), null);
                        wsdl1.Types.Schemas.Add(s);
                    break;
                }
                
                
            }
        }
Jun 23, 2015 at 5:26 PM
thanks gfepi!

I am not actively maintaining this project anymore but great that you have made this fix.