views:

33

answers:

1

Is it possible to make the auto-generated WSDL for a .NET web service include descriptions for certain data types if no web method returns that data type of takes that data type as a parameter?

I could just include a dummy webmethod that never gets called, but I'm looking for a less hacky way. Thanks!

Mike

A: 

Arguably, they have no place in the wsdl if they aren't used... you can use [XmlInclude] to specify known subtypes, but I don't think that is what you mean. You could of course use a custom WSDL fragment, but I suspect the simplest option is, as you have hinted, to include a dummy method that involves them. To avoid having to add lots of dummy methods you could include the custom types as properties on a DummyEntity object returned from your DummyMethod - but it smells a bit ripe ;-p

What do you want these types for?

Marc Gravell
One of my web methods takes a data type called Foo, and it has a "String" property which is an encrypted Base64 serialization of type "Bar". I'd like "Bar" to appear in the proxy class so that developers have access to create one and encode it properly. "Bar" doesn't appear anywhere else unencoded. Normally one would use an encrypted transport like HTTPS, but in this case the data has to be encrypted and sit in a DB while it's being processed.. I think you're right though, technically the data has no business being part of the WSDL, I should just give developers a little API library to use.
Mike