PDA

View Full Version : wsdl and code generation


spmva
05-20-2005, 12:44 PM
has anyone found an existing solution to the wsdl tool provided by microsoft generating value objects as public variables instead of properties? the obvious problem with public variables is that you can't data bind to them.

i was able to find this:

http://weblogs.asp.net/britchie/archive/2004/08/30/222507.aspx

it generates properties instead of public variables...at least until you have a complex object containing an array of complex objects...then it reverts back to the annoying public variable for that array. i poked around the source code for a little while, but was unable to really find the problem. i asked the author for direction, but as of yet, he has not yet got back to me regarding his work.

any suggestions?

thanks...

steve

Alistair
05-22-2005, 03:32 AM
Have you had a look at Dingo (http://dingo.sourceforge.net/)? I'm not sure if its what you're after...

spmva
05-22-2005, 12:00 PM
thanks for replying. i looked at dingo earlier while i was searching about for a solution. at your suggestion, i looked a little more closely and as best i can tell, dingo is more of a object serialization library as opposed to a code generation tool.

dingo concerns itself with how to persist an object to xml.

my need is somewhat different. i need to generate classes from a .wsdl file.

given all that smart stuff microsoft has going for it in web services support, i can't understand why they chose to generate client side classes using public variables, especially since you can't data bind to them. my conspiracy meter tells me that it is meant to discourage usage of value objects in favor of microsoft specific implementations.

if i have the wrong impression of dingo, please let me know. beyond that, i'm still looking for an answer.

Alistair
05-22-2005, 12:48 PM
You're right. I didn't read your first post correctly and assumed Dingo was more in line with what you were looking for.

Mark Pollack
05-23-2005, 08:23 PM
Hi,

I ran across this problem in a different context a while ago when I wanted to do databinding for nested properties of domain objects inside my own ITypedList. The old post is here (http://blogs.msdn.com/asanto/archive/2003/10/07/30937.aspx) but the sample program is long gone. Basically you can create your own implementation of a PropertyDescriptor such that public fields are exposed for databinding then expose it in your own collection class via ITypedList.GetItemProperties.

Alternatively, this sounds like a nice feature to have in Spring's WebServiceProxyFactory (http://opensource.atlassian.com/confluence/spring/display/NET/Web+Services+Support) which takes the code generated by wsdl.exe and generates a proxy that will implement an interface. The same approach using a codedom based proxy (http://www.codeproject.com/vb/net/leaditwebservicewrapper.asp) was used in another article on this topic from that time. You could probably use the existing WebServiceProxyFactory if you explicitly include the properties as part of the exposed interface and implement the same methods on the server side. I'll try playing around with this later cause I'm kinda curious.

Some googling right now turned up some info on msdn here (http://msdn.microsoft.com/msdnmag/issues/05/04/NETMatters/default.aspx) and here (http://msdn.microsoft.com/msdnmag/issues/05/05/CuttingEdge/default.aspx).

Cheers,
Mark

Ted Husted
05-23-2005, 10:57 PM
This is not on-topic to this thread, but it seems to be in the same neighborhood, so I'lll toss this one out.

Is there a way to auto-bind DataGrid columns to an IDictionary, where dictionary[xyz] generates a column[xyz] in the grid?

In this application, we haven't found a use for a formal domain object layer. The business layer is bringing things down as a collection of IDictionaries, but I can't get the DataGrid to read the IDictionary entries. Right now, we're wrapping the IDictionaries in another object to provide public properties, just to appease the datagrid.

-Ted.

spmva
05-31-2005, 05:09 PM
thanks for the reply. i got a response from the gentleman whom i referred to in the post that started this thread. he gave me some slight direction and from that i was able to mod the code to generate properties for all members. i made some further additions to also support dynamic urls, similar to the url behavior property that can be set in visual studio for a web reference.

he asked me to send him the changes, if decided to make them, so now that the tool is somewhat tested, i'll be sending it his way. i'm not sure what kind of qc he plans to do with it prior to posting it on his site, but if anyone needs the code fix or the newly compiled tool, please let me know.

steve

Mark Pollack
06-12-2005, 10:49 PM
Hi,

Some googling on a related topic turned up similar tools on GotDotNet (http://www.gotdotnet.com/workspaces/workspace.aspx?id=80258a8c-bb4c-48e6-948b-05f6da568f55), the ebay dev program (http://developer.ebay.com/examples/c-sharp/CustomSOAPProxyGenerator), and this MSDN article (http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/webservicewrapper.mspx). I'll experimentusing overall approach described in the MSDN article but use our dynamic proxy instead of CodeDom.

Cheers,
Mark

spmva
06-13-2005, 01:12 PM
Microsoft has gotten with the program a bit. The WSE3 Toolkit supports property generation. Just a technical preview right now though. I haven't tested it myself yet. From Brian Ritchie's Blog (http://weblogs.asp.net/britchie/archive/2005/06/12/411985.aspx) which contains the link to Microsoft's Web Services Enhancements (WSE) (http://msdn.microsoft.com/webservices/building/wse/default.aspx) site.

spmva
06-14-2005, 04:21 PM
My fixes allowing the wsdl tool to generate properties instead of fields in the proxy have been integrated. The tool is available here (http://weblogs.asp.net/britchie/archive/2005/06/14/412274.aspx).

Alistair
06-14-2005, 11:30 PM
That link is generating an ASP.Net web server error at the moment...

spmva
06-15-2005, 11:50 AM
i just tried it a moment ago and didn't see a problem. please give it a shot again. if you still have problems, the direct url to the dowload is here (http://www.dotnetpowered.com/download/wsdl.zip).

regarding this tool and my post (http://forum.springframework.net/viewtopic.php?t=138) regarding the sharing of classes among web services, i was wondering if anyone had any thoughts on how a tool like this might be further adapted to solve that problem.

it occured to me that the tool could be modified to accept a number of web service urls and generate proxies for each as normal. it could then simply write all of the custom classes to one or more class files eliminating the duplication.

any thoughts would be appreciated...including those that tell me why this functionality doesn't exist somewhere already.

steve