views:

225

answers:

2

Hi everybody,

for a web service, depending on a XML file, there are a couple af classes in C# generated. Depending on these classes, there is at compile time then the WSDL file generated. Is there a possibility at runtime to simply replace the XML file and to have the WSDL file generated on the fly?

Best regards, Valer

A: 

I thought the WSDL was generated on the fly when you did Service.asmx?wsdl or somesuch?

Lloyd
A: 

That would be inadvisable, and really doesn't make a lot of sense in the context of a compiled application.

The WSDL is an XML-formatted version of the interface of a class. This interface is fixed at compile time. In order for the WSDL to change, the class interface would have to change, which can't (or, at the very least, shouldn't - anything is possible) happen at run time.

If you're worried about generating the WSDL for a service you're consuming, rather than producing, then the same problem applies. An updated WSDL could, say, rename all of the methods by giving them a prefix, like, "fu_Update()" where your app expects "Update()," in which case any code that referenced that service would break.

Interpreted languages will probably let you do this, but it's of little or no benefit, since just about anytime the WSDL changes, the code that uses it will have to change, as well.

David Lively