Error related to ASMX files

I'm trying to import a webservice but I get the following error System.InvalidOperationException: There is an error in XML document (3, 2). ---> System.InvalidOperationException: <html xmlns=""> was not expected. at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read125_definitions() at System.Web.Services.Description.ServiceDescription.ServiceDescriptionSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader) at System.Web.Services.Description.ServiceDescription.Read(XmlReader reader, Boolean validate) at System.Web.Services.Description.ServiceDescription.Read(TextReader textReader, Boolean validate) at System.Web.Services.Description.ServiceDescription.Read(TextReader textReader) at Mendix.Modeler.WebServices.WsdlInfo.CreateServiceDescription(String contents) at Mendix.Modeler.WebServices.WsdlInfo.BuildContents(String url, List1 messages) at Mendix.Modeler.WebServices.WsdlInfo.FromUrl(String url, List1 messages) at Mendix.Modeler.WebServices.WsdlFileEditor.<>cDisplayClass1.<tryimportwsdl>b0(WorkerTaskInfo info) at Mendix.Utility.WorkerTask.backgroundWorker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument) However, when I go to the URL in the webbrowser I can only see '.asmx' files or operations...are they supported or not?
3 answers

Are you sure you're trying to read the WSDL file and not some other HTML documentation file? HTML documentation should have a link to the WSDL that you can import in the modeler.

In other cases you might have to append "?wsdl" or "?WSDL" to the URL to get the correct WSDL (which should, as Michel noted, always start with


System.InvalidOperationException: <html xmlns=""> was not expected

The file should start with <?xml> not with <html> This just seems to be a bad WSDL file. It might be the case that you are trying to parse a descriptive page of the webservice, instead of the webservice itself.

In the mendixsuite the description for the webservices is for example located at while the WSDL file is located at

A proper WSDL file always starts with

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions ...

Achiel was right, I wasn't importing the actual WSDL file.

Once I tried the actual WSDL file there were no problems