Reputation: 21
Hi it is possible generate proxy object from wsdl file in code dynamically?
I know that I can use tool wsdl.exe but I would like have a option download wsdl based on URL and in code generate proxy object.
Client is in C#, web service is in Java.
Upvotes: 1
Views: 1791
Reputation: 607
Wsdl.exe uses the framework classes from System.Xml and System.Web.Services to does its magic. However, those classes are obscure and quite difficult to find using a Google search, unless you specifically know the class names themselves.
A good idea is to look at Mono's wsdl.exe source code: http://c-cpp.r3dcode.com/files/mono/2/10.2/mcs/tools/wsdl/MonoWSDL2.cs
This will get you as far as generating the stub code.
Edit: John thinks that asmx is legacy, and svcutil is the way to go. If you ask me, SOAP itself is legacy and REST is the way to go. But since the question is about SOAP and svcutil is supposedly a better technology, here's how svcutil works:
http://c-cpp.r3dcode.com/files/mono/2/10.2/mcs/tools/svcutil/Driver.cs.
Upvotes: 1