We have consumed a third party web service and are trying to invoke it from an ASP.NET web application. However when I instantiate the web service the following System.Inval
I'm guessing the wsdl emitted by or supplied with the service is not in a form that wsdl.exe or serviceutil can understand - can you post the wsdl or link to it?
how are you creating the proxy classes?
Also you might like to try and validate the wsdl against the wsdl schema to check its valid
Another scenario where this error can happen: I simply had another web method with the same name (but different parameters)in my web service that slipped in during a code merge. After I deleted the old method it worked.
I have come across the exact same problem when I was consuming a 3rd party web service. The problem in this instance was that the mustUndertand property in the reference file was looking for a Boolean, whereby the namespace property looked for a string.
By looking through the reference i was able to idenitfy the offending property and simply add "overrides" to the method signature.
Not ideal as any time you update the service you have to do this but I couldn't find any other way around this.
To find the reference file select "all files" from the solution explorer
Hope this helps
I had the same issue but I found that one of the WebMethod
parameters has a member that is of type interface
that is why VS
could not serialise it. here is the exception when trying to download the disco
file
System.InvalidOperationException: Cannot serialize member 'Leopard.JobDespatchParameters.SendingUser' of type 'Leopard.Interfaces.IUser', see inner exception for more details. ---> System.NotSupportedException: Cannot serialize member Leopard.JobDespatchParameters.SendingUser of type Leopard.Interfaces.IUser because it is an interface.
I ran into the same problem earlier today. The reason was - the class generated by Visual Studio and passed as a parameter into one of the methods did not have a default parameterless constructor. Once I have added it, the error had gone.
It seems the problem is down to data type issues between VS and the web service that was written in Java.
Ultimately it was fixed by manually editing the class and schema files that were created by VS.